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/box.c | |
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/box.c')
-rw-r--r-- | render/box.c | 30 |
1 files changed, 29 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 * |