diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2006-04-14 00:27:49 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2006-04-14 00:27:49 +0000 |
commit | 3e54aab0d561a071ca6d42de617f688533d33b0c (patch) | |
tree | 9deedc6cbe7165ef675a0cc4b076d6549f3bfe8b /riscos | |
parent | 1b7797b3956d4cebac55c94cab951a85b67611cb (diff) | |
download | netsurf-3e54aab0d561a071ca6d42de617f688533d33b0c.tar.gz netsurf-3e54aab0d561a071ca6d42de617f688533d33b0c.tar.bz2 |
Fix insertion of unordered base nodes
svn path=/trunk/netsurf/; revision=2529
Diffstat (limited to 'riscos')
-rw-r--r-- | riscos/global_history.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/riscos/global_history.c b/riscos/global_history.c index 5db03dc5d..93cb34be7 100644 --- a/riscos/global_history.c +++ b/riscos/global_history.c @@ -285,26 +285,10 @@ bool global_history_add_internal(const char *url, visit_date = data->last_visit; + /* find parent node */ for (i = 0; i < global_history_base_node_count; i++) { if (global_history_base_node_time[i] <= visit_date) { parent = global_history_base_node[i]; - if (!parent->deleted) - break; - link = global_history_tree->root; - for (j = 0; j < i; j++) { - if (!global_history_base_node[j]->deleted) { - link = global_history_base_node[j]; - before = true; - break; - } - } - tree_link_node(link, parent, before); - if (!global_history_init) { - tree_recalculate_node_positions( - global_history_tree->root); - tree_redraw_area(global_history_tree, - 0, 0, 16384, 16384); - } break; } } @@ -313,6 +297,30 @@ bool global_history_add_internal(const char *url, if (!parent) return true; + if (parent->deleted) { + /* parent was deleted, so find place to insert it */ + link = global_history_tree->root; + + for (j = global_history_base_node_count - 1; j >= 0; j--) { + if (!global_history_base_node[j]->deleted && + global_history_base_node_time[j] > + global_history_base_node_time[i]) { + link = global_history_base_node[j]; + before = true; + break; + } + } + + tree_link_node(link, parent, before); + + if (!global_history_init) { + tree_recalculate_node_positions( + global_history_tree->root); + tree_redraw_area(global_history_tree, + 0, 0, 16384, 16384); + } + } + /* find any previous occurance */ if (!global_history_init) { node = ro_gui_global_history_find(url); |