From 025b00a6ac13b377c3ea6cef243f0b60906419cc Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 18 May 2015 19:02:23 -0400 Subject: [PATCH] Removed the uiBox parent stuff from box.c; it's no longer needed (and having the parented check there isn't necessary; it'll be reached eventually). --- redo/box.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/redo/box.c b/redo/box.c index 5d94427b..8241963d 100644 --- a/redo/box.c +++ b/redo/box.c @@ -7,8 +7,6 @@ struct box { void (*baseDestroy)(uiControl *); struct ptrArray *controls; int vertical; - void (*baseSetParent)(uiControl *, uiControl *); - uiControl *parent; int padded; void (*baseResize)(uiControl *, intmax_t, intmax_t, intmax_t, intmax_t, uiSizing *); }; @@ -25,8 +23,6 @@ static void boxDestroy(uiControl *c) struct box *b = (struct box *) c; struct boxControl *bc; - if (b->parent != NULL) - complain("attempt to destroy uiBox %p while it has a parent", b); // don't chain up to base here; we need to destroy children ourselves first while (b->controls->len != 0) { bc = ptrArrayIndex(b->controls, struct boxControl *, 0); @@ -41,16 +37,6 @@ static void boxDestroy(uiControl *c) uiFree(b); } -static void boxSetParent(uiControl *c, uiControl *parent) -{ - struct box *b = (struct box *) c; - - // this does all the actual work - (*(b->baseSetParent))(uiControl(b), parent); - // we just need to have a copy of the parent ourselves for boxSetPadded() - b->parent = parent; -} - static void boxPreferredSize(uiControl *c, uiSizing *d, intmax_t *width, intmax_t *height) { struct box *b = (struct box *) c; @@ -277,8 +263,6 @@ uiBox *uiNewHorizontalBox(void) b->baseDestroy = uiControl(b)->Destroy; uiControl(b)->Destroy = boxDestroy; - b->baseSetParent = uiControl(b)->SetParent; - uiControl(b)->SetParent = boxSetParent; uiControl(b)->PreferredSize = boxPreferredSize; b->baseResize = uiControl(b)->Resize; uiControl(b)->Resize = boxResize;