diff options
author | Vincent Sanders <vince@kyllikki.org> | 2020-05-23 22:09:40 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2020-05-23 23:00:08 +0100 |
commit | 2ea577c47ecca38a0b2d15b15d242c771ce59e29 (patch) | |
tree | fcc5dd27bcd3f5942bb6b58fd5c2d948c4b5ee5f /desktop | |
parent | a8c540ea597fb17426c5458fa464f9c505c3bda8 (diff) | |
download | netsurf-2ea577c47ecca38a0b2d15b15d242c771ce59e29.tar.gz netsurf-2ea577c47ecca38a0b2d15b15d242c771ce59e29.tar.bz2 |
remove unused is_html parameter to text selection routines
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/selection.c | 25 | ||||
-rw-r--r-- | desktop/selection.h | 6 |
2 files changed, 10 insertions, 21 deletions
diff --git a/desktop/selection.c b/desktop/selection.c index 40edff885..1fac7e225 100644 --- a/desktop/selection.c +++ b/desktop/selection.c @@ -49,13 +49,6 @@ #include "netsurf/window.h" #include "desktop/gui_internal.h" -/** - * Text selection works by labelling each node in the box tree with its - * start index in the textual representation of the tree's content. - */ - -#define SPACE_LEN(b) ((b->space == 0) ? 0 : 1) - struct selection_string { char *buffer; @@ -67,8 +60,6 @@ struct selection_string { }; - - /** * Redraws the given range of text. * @@ -254,24 +245,24 @@ selection_string_append(const char *text, /* exported interface documented in desktop/selection.h */ -struct selection *selection_create(struct content *c, bool is_html) +struct selection *selection_create(struct content *c) { - struct selection *s; - s = calloc(1, sizeof(struct selection)); - if (s) { - selection_prepare(s, c, is_html); + struct selection *sel; + sel = calloc(1, sizeof(struct selection)); + if (sel) { + selection_prepare(sel, c); + selection_init(sel); } - return s; + return sel; } /* exported interface documented in desktop/selection.h */ -void selection_prepare(struct selection *s, struct content *c, bool is_html) +void selection_prepare(struct selection *s, struct content *c) { if (s) { s->c = c; - s->is_html = is_html; s->root = NULL; s->drag_state = DRAG_NONE; s->max_idx = 0; diff --git a/desktop/selection.h b/desktop/selection.h index e570d8311..4f3e8b002 100644 --- a/desktop/selection.h +++ b/desktop/selection.h @@ -53,7 +53,6 @@ struct selection unsigned end_idx; bool defined; - bool is_html; seln_drag_state drag_state; }; @@ -79,7 +78,7 @@ struct selection * * \return new selection context */ -struct selection *selection_create(struct content *c, bool is_html); +struct selection *selection_create(struct content *c); /** * Prepare a newly created selection object for use. @@ -88,9 +87,8 @@ struct selection *selection_create(struct content *c, bool is_html); * * \param s selection object * \param c content - * \param is_html true if content is html false if content is textplain */ -void selection_prepare(struct selection *s, struct content *c, bool is_html); +void selection_prepare(struct selection *s, struct content *c); /** * Destroys a selection object clearing it if nesessary |