diff options
author | Adrian Lees <adrian@aemulor.com> | 2005-04-20 12:24:41 +0000 |
---|---|---|
committer | Adrian Lees <adrian@aemulor.com> | 2005-04-20 12:24:41 +0000 |
commit | 31c659a2ea8bf239569c8436e3b718786879df47 (patch) | |
tree | 4f934f55f0ba0151372135156e4bdb3ff461c6b4 /render | |
parent | a01210941b7717317cd4bd3c451596a845093d9c (diff) | |
download | netsurf-31c659a2ea8bf239569c8436e3b718786879df47.tar.gz netsurf-31c659a2ea8bf239569c8436e3b718786879df47.tar.bz2 |
[project @ 2005-04-20 12:24:41 by adrianl]
text import from global clipboard, other apps & files and additional keys for editing text in textareas
svn path=/import/netsurf/; revision=1673
Diffstat (limited to 'render')
-rw-r--r-- | render/box.c | 30 | ||||
-rw-r--r-- | render/box.h | 1 |
2 files changed, 30 insertions, 1 deletions
diff --git a/render/box.c b/render/box.c index 7e0df2483..f00b8aa1d 100644 --- a/render/box.c +++ b/render/box.c @@ -133,7 +133,35 @@ void box_insert_sibling(struct box *box, struct box *new_box) /** - * Free the a box tree recursively. + * Unlink a box from the box tree and then free it recursively. + * + * \param box box to unlink and free recursively. + */ + +void box_unlink_and_free(struct box *box) +{ + struct box *parent = box->parent; + struct box *next = box->next; + struct box *prev = box->prev; + + if (parent) { + if (parent->children == box) + parent->children = next; + if (parent->last == box) + parent->last = next ? next : prev; + } + + if (prev) + prev->next = next; + if (next) + next->prev = prev; + + box_free(box); +} + + +/** + * Free a box tree recursively. * * \param box box to free recursively * diff --git a/render/box.h b/render/box.h index bcdf79005..60aba1ba5 100644 --- a/render/box.h +++ b/render/box.h @@ -234,6 +234,7 @@ struct box * box_create(struct css_style *style, char *id, void *context); void box_add_child(struct box *parent, struct box *child); void box_insert_sibling(struct box *box, struct box *new_box); +void box_unlink_and_free(struct box *box); void box_free(struct box *box); void box_free_box(struct box *box); void box_free_object_params(struct object_params *op); |