summaryrefslogtreecommitdiff
path: root/desktop/selection.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-04-29 14:47:06 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2013-04-29 14:47:06 +0100
commit6784e90a3a0260caddebf7988aa6c0c9169b6894 (patch)
tree404e9ba63cc455355610911874f951a43bb4f5ca /desktop/selection.c
parenta4a3bcd97925943f158a01b69020fe6636a0f82d (diff)
downloadnetsurf-6784e90a3a0260caddebf7988aa6c0c9169b6894.tar.gz
netsurf-6784e90a3a0260caddebf7988aa6c0c9169b6894.tar.bz2
Remove unused selection_get_{start|end} APIs and their helper function.
Diffstat (limited to 'desktop/selection.c')
-rw-r--r--desktop/selection.c68
1 files changed, 0 insertions, 68 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.