diff options
author | Sebastian Geerken <devnull@localhost> | 2014-09-12 21:56:11 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-09-12 21:56:11 +0200 |
commit | 5e61a16c4ef0c64fd8cdbee2379bcee798dab518 (patch) | |
tree | b3616e8ae7359a1202b247302b366947f7c9c952 /dw/table.cc | |
parent | ae2d990af432ea56375936e5ec9872fe0503d61f (diff) |
Table gets OOF aware, part 2. (Still crashing.)
Diffstat (limited to 'dw/table.cc')
-rw-r--r-- | dw/table.cc | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/dw/table.cc b/dw/table.cc index a59c0120..899bfe89 100644 --- a/dw/table.cc +++ b/dw/table.cc @@ -229,15 +229,22 @@ int Table::getAvailWidthOfChild (Widget *child, bool forceValue) int width; - // Unlike other containers, the table widget sometimes narrows - // columns to a width less than specified by CSS (see - // forceCalcCellSizes). For this reason, the column widths have to - // be calculated in all cases. - if (forceValue) { - calcCellSizes (false); - width = calcAvailWidthForDescendant (child); - } else - width = -1; + if (isWidgetOOF(child)) { + assert (getWidgetOutOfFlowMgr(child) && + getWidgetOutOfFlowMgr(child)->dealingWithSizeOfChild (child)); + width = + getWidgetOutOfFlowMgr(child)->getAvailWidthOfChild (child, forceValue); + } else { + // Unlike other containers, the table widget sometimes narrows + // columns to a width less than specified by CSS (see + // forceCalcCellSizes). For this reason, the column widths have to + // be calculated in all cases. + if (forceValue) { + calcCellSizes (false); + width = calcAvailWidthForDescendant (child); + } else + width = -1; + } DBG_OBJ_MSGF ("resize", 1, "=> %d", width); DBG_OBJ_LEAVE (); @@ -479,6 +486,8 @@ void Table::addCell (Widget *widget, int colspan, int rowspan) curCol += colspanEff; + widget->parentRef = makeParentRefInFlow (0); + widget->setParent (this); if (rowStyle->get (curRow)) widget->setBgColor (rowStyle->get(curRow)->backgroundColor); |