diff options
author | Sebastian Geerken <devnull@localhost> | 2015-10-03 19:33:11 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2015-10-03 19:33:11 +0200 |
commit | de8f5fcfb1977266557911f61f51d46173157818 (patch) | |
tree | d7b9c5d0ccf35ec46a623a9ffeb68d01d4734362 | |
parent | d8571c047c7e8599d3c53916ec8e335311b98c70 (diff) |
SRDOP: more cleanup related to floats.
-rw-r--r-- | dw/alignedtablecell.hh | 4 | ||||
-rw-r--r-- | dw/listitem.hh | 4 | ||||
-rw-r--r-- | dw/oofawarewidget.cc | 7 | ||||
-rw-r--r-- | dw/oofawarewidget.hh | 2 | ||||
-rw-r--r-- | dw/ooffloatsmgr.cc | 14 | ||||
-rw-r--r-- | dw/simpletablecell.hh | 4 | ||||
-rw-r--r-- | dw/textblock.cc | 42 | ||||
-rw-r--r-- | dw/textblock.hh | 7 |
8 files changed, 32 insertions, 52 deletions
diff --git a/dw/alignedtablecell.hh b/dw/alignedtablecell.hh index 56196e6d..8d8e91f5 100644 --- a/dw/alignedtablecell.hh +++ b/dw/alignedtablecell.hh @@ -25,6 +25,8 @@ protected: bool adjustExtraSpaceWhenCorrectingRequisitionByOOF (); + bool mustBeWidenedToAvailWidth (); + int wordWrap (int wordIndex, bool wrapAll); int getValue (); @@ -40,8 +42,6 @@ public: int applyPerHeight (int containerHeight, core::style::Length perHeight); bool isBlockLevel (); - - bool mustBeWidenedToAvailWidth (); }; } // namespace dw diff --git a/dw/listitem.hh b/dw/listitem.hh index 20fa6e9d..9736c25f 100644 --- a/dw/listitem.hh +++ b/dw/listitem.hh @@ -9,6 +9,8 @@ namespace dw { class ListItem: public AlignedTextblock { protected: + bool mustBeWidenedToAvailWidth (); + int getValue (); void setMaxValue (int maxValue, int value); @@ -18,8 +20,6 @@ public: ListItem(ListItem *ref, bool limitTextWidth); ~ListItem(); - bool mustBeWidenedToAvailWidth (); - void initWithWidget (core::Widget *widget, core::style::Style *style); void initWithText (const char *text, core::style::Style *style); }; diff --git a/dw/oofawarewidget.cc b/dw/oofawarewidget.cc index cc397986..fe5302d8 100644 --- a/dw/oofawarewidget.cc +++ b/dw/oofawarewidget.cc @@ -531,13 +531,6 @@ void OOFAwareWidget::removeChild (Widget *child) assert (isWidgetOOF (child)); } -bool OOFAwareWidget::mustBeWidenedToAvailWidth () -{ - // Only used for floats. - assertNotReached (); - return false; -} - void OOFAwareWidget::borderChanged (int oofmIndex, int y, Widget *widgetOOF) { assertNotReached (); diff --git a/dw/oofawarewidget.hh b/dw/oofawarewidget.hh index 4f26b91f..4b6a2fd0 100644 --- a/dw/oofawarewidget.hh +++ b/dw/oofawarewidget.hh @@ -251,8 +251,6 @@ public: void draw (core::View *view, core::Rectangle *area, core::DrawingContext *context); - virtual bool mustBeWidenedToAvailWidth (); - /** * Called by an implementation of dw::oof::OutOfFlowMgr (actually only * OOFFloatsMgr) when the border has changed due to a widget out of flow, or diff --git a/dw/ooffloatsmgr.cc b/dw/ooffloatsmgr.cc index 4d301e62..2e4c756f 100644 --- a/dw/ooffloatsmgr.cc +++ b/dw/ooffloatsmgr.cc @@ -525,20 +525,6 @@ void OOFFloatsMgr::sizeAllocateFloats (Side side) DBG_OBJ_LEAVE (); } -// Used as argument "gbWidth" for calcFloatX(), in the context of allocation. -int OOFFloatsMgr::getGBWidthForAllocation (Float *vloat) -{ - // See comments in getFloatsSize() for a detailed rationale ... - if (container->mustBeWidenedToAvailWidth ()) - return vloat->generatingBlock->getGeneratorWidth (); - else - // ... but notice this difference: not GB width + float width is - // used, but only GB width, since the float width has already - // been included in getFloatsSize(). - return min (getAllocation(vloat->generatingBlock)->width, - vloat->generatingBlock->getGeneratorWidth ()); -} - /** * \brief ... * diff --git a/dw/simpletablecell.hh b/dw/simpletablecell.hh index 90f24ae4..6e9f0f8f 100644 --- a/dw/simpletablecell.hh +++ b/dw/simpletablecell.hh @@ -21,6 +21,8 @@ protected: bool adjustExtraSpaceWhenCorrectingRequisitionByOOF (); + bool mustBeWidenedToAvailWidth (); + public: static int CLASS_ID; @@ -31,8 +33,6 @@ public: int applyPerHeight (int containerHeight, core::style::Length perHeight); bool isBlockLevel (); - - bool mustBeWidenedToAvailWidth (); }; } // namespace dw diff --git a/dw/textblock.cc b/dw/textblock.cc index 1dbe3ab7..f910e2ff 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -399,6 +399,27 @@ core::Widget *Textblock::sizeRequestReference (int index) return sizeReferences[index]; } +bool Textblock::mustBeWidenedToAvailWidth () +{ + DBG_OBJ_ENTER0 ("resize", 0, "mustBeWidenedToAvailWidth"); + bool toplevel = getParent () == NULL, + block = getStyle()->display == core::style::DISPLAY_BLOCK, + vloat = testWidgetFloat (this), + abspos = testWidgetAbsolutelyPositioned (this), + fixpos = testWidgetFixedlyPositioned (this), + // 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 (); + return result; +} + int Textblock::calcVerticalBorder (int widgetPadding, int widgetBorder, int widgetMargin, int lineBorderTotal, int lineMarginTotal) @@ -2977,27 +2998,6 @@ void Textblock::queueDrawRange (int index1, int index2) DBG_OBJ_LEAVE (); } -bool Textblock::mustBeWidenedToAvailWidth () -{ - DBG_OBJ_ENTER0 ("resize", 0, "mustBeWidenedToAvailWidth"); - bool toplevel = getParent () == NULL, - block = getStyle()->display == core::style::DISPLAY_BLOCK, - vloat = testWidgetFloat (this), - abspos = testWidgetAbsolutelyPositioned (this), - fixpos = testWidgetFixedlyPositioned (this), - // 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 (); - return result; -} - void Textblock::borderChanged (int oofmIndex, int y, Widget *widgetOOF) { DBG_OBJ_ENTER ("resize", 0, "borderChanged", "%s, %d, %p", diff --git a/dw/textblock.hh b/dw/textblock.hh index 515d67f6..397ba0e6 100644 --- a/dw/textblock.hh +++ b/dw/textblock.hh @@ -779,7 +779,9 @@ protected: core::MousePositionEvent *event); void processWord (int wordIndex); + virtual int wordWrap (int wordIndex, bool wrapAll); + int wrapWordInFlow (int wordIndex, bool wrapAll); int wrapWordOofRef (int wordIndex, bool wrapAll); void balanceBreakPosAndHeight (int wordIndex, int firstIndex, @@ -827,6 +829,8 @@ protected: int numSizeRequestReferences (); Widget *sizeRequestReference (int index); + virtual bool mustBeWidenedToAvailWidth (); + void getExtremesSimpl (core::Extremes *extremes); int numGetExtremesReferences (); @@ -902,8 +906,7 @@ public: void changeLinkColor (int link, int newColor); void changeWordStyle (int from, int to, core::style::Style *style, bool includeFirstSpace, bool includeLastSpace); - - bool mustBeWidenedToAvailWidth (); + void borderChanged (int oofmIndex, int y, core::Widget *widgetOOF); void widgetRefSizeChanged (int externalIndex); void clearPositionChanged (); |