From ba474f1c91417a7aa6e07fbe0977523f94d6d3f6 Mon Sep 17 00:00:00 2001 From: Adrian Lees Date: Sun, 12 Feb 2006 21:23:22 +0000 Subject: [project @ 2006-02-12 21:23:21 by adrianl] Show all matches svn path=/import/netsurf/; revision=2076 --- desktop/selection.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'desktop') diff --git a/desktop/selection.c b/desktop/selection.c index 2bb8cb4e7..689e2cbd9 100644 --- a/desktop/selection.c +++ b/desktop/selection.c @@ -127,9 +127,11 @@ struct selection *selection_create(struct browser_window *bw) /** - * Destroys a selection object. + * Destroys a selection object, without updating the + * owning window (caller should call selection_clear() + * first if update is desired) * - * \param s selection object + * \param s selection object */ void selection_destroy(struct selection *s) @@ -154,15 +156,22 @@ void selection_reinit(struct selection *s, struct box *root) assert(s); - if (s->root == root) { - /* keep the same number space as before, because we want - to keep the selection too */ - root_idx = (s->max_idx & 0xF0000000U); - } - else { + if (IS_INPUT(root)) { static int next_idx = 0; root_idx = (next_idx++) << 28; } + else + root_idx = 0; + +// if (s->root == root) { +// /* keep the same number space as before, because we want +// to keep the selection too */ +// root_idx = (s->max_idx & 0xF0000000U); +// } +// else { +// static int next_idx = 0; +// root_idx = (next_idx++) << 28; +// } s->root = root; if (root) { @@ -667,8 +676,6 @@ void selection_select_all(struct selection *s) old_start = s->start_idx; old_end = s->end_idx; -LOG(("selection was %d: %u to %u, max %u", was_defined, old_start, old_end, s->max_idx)); - s->defined = true; s->start_idx = 0; s->end_idx = s->max_idx; -- cgit v1.2.3