aboutsummaryrefslogtreecommitdiff
path: root/dw
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-09-23 14:24:33 +0200
committerSebastian Geerken <devnull@localhost>2014-09-23 14:24:33 +0200
commitd2301b7b883f577707b353f9544702dce203ff1b (patch)
tree53f7ca48b25f77fd524e93b24072360a9c1313fe /dw
parent43298239a35f6b75dfc3cb7e392deafb0bb1528c (diff)
OOFAwareWidget::correctRequisitionByOOF: use splitHeightFun.
Diffstat (limited to 'dw')
-rw-r--r--dw/oofawarewidget.cc7
-rw-r--r--dw/oofawarewidget.hh3
-rw-r--r--dw/table.cc2
-rw-r--r--dw/textblock.cc2
-rw-r--r--dw/widget.hh3
5 files changed, 11 insertions, 6 deletions
diff --git a/dw/oofawarewidget.cc b/dw/oofawarewidget.cc
index 7d3b9d7b..11a4615d 100644
--- a/dw/oofawarewidget.cc
+++ b/dw/oofawarewidget.cc
@@ -173,7 +173,9 @@ void OOFAwareWidget::initOutOfFlowMgrs ()
}
}
-void OOFAwareWidget::correctRequisitionByOOF (Requisition *requisition)
+void OOFAwareWidget::correctRequisitionByOOF (Requisition *requisition,
+ void (*splitHeightFun) (int, int*,
+ int*))
{
for (int i = 0; i < NUM_OOFM; i++) {
if (outOfFlowMgr[i]) {
@@ -188,7 +190,8 @@ void OOFAwareWidget::correctRequisitionByOOF (Requisition *requisition)
if (oofWidth > requisition->width)
requisition->width = oofWidth;
if (oofHeight > requisition->ascent + requisition->descent)
- requisition->descent = oofHeight - requisition->ascent;
+ splitHeightFun (oofHeight,
+ &requisition->ascent, &requisition->descent);
}
}
}
diff --git a/dw/oofawarewidget.hh b/dw/oofawarewidget.hh
index 610766ba..e3bd8a07 100644
--- a/dw/oofawarewidget.hh
+++ b/dw/oofawarewidget.hh
@@ -158,7 +158,8 @@ protected:
{ return widget->getStyle()->position == core::style::POSITION_RELATIVE; }
void initOutOfFlowMgrs ();
- void correctRequisitionByOOF (core::Requisition *requisition);
+ void correctRequisitionByOOF (core::Requisition *requisition,
+ void (*splitHeightFun) (int, int*, int*));
void correctExtremesByOOF (core::Extremes *extremes);
void sizeAllocateStart (core::Allocation *allocation);
void sizeAllocateEnd ();
diff --git a/dw/table.cc b/dw/table.cc
index d1154111..d443327b 100644
--- a/dw/table.cc
+++ b/dw/table.cc
@@ -124,7 +124,7 @@ void Table::sizeRequestImpl (core::Requisition *requisition)
correctRequisition (requisition, core::splitHeightPreserveDescent);
// For the order, see similar reasoning for dw::Textblock.
- correctRequisitionByOOF (requisition);
+ correctRequisitionByOOF (requisition, core::splitHeightPreserveDescent);
DBG_OBJ_LEAVE ();
}
diff --git a/dw/textblock.cc b/dw/textblock.cc
index b5d9cea7..9bff14d7 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -392,7 +392,7 @@ void Textblock::sizeRequestImpl (core::Requisition *requisition)
// Is this really what we want? An alternative could be that
// OutOfFlowMgr::getSize honours CSS attributes an corrected sizes.
- correctRequisitionByOOF (requisition);
+ correctRequisitionByOOF (requisition, core::splitHeightPreserveAscent);
DBG_OBJ_MSGF ("resize", 1, "final: %d * (%d + %d)",
requisition->width, requisition->ascent, requisition->descent);
diff --git a/dw/widget.hh b/dw/widget.hh
index 88219764..ca98308e 100644
--- a/dw/widget.hh
+++ b/dw/widget.hh
@@ -190,7 +190,8 @@ protected:
* margin + border + padding + contents.
*
* See also dw::core::Widget::calcExtraSpace and
- * dw::core::Widget::calcExtraSpaceImpl.
+ * dw::core::Widget::calcExtraSpaceImpl. Also, it is feasible to
+ * correct this value within dw::core::Widget::sizeRequestImpl.
*/
style::Box extraSpace;