diff options
author | Sebastian Geerken <devnull@localhost> | 2015-10-03 19:50:22 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2015-10-03 19:50:22 +0200 |
commit | 1392f2e22c584eaa1f26fb20babdf6eb4ddbc185 (patch) | |
tree | 6cae71ec81021de413eed21c174e773fe6a0064c /dw/ooffloatsmgr.cc | |
parent | 1191996538bd923b7f29016558a8154c51df3ffb (diff) |
SRDOP: Remove references to allocations in OOFFloatsMgr.
Diffstat (limited to 'dw/ooffloatsmgr.cc')
-rw-r--r-- | dw/ooffloatsmgr.cc | 61 |
1 files changed, 23 insertions, 38 deletions
diff --git a/dw/ooffloatsmgr.cc b/dw/ooffloatsmgr.cc index 32cda2e7..676d6a36 100644 --- a/dw/ooffloatsmgr.cc +++ b/dw/ooffloatsmgr.cc @@ -914,7 +914,6 @@ bool OOFFloatsMgr::collidesH (Float *vloat, Float *other) if (!other->getWidget()->wasAllocated ()) collidesH = false; else { - assert (wasAllocated (vloat->generatingBlock)); int vloatX = calcFloatX (vloat); // Generally: right border of the left float > left border of @@ -1057,44 +1056,30 @@ void OOFFloatsMgr::getFloatsExtremes (Extremes *cbExtr, Side side, vloat->getWidget (), vloat->generatingBlock, container); - if (vloat->generatingBlock == container || - wasAllocated (vloat->generatingBlock)) { - Extremes extr; - vloat->getWidget()->getExtremes (&extr); - - // The calculation of extremes must be kept consistent with - // getFloatsSize(). Especially this means for the *minimal* width: - // - // - The right border (difference between float and - // container) does not have to be considered (see - // getFloatsSize()). - // - // - This is also the case for the left border, as seen in - // calcFloatX() ("... but when the float exceeds the line - // break width" ...). - - *minWidth = max (*minWidth, extr.minWidth); - - // For the maximal width, borders must be considered. + Extremes extr; + vloat->getWidget()->getExtremes (&extr); - if (vloat->generatingBlock == container) - *maxWidth = - max (*maxWidth, - extr.maxWidth - + vloat->generatingBlock->getStyle()->boxDiffWidth()); - else { - Allocation *gba = getAllocation (vloat->generatingBlock); - *maxWidth = - max (*maxWidth, - extr.maxWidth - + vloat->generatingBlock->getStyle()->boxDiffWidth() - + max (containerAllocation.width - gba->width, 0)); - } - - DBG_OBJ_MSGF ("resize.oofm", 1, "%d / %d => %d / %d", - extr.minWidth, extr.maxWidth, *minWidth, *maxWidth); - } else - DBG_OBJ_MSG ("resize.oofm", 1, "not allocated"); + // The calculation of extremes must be kept consistent with + // getFloatsSize(). Especially this means for the *minimal* width: + // + // - The right border (difference between float and container) does not + // have to be considered (see getFloatsSize()). + // + // - This is also the case for the left border, as seen in calcFloatX() + // ("... but when the float exceeds the line break width" ...). + + *minWidth = max (*minWidth, extr.minWidth); + + // For the maximal width, borders must be considered. + *maxWidth = max (*maxWidth, + extr.maxWidth + + vloat->generatingBlock->getStyle()->boxDiffWidth(), + + max (container->getGeneratorWidth () + - vloat->generatingBlock->getGeneratorWidth (), + 0)); + + DBG_OBJ_MSGF ("resize.oofm", 1, "%d / %d => %d / %d", + extr.minWidth, extr.maxWidth, *minWidth, *maxWidth); } DBG_OBJ_LEAVE (); |