mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-27 03:44:23 +03:00
Assert first, before acting on selection
svn path=/trunk/netsurf/; revision=4799
This commit is contained in:
parent
a66415564f
commit
1c6012aae5
@ -1825,13 +1825,18 @@ bool delete_handler(struct browser_window *bw, struct box *b,
|
||||
void delete_selection(struct selection *s)
|
||||
{
|
||||
size_t start_offset, end_offset;
|
||||
struct box *text_box = selection_get_start(s, &start_offset);
|
||||
struct box *end_box = selection_get_end(s, &end_offset);
|
||||
struct box *text_box;
|
||||
struct box *end_box;
|
||||
struct box *next;
|
||||
size_t sel_len = s->end_idx - s->start_idx;
|
||||
size_t sel_len;
|
||||
int beginning = 0;
|
||||
|
||||
assert(s->defined);
|
||||
|
||||
text_box = selection_get_start(s, &start_offset);
|
||||
end_box = selection_get_end(s, &end_offset);
|
||||
sel_len = s->end_idx - s->start_idx;
|
||||
|
||||
/* Clear selection so that deletion from textboxes proceeds */
|
||||
selection_clear(s, true);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user