aboutsummaryrefslogtreecommitdiff
path: root/dw/ooffloatsmgr.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dw/ooffloatsmgr.cc')
-rw-r--r--dw/ooffloatsmgr.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/dw/ooffloatsmgr.cc b/dw/ooffloatsmgr.cc
index cce69718..655fa743 100644
--- a/dw/ooffloatsmgr.cc
+++ b/dw/ooffloatsmgr.cc
@@ -2206,12 +2206,20 @@ int OOFFloatsMgr::getClearPosition (OOFAwareWidget *textblock, Side side)
} else {
Float *vloat = list->get(i);
assert (vloat->generatingBlock != textblock);
- ensureFloatSize (vloat);
- pos = vloat->yReal + vloat->size.ascent + vloat->size.descent -
- getAllocation(textblock)->y;
- DBG_OBJ_MSGF ("resize.oofm", 1, "float %p => %d + (%d + %d) - %d",
- vloat->getWidget (), vloat->yReal, vloat->size.ascent,
- vloat->size.descent, getAllocation(textblock)->y);
+ if (!wasAllocated (vloat->generatingBlock))
+ pos = 0; // See above.
+ else {
+ ensureFloatSize (vloat);
+ pos = getAllocation(vloat->generatingBlock)->y + vloat->yReal
+ + vloat->size.ascent + vloat->size.descent
+ - getAllocation(textblock)->y;
+ DBG_OBJ_MSGF ("resize.oofm", 1,
+ "float %p => %d + %d + (%d + %d) - %d",
+ vloat->getWidget (),
+ getAllocation(vloat->generatingBlock)->y,
+ vloat->yReal, vloat->size.ascent, vloat->size.descent,
+ getAllocation(textblock)->y);
+ }
}
}