diff options
-rw-r--r-- | dw/alignedtablecell.cc | 5 | ||||
-rw-r--r-- | dw/alignedtablecell.hh | 2 | ||||
-rw-r--r-- | dw/oofawarewidget.cc | 19 | ||||
-rw-r--r-- | dw/oofawarewidget.hh | 1 | ||||
-rw-r--r-- | dw/simpletablecell.cc | 5 | ||||
-rw-r--r-- | dw/simpletablecell.hh | 2 | ||||
-rw-r--r-- | dw/tablecell.hh | 2 |
7 files changed, 34 insertions, 2 deletions
diff --git a/dw/alignedtablecell.cc b/dw/alignedtablecell.cc index 08750faa..e7ab2741 100644 --- a/dw/alignedtablecell.cc +++ b/dw/alignedtablecell.cc @@ -129,6 +129,11 @@ int AlignedTableCell::applyPerHeight (int containerHeight, return tablecell::applyPerHeight (this, containerHeight, perHeight); } +bool AlignedTableCell::adjustExtraSpaceWhenCorrectingRequisitionByOOF () +{ + return tablecell::adjustExtraSpaceWhenCorrectingRequisitionByOOF (); +} + int AlignedTableCell::wordWrap(int wordIndex, bool wrapAll) { Textblock::Word *word; diff --git a/dw/alignedtablecell.hh b/dw/alignedtablecell.hh index 5ea606d7..5325ba63 100644 --- a/dw/alignedtablecell.hh +++ b/dw/alignedtablecell.hh @@ -22,6 +22,8 @@ protected: bool getAdjustMinWidth (); + bool adjustExtraSpaceWhenCorrectingRequisitionByOOF (); + int wordWrap (int wordIndex, bool wrapAll); int getValue (); diff --git a/dw/oofawarewidget.cc b/dw/oofawarewidget.cc index 11a4615d..f8e3c497 100644 --- a/dw/oofawarewidget.cc +++ b/dw/oofawarewidget.cc @@ -187,11 +187,21 @@ void OOFAwareWidget::correctRequisitionByOOF (Requisition *requisition, outOfFlowMgr[i]->getSize (requisition, &oofWidth, &oofHeight); - if (oofWidth > requisition->width) + if (oofWidth > requisition->width) { + if (adjustExtraSpaceWhenCorrectingRequisitionByOOF ()) + extraSpace.right = max (extraSpace.right, + oofWidth - requisition->width); requisition->width = oofWidth; - if (oofHeight > requisition->ascent + requisition->descent) + } + + if (oofHeight > requisition->ascent + requisition->descent) { + if (adjustExtraSpaceWhenCorrectingRequisitionByOOF ()) + extraSpace.bottom = max (extraSpace.bottom, + oofHeight - (requisition->ascent + + requisition->descent)); splitHeightFun (oofHeight, &requisition->ascent, &requisition->descent); + } } } } @@ -323,6 +333,11 @@ bool OOFAwareWidget::isPossibleContainerParent (int oofmIndex) return oofmIndex != OOFM_FLOATS; } +bool OOFAwareWidget::adjustExtraSpaceWhenCorrectingRequisitionByOOF () +{ + return true; +} + } // namespace oof } // namespace dw diff --git a/dw/oofawarewidget.hh b/dw/oofawarewidget.hh index e3bd8a07..af6a18e0 100644 --- a/dw/oofawarewidget.hh +++ b/dw/oofawarewidget.hh @@ -188,6 +188,7 @@ public: virtual int getLineBreakWidth (); // Should perhaps be renamed. virtual bool isPossibleContainer (int oofmIndex); virtual bool isPossibleContainerParent (int oofmIndex); + virtual bool adjustExtraSpaceWhenCorrectingRequisitionByOOF (); }; } // namespace oof diff --git a/dw/simpletablecell.cc b/dw/simpletablecell.cc index 02f92db6..62b4a0a4 100644 --- a/dw/simpletablecell.cc +++ b/dw/simpletablecell.cc @@ -119,4 +119,9 @@ int SimpleTableCell::applyPerHeight (int containerHeight, return tablecell::applyPerHeight (this, containerHeight, perHeight); } +bool SimpleTableCell::adjustExtraSpaceWhenCorrectingRequisitionByOOF () +{ + return tablecell::adjustExtraSpaceWhenCorrectingRequisitionByOOF (); +} + } // namespace dw diff --git a/dw/simpletablecell.hh b/dw/simpletablecell.hh index 4c18b454..c90fc040 100644 --- a/dw/simpletablecell.hh +++ b/dw/simpletablecell.hh @@ -18,6 +18,8 @@ protected: bool getAdjustMinWidth (); + bool adjustExtraSpaceWhenCorrectingRequisitionByOOF (); + public: static int CLASS_ID; diff --git a/dw/tablecell.hh b/dw/tablecell.hh index 2e26c8e8..f7936203 100644 --- a/dw/tablecell.hh +++ b/dw/tablecell.hh @@ -28,6 +28,8 @@ int applyPerWidth (core::Widget *widget, int containerWidth, int applyPerHeight (core::Widget *widget, int containerHeight, core::style::Length perHeight); +inline bool adjustExtraSpaceWhenCorrectingRequisitionByOOF () { return false; } + } // namespace dw } // namespace dw |