aboutsummaryrefslogtreecommitdiff
path: root/dw/ooffloatsmgr.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2015-12-29 23:35:00 +0100
committerSebastian Geerken <devnull@localhost>2015-12-29 23:35:00 +0100
commit1eddbbd3dc4f4c78709d4c0d61d1354d7ccdfb8d (patch)
treef5dd0829f7008ebcff4b1d06fe3f19fe9d065182 /dw/ooffloatsmgr.cc
parent0959f823bce0eaebda5a8b30d9ad40d822e1f3a8 (diff)
SRDOP: Fix(?) calculation of borders.
Diffstat (limited to 'dw/ooffloatsmgr.cc')
-rw-r--r--dw/ooffloatsmgr.cc21
1 files changed, 9 insertions, 12 deletions
diff --git a/dw/ooffloatsmgr.cc b/dw/ooffloatsmgr.cc
index 5b69bbbe..2b6fc537 100644
--- a/dw/ooffloatsmgr.cc
+++ b/dw/ooffloatsmgr.cc
@@ -1022,18 +1022,14 @@ int OOFFloatsMgr::getBorder (Side side, int y, int h, OOFAwareWidget *lastGB,
SortedFloatsVector *list = side == LEFT ? leftFloats : rightFloats;
int last;
int first = list->findFirst (y, h, lastGB, lastExtIndex, &last);
+ int border = 0;
DBG_OBJ_MSGF ("border", 1, "first = %d", first);
- if (first == -1) {
- // No float.
- DBG_OBJ_LEAVE ();
- return 0;
- } else {
+ if (first != -1) {
// It is not sufficient to find the first float, since a line
// (with height h) may cover the region of multiple float, of
// which the widest has to be choosen.
- int border = 0;
bool covers = true;
// We are not searching until the end of the list, but until the
@@ -1045,19 +1041,20 @@ int OOFFloatsMgr::getBorder (Side side, int y, int h, OOFAwareWidget *lastGB,
i, vloat->getWidget(), covers ? "<b>yes</b>" : "no");
if (covers) {
- int borderIn = calcFloatX (vloat);
+ int borderIn = side == LEFT ?
+ vloat->generator->getStyle()->boxOffsetX() :
+ vloat->generator->getStyle()->boxRestWidth();
int thisBorder = vloat->size.width + borderIn;
- DBG_OBJ_MSGF ("border", 1, "GB: thisBorder = %d + %d = %d",
+ DBG_OBJ_MSGF ("border", 1, "thisBorder = %d + %d = %d",
vloat->size.width, borderIn, thisBorder);
border = max (border, thisBorder);
- DBG_OBJ_MSGF ("border", 1, "=> border = %d", border);
}
}
-
- DBG_OBJ_LEAVE ();
- return border;
}
+
+ DBG_OBJ_LEAVE_VAL ("%d", border);
+ return border;
}
bool OOFFloatsMgr::hasFloatLeft (int y, int h, OOFAwareWidget *lastGB,