aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2015-10-04 01:02:30 +0200
committerSebastian Geerken <devnull@localhost>2015-10-04 01:02:30 +0200
commita96891523304aa2b1ae38c683f3c85f343563d61 (patch)
tree4a2d4eeb19c9d22364f2255c3d4761362302bb8e
parent6dee44b7e0c1744fd9f6cd11f1419c8a29aebb86 (diff)
SRDOP: correct usage of get*Border.
-rw-r--r--dw/textblock.cc18
-rw-r--r--dw/textblock.hh2
-rw-r--r--dw/textblock_linebreaking.cc6
3 files changed, 23 insertions, 3 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc
index f910e2ff..bc6639da 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -3185,7 +3185,23 @@ int Textblock::getGeneratorX (int oofmIndex)
if (findSizeRequestReference (oofmIndex, &xRef, NULL))
return xRef;
else {
- // Only called by by OOFFloatsMgr, so this should not happen:
+ // Only called for floats, so this should not happen:
+ assertNotReached ();
+ return 0;
+ }
+}
+
+int Textblock::getGeneratorRest (int oofmIndex)
+{
+ int xRef;
+ OOFAwareWidget *container = oofContainer[oofmIndex];
+
+ if (container != NULL && findSizeRequestReference (container, &xRef, NULL))
+ return misc::max (container->getGeneratorWidth ()
+ - (xRef + getGeneratorWidth ()),
+ 0);
+ else {
+ // Only called for floats, so this should not happen:
assertNotReached ();
return 0;
}
diff --git a/dw/textblock.hh b/dw/textblock.hh
index 397ba0e6..e4bf5138 100644
--- a/dw/textblock.hh
+++ b/dw/textblock.hh
@@ -871,6 +871,8 @@ protected:
int numBreaks, int *breakPos,
core::Requisition *wordSize);
+ int getGeneratorRest (int oofmIndex);
+
public:
static int CLASS_ID;
diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc
index 81e60a71..0f76b2f4 100644
--- a/dw/textblock_linebreaking.cc
+++ b/dw/textblock_linebreaking.cc
@@ -2077,10 +2077,12 @@ void Textblock::calcBorders (int lastOofRef, int height)
newLineLeftBorder =
misc::max (newLineLeftBorder,
- oofm->getLeftBorder (y, height, this, effOofRef));
+ oofm->getLeftBorder (y, height, this, effOofRef)
+ - getGeneratorX (i));
newLineRightBorder =
misc::max (newLineRightBorder,
- oofm->getRightBorder (y, height, this, effOofRef));
+ oofm->getRightBorder (y, height, this, effOofRef)
+ - getGeneratorRest (i));
// TODO "max" is not really correct for the heights. (Does
// not matter, since only one, the float manager, returns