From 3e7ea29e4b7a4441024846a49e90acaee4bdaf7b Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 2 Mar 2011 19:30:08 +0000 Subject: Move clone to box flags. svn path=/trunk/netsurf/; revision=11890 --- render/box.c | 3 +-- render/box.h | 6 ++---- render/html.c | 2 +- render/layout.c | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) (limited to 'render') diff --git a/render/box.c b/render/box.c index ebe69c34f..275079978 100644 --- a/render/box.c +++ b/render/box.c @@ -149,7 +149,6 @@ struct box * box_create(css_select_results *styles, css_computed_style *style, box->text = NULL; box->length = 0; box->space = 0; - box->clone = 0; box->href = href; box->target = target; box->title = title; @@ -281,7 +280,7 @@ void box_free(struct box *box) void box_free_box(struct box *box) { - if (!box->clone) { + if (!(box->flags & CLONE)) { if (box->gadget) form_free_control(box->gadget); if (box->scroll_x != NULL) diff --git a/render/box.h b/render/box.h index 441e3d9f7..7b3cc4a3d 100644 --- a/render/box.h +++ b/render/box.h @@ -121,7 +121,8 @@ typedef enum { NEW_LINE = 1 << 0, /* first inline on a new line */ STYLE_OWNED = 1 << 1, /* style is owned by this box */ PRINTED = 1 << 2, /* box has already been printed */ - PRE_STRIP = 1 << 3 /* PRE tag needing leading newline stripped */ + PRE_STRIP = 1 << 3, /* PRE tag needing leading newline stripped */ + CLONE = 1 << 4 /* continuation of previous box from wrapping */ } box_flags; /* Sides of a box */ @@ -203,9 +204,6 @@ struct box { /** Width of space after current text (depends on font and size). */ int space; - /** This box is a continuation of the previous box (eg from line - * breaking). */ - unsigned int clone : 1; char *href; /**< Link, or 0. */ const char *target; /**< Link target, or 0. */ diff --git a/render/html.c b/render/html.c index 71304fde7..4a27ec250 100644 --- a/render/html.c +++ b/render/html.c @@ -1540,7 +1540,7 @@ void html_object_done(struct box *box, hlcache_handle *object, b->max_width = UNKNOWN_MAX_WIDTH; /* delete any clones of this box */ - while (box->next && box->next->clone) { + while (box->next && (box->next->flags & CLONE)) { /* box_free_box(box->next); */ box->next = box->next->next; } diff --git a/render/layout.c b/render/layout.c index 4a6718fe1..067321708 100644 --- a/render/layout.c +++ b/render/layout.c @@ -1932,7 +1932,7 @@ static bool layout_text_box_split(struct content *content, c2 = talloc_memdup(content, split_box, sizeof *c2); if (!c2) return false; - c2->clone = 1; + c2->flags |= CLONE; /* Set remaining text in c2 */ if (split_box->parent->parent->gadget != NULL) { -- cgit v1.2.3