aboutsummaryrefslogtreecommitdiff
path: root/dw/textblock_linebreaking.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-09-22 16:10:19 +0200
committerSebastian Geerken <devnull@localhost>2014-09-22 16:10:19 +0200
commit156f3622e4197dddeba990637dcbe1100c5d51ac (patch)
tree515d895e93c85959df85cde0b1feb9b986a5a855 /dw/textblock_linebreaking.cc
parent473610dbc053c39ff9d94476b23ea6a51ff07e1f (diff)
Implemented OOFPositionedMgr::tellPosition (and what is needed else).
Diffstat (limited to 'dw/textblock_linebreaking.cc')
-rw-r--r--dw/textblock_linebreaking.cc29
1 files changed, 26 insertions, 3 deletions
diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc
index 82aef93a..dbce505e 100644
--- a/dw/textblock_linebreaking.cc
+++ b/dw/textblock_linebreaking.cc
@@ -570,7 +570,7 @@ int Textblock::wordWrap (int wordIndex, bool wrapAll)
int n;
if (word->content.type == core::Content::WIDGET_OOF_REF)
- n = 0;
+ n = wrapWordOofRef (wordIndex, wrapAll);
else
n = wrapWordInFlow (wordIndex, wrapAll);
@@ -735,8 +735,8 @@ int Textblock::wrapWordInFlow (int wordIndex, bool wrapAll)
core::Content *content = &(words->getRef(i)->content);
if (content->type == core::Content::WIDGET_OOF_REF) {
for (int j = 0; newFloatPos == -1 && j < NUM_OOFM; j++) {
- if ((searchOutOfFlowMgr(j) ->affectsLeftBorder(content
- ->widget) ||
+ if ((searchOutOfFlowMgr(j)->affectsLeftBorder(content
+ ->widget) ||
searchOutOfFlowMgr(j)->affectsRightBorder (content
->widget)))
newFloatPos = i;
@@ -838,6 +838,29 @@ int Textblock::wrapWordInFlow (int wordIndex, bool wrapAll)
return diffWords;
}
+int Textblock::wrapWordOofRef (int wordIndex, bool wrapAll)
+{
+ DBG_OBJ_ENTER ("construct.word", 0, "wrapWordOofRef", "%d, %s",
+ wordIndex, wrapAll ? "true" : "false");
+
+ Word *word = words->getRef (wordIndex);
+ Widget *widget = word->content.widget;
+ int yNewLine = yOffsetOfPossiblyMissingLine (lines->size ());
+
+ // Floats, which affect either border, are handled in wrapWordInFlow; this
+ // is rather for positioned elements.
+ oof::OutOfFlowMgr *oofm = searchOutOfFlowMgr (getWidgetOOFIndex (widget));
+ DBG_OBJ_MSGF ("construct.word", 1, "parentRef = %d, oofm = %p",
+ widget->parentRef, oofm);
+ if (oofm && !oofm->mayAffectBordersAtAll ())
+ // TODO Again, "x = 0" is not correct (see above).
+ oofm->tellPosition (widget, 0, yNewLine);
+
+ DBG_OBJ_LEAVE ();
+
+ return 0; // Words list not changed.
+}
+
// *height must be initialized, but not *breakPos.
// *wordIndexEnd must be initialized (initially to wordIndex)
void Textblock::balanceBreakPosAndHeight (int wordIndex, int firstIndex,