aboutsummaryrefslogtreecommitdiff
path: root/dw/textblock_linebreaking.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-11-18 13:30:06 +0100
committerSebastian Geerken <devnull@localhost>2014-11-18 13:30:06 +0100
commitd9fba2910501b62b73d375a8a5e67dea3f1deccf (patch)
treeac967d9157a59e6dd2ed90814b03464a475e18bf /dw/textblock_linebreaking.cc
parent1831b70de6931f95b30d78bab7c874cd5d70c821 (diff)
parent2db5a9e3e790863db2f67e727512f2373d4c82dc (diff)
Merge with main repo.
Diffstat (limited to 'dw/textblock_linebreaking.cc')
-rw-r--r--dw/textblock_linebreaking.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc
index f9ec1ecd..cdd99197 100644
--- a/dw/textblock_linebreaking.cc
+++ b/dw/textblock_linebreaking.cc
@@ -389,7 +389,8 @@ Textblock::Line *Textblock::addLine (int firstWord, int lastWord,
nonTemporaryLines = lines->size ();
}
- PRINTF ("nonTemporaryLines = %d\n", nonTemporaryLines);
+ DBG_OBJ_MSGF ("construct.line", 1, "nonTemporaryLines = %d",
+ nonTemporaryLines);
int lineIndex = lines->size () - 1;
Line *line = lines->getRef (lineIndex);
@@ -413,6 +414,12 @@ Textblock::Line *Textblock::addLine (int firstWord, int lastWord,
line->rightOffset = misc::max (regardBorder ? newLineRightBorder : 0,
boxRestWidth ());
+ DBG_OBJ_MSGF ("construct.line", 1,
+ "regardBorder = %s, newLineLeftBorder = %d, "
+ "newLineRightBorder = %d",
+ regardBorder ? "true" : "false", newLineLeftBorder,
+ newLineRightBorder);
+
DBG_OBJ_ARRATTRSET_NUM ("lines", lineIndex, "leftOffset", line->leftOffset);
DBG_OBJ_ARRATTRSET_NUM ("lines", lineIndex, "rightOffset",
line->rightOffset);
@@ -439,7 +446,6 @@ Textblock::Line *Textblock::addLine (int firstWord, int lastWord,
prevLine->lastOofRefPositionedBeforeThisLine;
}
- DBG_OBJ_ARRATTRSET_NUM ("lines", lineIndex, "top", line->top);
DBG_OBJ_ARRATTRSET_NUM ("lines", lineIndex, "maxLineWidth",
line->maxLineWidth);
@@ -456,6 +462,8 @@ Textblock::Line *Textblock::addLine (int firstWord, int lastWord,
+ prevLine->totalHeight (line->marginAscent - line->borderAscent);
}
+ DBG_OBJ_ARRATTRSET_NUM ("lines", lineIndex, "top", line->top);
+
// Especially empty lines (possible when there are floats) have
// zero height, which may cause endless loops. For this reasons,
// the height should be positive (assuming the caller passed
@@ -842,9 +850,8 @@ int Textblock::wrapWordInFlow (int wordIndex, bool wrapAll)
if (wordIndex >= firstWordWithoutLine) {
word->content.widget->parentRef = makeParentRefInFlow (lines->size ());
- PRINTF ("The %s %p is assigned parentRef = %d.\n",
- word->content.widget->getClassName(), word->content.widget,
- word->content.widget->parentRef);
+ DBG_OBJ_SET_NUM_O (word->content.widget, "parentRef",
+ word->content.widget->parentRef);
}
}
@@ -1532,6 +1539,8 @@ void Textblock::accumulateWordForLine (int lineIndex, int wordIndex)
marginDescent - word->content.widget->getStyle()->margin.bottom;
word->content.widget->parentRef = makeParentRefInFlow (lineIndex);
+ DBG_OBJ_SET_NUM_O (word->content.widget, "parentRef",
+ word->content.widget->parentRef);
} else {
borderAscent = marginAscent = word->size.ascent;
borderDescent = marginDescent = word->size.descent;