diff options
author | Sebastian Geerken <devnull@localhost> | 2015-12-28 23:57:09 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2015-12-28 23:57:09 +0100 |
commit | 6211c25f5528bf4a3e660f94de459b83bdd5c2e9 (patch) | |
tree | ce9c465e09284db1c5b2ad04b37f6e5ac7b5923d /dw/widget.cc | |
parent | e37c0bba9f08a5a8ac6e9a68ac6515702485bef7 (diff) |
SRDOP: Fix endless recursion.
Diffstat (limited to 'dw/widget.cc')
-rw-r--r-- | dw/widget.cc | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/dw/widget.cc b/dw/widget.cc index 202e6556..d63d1edc 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -586,7 +586,7 @@ void Widget::sizeRequest (Requisition *requisition, int numPos, } if (needsResize ()) { - calcExtraSpace (); + calcExtraSpace (true); /** \todo Check requisition == &(this->requisition) and do what? */ sizeRequestImpl (requisition, numPos, references, x, y); this->requisition = *requisition; @@ -1007,7 +1007,7 @@ void Widget::getExtremes (Extremes *extremes, int numPos, Widget **references, } if (extremesChanged ()) { - calcExtraSpace (); + calcExtraSpace (false); // For backward compatibility (part 1/2): extremes->minWidthIntrinsic = extremes->maxWidthIntrinsic = -1; @@ -1043,16 +1043,22 @@ void Widget::getExtremes (Extremes *extremes, int numPos, Widget **references, * * Delegated to dw::core::Widget::calcExtraSpaceImpl. Called both from * dw::core::Widget::sizeRequest and dw::core::Widget::getExtremes. + * + * If `vertical` is false, only horizontal dimensions are calculated. (This is + * used for extremes.) */ -void Widget::calcExtraSpace () +void Widget::calcExtraSpace (bool vertical) { DBG_OBJ_ENTER0 ("resize", 0, "calcExtraSpace"); extraSpace.top = extraSpace.right = extraSpace.bottom = extraSpace.left = 0; - calcExtraSpaceImpl (); + calcExtraSpaceImpl (vertical); - DBG_OBJ_SET_NUM ("extraSpace.top", extraSpace.top); - DBG_OBJ_SET_NUM ("extraSpace.bottom", extraSpace.bottom); + if (vertical) { + DBG_OBJ_SET_NUM ("extraSpace.top", extraSpace.top); + DBG_OBJ_SET_NUM ("extraSpace.bottom", extraSpace.bottom); + } + DBG_OBJ_SET_NUM ("extraSpace.left", extraSpace.left); DBG_OBJ_SET_NUM ("extraSpace.right", extraSpace.right); @@ -1602,8 +1608,11 @@ void Widget::sizeAllocateImpl (Allocation *allocation) * dw::core::Widget::extraSpace, which is only corrected. To make sure * all possible influences are considered, the implementation of the * base class should be called, too. + * + * If `vertical` is false, only horizontal dimensions are calculated. (This is + * used for extremes.) */ -void Widget::calcExtraSpaceImpl () +void Widget::calcExtraSpaceImpl (bool vertical) { } |