diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2016-08-04 10:10:06 -0400 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2016-08-04 10:10:06 -0400 |
commit | f53d39d38a67ef4bd231ddddb61a53a3e5e8775c (patch) | |
tree | cefac014e94fdec73f0298bad2aff60d11a9ce27 /dw | |
parent | 89a3621f776fe93a30ebeba681a550de933ef059 (diff) |
Revert commit #4653 (on hold)
This patch is "on hold", as it depends on reverted code,
and at least would need a non-automatic merge.
Diffstat (limited to 'dw')
-rw-r--r-- | dw/ooffloatsmgr.cc | 58 | ||||
-rw-r--r-- | dw/ooffloatsmgr.hh | 1 | ||||
-rw-r--r-- | dw/textblock.cc | 11 |
3 files changed, 13 insertions, 57 deletions
diff --git a/dw/ooffloatsmgr.cc b/dw/ooffloatsmgr.cc index 5cc01b79..5e6570fa 100644 --- a/dw/ooffloatsmgr.cc +++ b/dw/ooffloatsmgr.cc @@ -652,8 +652,18 @@ void OOFFloatsMgr::markSizeChange (int ref) vloat->dirty = true; DBG_OBJ_SET_BOOL_O (vloat->getWidget (), "<Float>.dirty", vloat->dirty); - updateGenerators (vloat); - + assert (vloat->getWidget()->getWidgetReference() != NULL); + + int first = getOOFAwareWidget(vloat->generator)->index; + DBG_OBJ_MSGF ("resize.oofm", 1, "updating from %d", first); + + tbInfos->get(first)->getOOFAwareWidget() + ->updateReference (vloat->getWidget()->getWidgetReference() + ->parentRef); + + for (int i = first + 1; i < tbInfos->size(); i++) + tbInfos->get(i)->getOOFAwareWidget()->updateReference(0); + floatRef = ref; DBG_OBJ_SET_NUM ("floatRef", floatRef); } @@ -662,29 +672,6 @@ void OOFFloatsMgr::markSizeChange (int ref) } /** - * \brief Update all generators which are affected by a given float. - */ -void OOFFloatsMgr::updateGenerators (Float *vloat) -{ - DBG_OBJ_ENTER ("resize.oofm", 0, "updateGenerators", "#%d [%p]", - vloat->index, vloat->getWidget ()); - - assert (vloat->getWidget()->getWidgetReference() != NULL); - - int first = getOOFAwareWidget(vloat->generator)->index; - DBG_OBJ_MSGF ("resize.oofm", 1, "updating from %d", first); - - tbInfos->get(first)->getOOFAwareWidget() - ->updateReference (vloat->getWidget()->getWidgetReference() - ->parentRef); - - for (int i = first + 1; i < tbInfos->size(); i++) - tbInfos->get(i)->getOOFAwareWidget()->updateReference(0); - - DBG_OBJ_LEAVE (); -} - -/** * `y` is given relative to the container. */ int OOFFloatsMgr::findTBInfo (int y) @@ -754,8 +741,6 @@ void OOFFloatsMgr::tellPosition1 (Widget *widget, int x, int y) getFloatsListsAndSide (vloat, &listSame, &listOpp, &side); ensureFloatSize (vloat); - int oldYReal = vloat->yReal; - // "yReal" may change due to collisions (see below). vloat->yReq = vloat->yReal = y; @@ -820,25 +805,6 @@ void OOFFloatsMgr::tellPosition1 (Widget *widget, int x, int y) DBG_OBJ_MSGF ("resize.oofm", 1, "vloat->yReq = %d, vloat->yReal = %d", vloat->yReq, vloat->yReal); - // In some cases, an explicit update is neccessary, as in this example: - // - // <body> - // <div id="a"> - // <div id="b" style="float:left">main</div> - // </div> - // <div id="c" style="clear:both">x</div> - // <div id="d">footer</div> - // </body> - // - // Without an explicit update, #c would keep an old value for extraSpace.top, - // based on the old value of vloat->yReal. - // - // Notice that #c would be updated otherwise, if it had at least one word - // content. - - if (vloat->yReal != oldYReal) - updateGenerators (vloat); - DBG_OBJ_LEAVE (); } diff --git a/dw/ooffloatsmgr.hh b/dw/ooffloatsmgr.hh index cae57dd5..fdc59fb4 100644 --- a/dw/ooffloatsmgr.hh +++ b/dw/ooffloatsmgr.hh @@ -170,7 +170,6 @@ private: void moveExternalIndices (lout::container::typed::Vector<Float> *list, int oldStartIndex, int diff); Float *findFloatByWidget (core::Widget *widget); - void updateGenerators (Float *vloat); int findTBInfo (int y); void sizeAllocateFloats (Side side); diff --git a/dw/textblock.cc b/dw/textblock.cc index 615e6f11..d7af4420 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -3044,17 +3044,8 @@ void Textblock::queueDrawRange (int index1, int index2) void Textblock::updateReference (int ref) { - DBG_OBJ_ENTER ("resize", 0, "updateReference", "%d", ref); - - // This method can be optimized: nothing must be done when (i) there are no - // words, *and* (ii) there is no float clearance. If the second is not the - // case, `queueResize` must still be called, since `extraSpace.top` may be - // changed. - - if (!(words->size () == 0 && getStyle()->clear == core::style::CLEAR_NONE)) + if (words->size () > 0) queueResize (ref, false); - - DBG_OBJ_LEAVE (); } void Textblock::widgetRefSizeChanged (int externalIndex) |