aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dw/outofflowmgr.cc5
-rw-r--r--dw/textblock.cc5
-rw-r--r--dw/textblock_linebreaking.cc38
3 files changed, 37 insertions, 11 deletions
diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc
index ad266759..8df844a1 100644
--- a/dw/outofflowmgr.cc
+++ b/dw/outofflowmgr.cc
@@ -456,6 +456,9 @@ OutOfFlowMgr::OutOfFlowMgr (Textblock *containingBlock)
leftFloatsAll = new Vector<Float> (1, true);
rightFloatsAll = new Vector<Float> (1, true);
+ DBG_OBJ_SET_NUM ("leftFloatsAll.size", leftFloatsAll->size());
+ DBG_OBJ_SET_NUM ("rightFloatsAll.size", rightFloatsAll->size());
+
floatsByWidget = new HashTable <TypedPointer <Widget>, Float> (true, false);
tbInfos = new Vector<TBInfo> (1, false);
@@ -1016,6 +1019,7 @@ void OutOfFlowMgr::addWidgetOOF (Widget *widget, Textblock *generatingBlock,
switch (widget->getStyle()->vloat) {
case FLOAT_LEFT:
leftFloatsAll->put (vloat);
+ DBG_OBJ_SET_NUM ("leftFloatsAll.size", leftFloatsAll->size());
widget->parentRef = createRefLeftFloat (leftFloatsAll->size() - 1);
tbInfo->leftFloatsGB->put (vloat);
@@ -1039,6 +1043,7 @@ void OutOfFlowMgr::addWidgetOOF (Widget *widget, Textblock *generatingBlock,
case FLOAT_RIGHT:
rightFloatsAll->put (vloat);
+ DBG_OBJ_SET_NUM ("rightFloatsAll.size", rightFloatsAll->size());
widget->parentRef = createRefRightFloat (rightFloatsAll->size() - 1);
tbInfo->rightFloatsGB->put (vloat);
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 91f9a82e..b03b878b 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -452,6 +452,11 @@ void Textblock::getExtremesImpl (core::Extremes *extremes)
Paragraph *lastPar = paragraphs->getLastRef ();
extremes->minWidth = lastPar->maxParMin;
extremes->maxWidth = lastPar->maxParMax;
+
+ DBG_OBJ_MSGF ("resize", 1, "paragraphs[%d]->maxParMin = %d",
+ paragraphs->size () - 1, lastPar->maxParMin);
+ DBG_OBJ_MSGF ("resize", 1, "paragraphs[%d]->maxParMax = %d",
+ paragraphs->size () - 1, lastPar->maxParMax);
}
int diff = innerPadding + getStyle()->boxDiffWidth ();
diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc
index c0512bd5..137835e9 100644
--- a/dw/textblock_linebreaking.cc
+++ b/dw/textblock_linebreaking.cc
@@ -1009,13 +1009,18 @@ void Textblock::handleWordExtremes (int wordIndex)
{
// TODO Overall, clarify penalty index.
+ DBG_OBJ_MSGF ("construct.paragraph", 0,
+ "<b>handleWordExtremes</b> (%d)", wordIndex);
+ DBG_OBJ_MSG_START ();
+
Word *word = words->getRef (wordIndex);
+ DBG_MSG_WORD ("construct.paragraph", 1,
+ "<i>handled word:</i> ", wordIndex, "");
+
core::Extremes wordExtremes;
getWordExtremes (word, &wordExtremes);
-
- //printf ("[%p] HANDLE_WORD_EXTREMES (%d): ", this, wordIndex);
- //printWordWithFlags (word);
- //printf (" => %d / %d\n", wordExtremes.minWidth, wordExtremes.maxWidth);
+ DBG_OBJ_MSGF ("construct.paragraph", 1, "extremes: %d / %d",
+ wordExtremes.minWidth, wordExtremes.maxWidth);
if (wordIndex == 0) {
wordExtremes.minWidth += line1Offset;
@@ -1040,10 +1045,12 @@ void Textblock::handleWordExtremes (int wordIndex)
} else
par->maxParMin = par->maxParMax = 0;
- PRINTF (" new par: %d\n", paragraphs->size() - 1);
+ DBG_OBJ_MSGF ("construct.paragraph", 1, "new par: %d",
+ paragraphs->size() - 1);
}
- PRINTF (" last par: %d\n", paragraphs->size() - 1);
+ DBG_OBJ_MSGF ("construct.paragraph", 1, "last par: %d",
+ paragraphs->size() - 1);
Paragraph *lastPar = paragraphs->getLastRef();
int corrDiffMin, corrDiffMax;
@@ -1059,8 +1066,10 @@ void Textblock::handleWordExtremes (int wordIndex)
} else
corrDiffMin = corrDiffMax = 0;
- PRINTF (" (lastPar from %d to %d; corrDiffMin = %d, corDiffMax = %d)\n",
- lastPar->firstWord, lastPar->lastWord, corrDiffMin, corrDiffMax);
+ DBG_OBJ_MSGF ("construct.paragraph", 1,
+ "(lastPar from %d to %d; corrDiffMin = %d, corDiffMax = %d)",
+ lastPar->firstWord, lastPar->lastWord, corrDiffMin,
+ corrDiffMax);
// Minimum: between two *possible* breaks.
// Shrinkability could be considered, but really does not play a role.
@@ -1074,11 +1083,13 @@ void Textblock::handleWordExtremes (int wordIndex)
lastPar->parMax += wordExtremes.maxWidth + word->hyphenWidth + corrDiffMax;
lastPar->maxParMax = misc::max (lastPar->maxParMax, lastPar->parMax);
- PRINTF (" => parMin = %d (max = %d), parMax = %d (max = %d)\n",
- lastPar->parMin, lastPar->maxParMin, lastPar->parMax,
- lastPar->maxParMax);
+ DBG_OBJ_MSGF ("construct.paragraph", 1,
+ "=> parMin = %d (max = %d), parMax = %d (max = %d)",
+ lastPar->parMin, lastPar->maxParMin, lastPar->parMax,
+ lastPar->maxParMax);
lastPar->lastWord = wordIndex;
+ DBG_OBJ_MSG_END ();
}
/**
@@ -1526,6 +1537,9 @@ void Textblock::rewrap ()
*/
void Textblock::fillParagraphs ()
{
+ DBG_OBJ_MSG ("resize", 0, "<b>fillParagraphs</b>");
+ DBG_OBJ_MSG_START ();
+
if (wrapRefParagraphs == -1)
return;
@@ -1570,6 +1584,8 @@ void Textblock::fillParagraphs ()
wrapRefParagraphs = -1;
DBG_OBJ_SET_NUM ("wrapRefParagraphs", wrapRefParagraphs);
+
+ DBG_OBJ_MSG_END ();
}
void Textblock::initNewLine ()