diff options
Diffstat (limited to 'dw/textblock_linebreaking.cc')
-rw-r--r-- | dw/textblock_linebreaking.cc | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc index e48c9a6e..fddfb44f 100644 --- a/dw/textblock_linebreaking.cc +++ b/dw/textblock_linebreaking.cc @@ -575,7 +575,7 @@ int Textblock::wordWrap (int wordIndex, bool wrapAll) n = wrapWordOofRef (wordIndex, wrapAll); else n = wrapWordInFlow (wordIndex, wrapAll); - _MSG("wordWrap word[%d] wtW=%d\n", wordIndex, word->totalWidth); + DBG_OBJ_MSGF ("construct.word", 1, "=> %d", n); DBG_OBJ_LEAVE (); @@ -758,6 +758,7 @@ int Textblock::wrapWordInFlow (int wordIndex, bool wrapAll) // (currently?). lastFloatPos = newFloatPos; + Widget *widget = words->getRef(lastFloatPos)->content.widgetReference->widget; int oofmIndex = getWidgetOOFIndex (widget); @@ -812,6 +813,7 @@ int Textblock::wrapWordInFlow (int wordIndex, bool wrapAll) } addLine (firstIndex, breakPos, lastFloatPos, tempNewLine, minHeight); + DBG_OBJ_MSGF ("construct.word", 1, "accumulating again from %d to %d", breakPos + 1, wordIndexEnd); @@ -821,12 +823,7 @@ int Textblock::wrapWordInFlow (int wordIndex, bool wrapAll) // update word pointer as hyphenateWord() can trigger a // reorganization of the words structure word = words->getRef (wordIndex); - MSG("wrapWordInFlow brkPos=%d, wIdxEnd=%d, word[%d].totalWidth=%d\n", - breakPos, wordIndexEnd, - wordIndex, words->getRef(wordIndex)->totalWidth); - if (words->getRef(wordIndex)->totalWidth == 36) { - MSG("*"); - } + penaltyIndex = calcPenaltyIndexForNewLine (); } } while (newLine); @@ -1657,6 +1654,7 @@ void Textblock::accumulateWordData (int wordIndex) word->maxDescent = word->size.descent; word->totalSpaceStretchability = 0; word->totalSpaceShrinkability = 0; + DBG_OBJ_MSGF ("construct.word.accum", 1, "first word of line: words[%d].totalWidth = %d + %d = %d; " "maxAscent = %d, maxDescent = %d", @@ -1668,7 +1666,6 @@ void Textblock::accumulateWordData (int wordIndex) word->totalWidth = prevWord->totalWidth + prevWord->origSpace - prevWord->hyphenWidth + word->size.width + word->hyphenWidth; - _MSG("wtW=%d ", word->totalWidth); word->maxAscent = max (prevWord->maxAscent, word->size.ascent); word->maxDescent = max (prevWord->maxDescent, word->size.descent); word->totalSpaceStretchability = @@ -1968,21 +1965,6 @@ void Textblock::rewrap () // So this is necessary: word = words->getRef (i); } - MSG("rewrap tb=%p: totalWidth { ", this); - for (int i = firstWord; i < words->size (); i++) { - Word *word = words->getRef (i); - MSG("w%d=%d ", i, word->totalWidth); - } - MSG("}"); - - MSG(", Lines MaxW{ "); - for (int i = 0; i < lines->size (); ++i) { - Line *line = lines->getRef(i); - MSG("l%d=%d ", i, line->maxLineWidth); - //Line *lastLine = lines->getLastRef(); - } - MSG("}\n"); - // Next time, the page will not have to be rewrapped. wrapRefLines = -1; DBG_OBJ_SET_NUM ("wrapRefLines", wrapRefLines); @@ -2071,7 +2053,7 @@ void Textblock::calcBorders (int lastOofRef, int height) { DBG_OBJ_ENTER ("construct.line", 0, "calcBorders", "%d, %d", lastOofRef, height); - MSG("calcBorders tb=%p ", this); + newLineHasFloatLeft = newLineHasFloatRight = false; newLineLeftBorder = newLineRightBorder = 0; newLineLeftFloatHeight = newLineRightFloatHeight = 0; @@ -2130,7 +2112,6 @@ void Textblock::calcBorders (int lastOofRef, int height) newLineHasFloatLeft = newLineHasFloatLeft || thisHasLeft; thisHasRight = oofm->hasFloatRight (y, height, this, effOofRef); newLineHasFloatRight = newLineHasFloatRight || thisHasRight; - MSG("nlhFR=%d thR=%d ", newLineHasFloatRight, thisHasRight); // TODO "max" is not really correct for the heights. (Does // not matter, since only one, the float manager, returns @@ -2139,7 +2120,7 @@ void Textblock::calcBorders (int lastOofRef, int height) newLineLeftBorder = max (newLineLeftBorder, oofm->getLeftBorder (y, height, this, effOofRef) - - getC0RelX (i)); + - getGeneratorX (i)); newLineLeftFloatHeight = max (newLineLeftFloatHeight, oofm->getLeftFloatHeight (y, height, this, effOofRef)); @@ -2148,12 +2129,8 @@ void Textblock::calcBorders (int lastOofRef, int height) if (thisHasRight) { newLineRightBorder = max (newLineRightBorder, -#if 0 - oofm->getRightBorder (y, height, this, effOofRef)); -#else oofm->getRightBorder (y, height, this, effOofRef) - getGeneratorRest (i)); -#endif newLineRightFloatHeight = max (newLineRightFloatHeight, oofm->getRightFloatHeight (y, height, this, effOofRef)); @@ -2170,7 +2147,6 @@ void Textblock::calcBorders (int lastOofRef, int height) } } } - MSG("\n"); DBG_OBJ_SET_BOOL ("newLineHasFloatLeft", newLineHasFloatLeft); DBG_OBJ_SET_BOOL ("newLineHasFloatRight", newLineHasFloatRight); |