diff options
author | Sebastian Geerken <devnull@localhost> | 2013-04-09 23:54:58 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2013-04-09 23:54:58 +0200 |
commit | f94d004790039c92732081fa377f9dbab90af713 (patch) | |
tree | 415b61d66d7037ce5092aa2fe529084bf8ffa22e | |
parent | 6609311d7d50d15c3ab8e31e920b1e0df7365d73 (diff) |
Eliminated OOFM::tellNoPosition.
-rw-r--r-- | dw/outofflowmgr.cc | 21 | ||||
-rw-r--r-- | dw/outofflowmgr.hh | 4 | ||||
-rw-r--r-- | dw/textblock_linebreaking.cc | 6 |
3 files changed, 4 insertions, 27 deletions
diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc index 3c4f0942..f9c37747 100644 --- a/dw/outofflowmgr.cc +++ b/dw/outofflowmgr.cc @@ -583,24 +583,10 @@ Widget *OutOfFlowMgr::getWidgetAtPoint (SortedFloatsVector *list, } -/** - * This method is called by Textblock::rewrap at the beginning, to - * avoid wrong positions. - */ -void OutOfFlowMgr::tellNoPosition (Widget *widget) +void OutOfFlowMgr::tellPosition (Widget *widget, int yReq) { - tellPositionOrNot (widget, 0, false); -} + assert (yReq >= 0); - -void OutOfFlowMgr::tellPosition (Widget *widget, int y) -{ - assert (y >= 0); - tellPositionOrNot (widget, y, true); -} - -void OutOfFlowMgr::tellPositionOrNot (Widget *widget, int yReq, bool positioned) -{ Float *vloat = findFloatByWidget(widget); //printf ("[%p] TELL_POSITION_OR_NOT (%p, %d, %s)\n", @@ -613,9 +599,8 @@ void OutOfFlowMgr::tellPositionOrNot (Widget *widget, int yReq, bool positioned) SortedFloatsVector *listSame, *listOpp; getFloatsLists (vloat, &listSame, &listOpp); + ensureFloatSize (vloat); - if (positioned) - ensureFloatSize (vloat); int oldY = vloat->yReal; // "yReal" may change due to collisions (see below). diff --git a/dw/outofflowmgr.hh b/dw/outofflowmgr.hh index f312ee0f..891581dd 100644 --- a/dw/outofflowmgr.hh +++ b/dw/outofflowmgr.hh @@ -156,7 +156,6 @@ private: core::Rectangle *area); core::Widget *getWidgetAtPoint (SortedFloatsVector *list, int x, int y, int level); - void tellPositionOrNot (core::Widget *widget, int yReq, bool positioned); void checkCoverage (Float *vloat, int oldY); void getFloatsLists (Float *vloat, SortedFloatsVector **listSame, @@ -203,8 +202,7 @@ public: static bool isWidgetOutOfFlow (core::Widget *widget); void addWidget (core::Widget *widget, Textblock *generatingBlock); - void tellNoPosition (core::Widget *widget); - void tellPosition (core::Widget *widget, int y); + void tellPosition (core::Widget *widget, int yReq); void getSize (int cbWidth, int cbHeight, int *oofWidth, int *oofHeight); void getExtremes (int cbMinWidth, int cbMaxWidth, int *oofMinWidth, diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc index 23cae087..d3301049 100644 --- a/dw/textblock_linebreaking.cc +++ b/dw/textblock_linebreaking.cc @@ -1260,12 +1260,6 @@ void Textblock::rewrap () for (int i = firstWord; i < words->size (); i++) { Word *word = words->getRef (i); - if (word->content.type == core::Content::WIDGET_OOF_REF) - containingBlock->outOfFlowMgr->tellNoPosition (word->content.widget); - } - - for (int i = firstWord; i < words->size (); i++) { - Word *word = words->getRef (i); if (word->content.type == core::Content::WIDGET_IN_FLOW) calcWidgetSize (word->content.widget, &word->size); |