diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2013-04-29 14:47:06 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2013-04-29 14:47:06 +0100 |
commit | 6784e90a3a0260caddebf7988aa6c0c9169b6894 (patch) | |
tree | 404e9ba63cc455355610911874f951a43bb4f5ca /desktop | |
parent | a4a3bcd97925943f158a01b69020fe6636a0f82d (diff) | |
download | netsurf-6784e90a3a0260caddebf7988aa6c0c9169b6894.tar.gz netsurf-6784e90a3a0260caddebf7988aa6c0c9169b6894.tar.bz2 |
Remove unused selection_get_{start|end} APIs and their helper function.
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/selection.c | 68 | ||||
-rw-r--r-- | desktop/selection.h | 3 |
2 files changed, 0 insertions, 71 deletions
diff --git a/desktop/selection.c b/desktop/selection.c index 90ce33372..6a93c6133 100644 --- a/desktop/selection.c +++ b/desktop/selection.c @@ -83,7 +83,6 @@ static bool traverse_tree(struct box *box, unsigned start_idx, unsigned end_idx, seln_traverse_handler handler, void *handle, save_text_whitespace *before, bool *first, bool do_marker); -static struct box *get_box(struct box *b, unsigned offset, size_t *pidx); /** @@ -964,73 +963,6 @@ void selection_set_end(struct selection *s, unsigned offset) /** - * Get the box and index of the specified byte offset within the - * textual representation. - * - * \param b root node of search - * \param offset byte offset within textual representation - * \param pidx receives byte index of selection start point within box - * \return ptr to box, or NULL if no selection defined - */ - -struct box *get_box(struct box *b, unsigned offset, size_t *pidx) -{ - struct box *child = b->children; - - if (b->text) { - - if (offset >= b->byte_offset && - offset <= b->byte_offset + b->length + SPACE_LEN(b)) { - - /* it's in this box */ - *pidx = offset - b->byte_offset; - return b; - } - } - - /* find the first child that could contain this offset */ - if (child) { - struct box *next = child->next; - while (next && next->byte_offset < offset) { - child = next; - next = child->next; - } - return get_box(child, offset, pidx); - } - - return NULL; -} - - -/** - * Get the box and index of the selection start, if defined. - * - * \param s selection object - * \param pidx receives byte index of selection start point within box - * \return ptr to box, or NULL if no selection defined - */ - -struct box *selection_get_start(struct selection *s, size_t *pidx) -{ - return (s->defined ? get_box(s->root, s->start_idx, pidx) : NULL); -} - - -/** - * Get the box and index of the selection end, if defined. - * - * \param s selection object - * \param pidx receives byte index of selection end point within box - * \return ptr to box, or NULL if no selection defined. - */ - -struct box *selection_get_end(struct selection *s, size_t *pidx) -{ - return (s->defined ? get_box(s->root, s->end_idx, pidx) : NULL); -} - - -/** * Tests whether a text range lies partially within the selection, if there is * a selection defined, returning the start and end indexes of the bytes * that should be selected. diff --git a/desktop/selection.h b/desktop/selection.h index aebb1698f..68f60b9be 100644 --- a/desktop/selection.h +++ b/desktop/selection.h @@ -83,9 +83,6 @@ void selection_select_all(struct selection *s); void selection_set_start(struct selection *s, unsigned idx); void selection_set_end(struct selection *s, unsigned idx); -struct box *selection_get_start(struct selection *s, size_t *pidx); -struct box *selection_get_end(struct selection *s, size_t *pidx); - bool selection_click(struct selection *s, browser_mouse_state mouse, unsigned idx); void selection_track(struct selection *s, browser_mouse_state mouse, |