diff options
author | Sebastian Geerken <devnull@localhost> | 2015-12-29 23:34:01 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2015-12-29 23:34:01 +0100 |
commit | 0959f823bce0eaebda5a8b30d9ad40d822e1f3a8 (patch) | |
tree | a0d7778baa9b5175031ec0ba09b19d220810a2c3 | |
parent | ddfea411669a857b3ec6f563d12eeb50b3ad4f69 (diff) |
SRDOP: More RTFL.
-rw-r--r-- | dw/textblock.cc | 15 | ||||
-rw-r--r-- | dw/textblock_linebreaking.cc | 35 |
2 files changed, 25 insertions, 25 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc index 46bd213d..11888b76 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -410,13 +410,10 @@ bool Textblock::mustBeWidenedToAvailWidth () // In detail, this depends on what the respective OOFM does // with the child widget: result = toplevel || (block && !(vloat || abspos || fixpos)); - DBG_OBJ_MSGF ("resize", 0, - "=> %s (toplevel: %s, block: %s, float: %s, abspos: %s, " - "fixpos: %s)", - result ? "true" : "false", toplevel ? "true" : "false", - block ? "true" : "false", vloat ? "true" : "false", - abspos ? "true" : "false", fixpos ? "true" : "false"); - DBG_OBJ_LEAVE (); + DBG_OBJ_LEAVE_VAL ("%s (toplevel: %s, block: %s, float: %s, abspos: %s, " + "fixpos: %s)", + boolToStr(result), boolToStr(toplevel), boolToStr(block), + boolToStr(vloat), boolToStr(abspos), boolToStr(fixpos)); return result; } @@ -438,9 +435,7 @@ int Textblock::calcVerticalBorder (int widgetPadding, int widgetBorder, } else result = lineMarginTotal + widgetPadding + widgetBorder + widgetMargin; - DBG_OBJ_MSGF ("resize", 0, "=> %d", result); - DBG_OBJ_LEAVE (); - + DBG_OBJ_LEAVE_VAL ("%d", result); return result; } diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc index ca30d2a9..ab4e3eab 100644 --- a/dw/textblock_linebreaking.cc +++ b/dw/textblock_linebreaking.cc @@ -815,7 +815,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\n", + "accumulating again from %d to %d", breakPos + 1, wordIndexEnd); for(int i = breakPos + 1; i <= wordIndexEnd; i++) accumulateWordData (i); @@ -997,7 +997,8 @@ int Textblock::searchBreakPos (int wordIndex, int firstIndex, int *searchUntil, tempNewLine ? "true" : "false", penaltyIndex, thereWillBeMoreSpace ? "true" : "false", wrapAll ? "true" : "false"); - DBG_MSG_WORD ("construct.word", 0, "<i>first word:</i> ", firstIndex, ""); + + DBG_MSG_WORD ("construct.word", 1, "<i>first word:</i> ", firstIndex, ""); int result; bool lineAdded; @@ -1015,8 +1016,14 @@ int Textblock::searchBreakPos (int wordIndex, int firstIndex, int *searchUntil, } else if (thereWillBeMoreSpace && words->getRef(firstIndex)->badnessAndPenalty.lineTooTight ()) { int hyphenatedWord = considerHyphenation (firstIndex, firstIndex); - DBG_OBJ_MSGF ("construct.word", 1, "too tight ... hyphenatedWord = %d", - hyphenatedWord); + + DBG_IF_RTFL { + StringBuffer sb; + words->getRef(firstIndex)->badnessAndPenalty.intoStringBuffer (&sb); + DBG_OBJ_MSGF ("construct.word", 1, + "too tight: %s ... hyphenatedWord = %d", + sb.getChars (), hyphenatedWord); + } if (hyphenatedWord == -1) { DBG_OBJ_MSG ("construct.word", 1, "... => empty line"); @@ -1075,7 +1082,7 @@ int Textblock::searchBreakPos (int wordIndex, int firstIndex, int *searchUntil, *diffWords += n; DBG_OBJ_MSGF ("construct.word", 1, - "accumulating again from %d to %d\n", + "accumulating again from %d to %d", breakPos + 1, *wordIndexEnd); for(int i = breakPos + 1; i <= *wordIndexEnd; i++) accumulateWordData (i); @@ -1085,8 +1092,7 @@ int Textblock::searchBreakPos (int wordIndex, int firstIndex, int *searchUntil, DBG_OBJ_MSG_END (); } while(!lineAdded); - DBG_OBJ_MSGF ("construct.word", 1, "=> %d", result); - DBG_OBJ_LEAVE (); + DBG_OBJ_LEAVE_VAL ("%d", result); return result; } @@ -1125,7 +1131,7 @@ int Textblock::searchMinBap (int firstWord, int lastWord, int penaltyIndex, } DBG_OBJ_MSG_END (); - DBG_OBJ_MSGF ("construct.word", 1, "found at %d\n", pos); + DBG_OBJ_MSGF ("construct.word", 1, "found at %d", pos); if (correctAtEnd && lastWord == words->size () - 1) { // Since no break and no space is added, the last word will have @@ -1150,7 +1156,7 @@ int Textblock::searchMinBap (int firstWord, int lastWord, int penaltyIndex, if (correctedBap.compareTo(penaltyIndex, &words->getRef(pos)->badnessAndPenalty) <= 0) { pos = lastWord; - DBG_OBJ_MSGF ("construct.word", 1, "corrected: %d\n", pos); + DBG_OBJ_MSGF ("construct.word", 1, "corrected: %d", pos); } } @@ -1677,7 +1683,8 @@ void Textblock::accumulateWordData (int wordIndex) DBG_IF_RTFL { StringBuffer sb; word->badnessAndPenalty.intoStringBuffer (&sb); - DBG_OBJ_MSGF ("construct.word.accum", 1, "b+p: %s", sb.getChars ()); + DBG_OBJ_ARRATTRSET_SYM ("words", wordIndex, "badnessAndPenalty", + sb.getChars ()); } DBG_OBJ_LEAVE (); @@ -1709,11 +1716,9 @@ int Textblock::calcLineBreakWidth (int lineIndex) lineBreakWidth -= (leftBorder + rightBorder); - DBG_OBJ_MSGF ("construct.word.width", 2, "=> %d - %d - (%d + %d) = %d\n", - this->lineBreakWidth, leftInnerPadding, leftBorder, - rightBorder, lineBreakWidth); - - DBG_OBJ_LEAVE (); + DBG_OBJ_LEAVE_VAL ("%d - %d - (%d + %d) = %d", + this->lineBreakWidth, leftInnerPadding, leftBorder, + rightBorder, lineBreakWidth); return lineBreakWidth; } |