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).

This commit is contained in:
Pietro Gagliardi 2015-05-18 19:02:23 -04:00
parent 33d6609675
commit 025b00a6ac
1 changed files with 0 additions and 16 deletions

View File

@ -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;