aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-10-06 12:29:51 +0200
committerSebastian Geerken <devnull@localhost>2014-10-06 12:29:51 +0200
commitb2619e5c7cce1dcc7e1bd70a9fae0095118da6da (patch)
treee96ac84daa26988029beb8582461e4ea50481c6b
parent911af8647d85f4f234ea600713b3bead07e331da (diff)
Handling 'clearPosition' in a different way.
-rw-r--r--dw/textblock.cc25
-rw-r--r--dw/textblock.hh5
-rw-r--r--dw/textblock_linebreaking.cc15
3 files changed, 8 insertions, 37 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc
index d90c0781..a9920a1c 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -265,9 +265,6 @@ Textblock::Textblock (bool limitTextWidth)
lineBreakWidth = -1;
DBG_OBJ_SET_NUM ("lineBreakWidth", lineBreakWidth);
- clearPosition = 0;
- DBG_OBJ_SET_NUM ("clearPosition", clearPosition);
-
this->limitTextWidth = limitTextWidth;
for (int layer = 0; layer < core::HIGHLIGHT_NUM_LAYERS; layer++) {
@@ -694,6 +691,14 @@ void Textblock::sizeAllocateImpl (core::Allocation *allocation)
void Textblock::calcExtraSpaceImpl ()
{
OOFAwareWidget::calcExtraSpaceImpl ();
+
+ int clearPosition = 0;
+ for (int i = 0; i < NUM_OOFM; i++)
+ if (searchOutOfFlowMgr(i))
+ clearPosition =
+ misc::max (clearPosition,
+ searchOutOfFlowMgr(i)->getClearPosition (this));
+
extraSpace.top = misc::max (extraSpace.top, clearPosition);
}
@@ -2843,20 +2848,6 @@ void Textblock::queueDrawRange (int index1, int index2)
DBG_OBJ_LEAVE ();
}
-void Textblock::setClearPosition (int clearPosition)
-{
- DBG_OBJ_ENTER ("resize", 0, "setClearPosition", "%d", clearPosition);
-
- if (this->clearPosition != clearPosition) {
- this->clearPosition = clearPosition;
- DBG_OBJ_SET_NUM ("clearPosition", clearPosition);
- mustQueueResize = true;
- queueDraw (); // Could perhaps be optimized.
- }
-
- DBG_OBJ_LEAVE ();
-}
-
/**
* Called by dw::OOFFloatsMgr when the border has changed due to a
* float (or some floats).
diff --git a/dw/textblock.hh b/dw/textblock.hh
index f041488b..19140492 100644
--- a/dw/textblock.hh
+++ b/dw/textblock.hh
@@ -522,10 +522,6 @@ protected:
/* This value is (currently) set by setAscent(). */
int lineBreakWidth;
- // Vertical offset at the top, used for the "clear" attribute. Goes
- // into "extraSpace".
- int clearPosition;
-
int wrapRefLines, wrapRefParagraphs; /* 0-based. Important: Both
are the line numbers, not
the value stored in
@@ -573,7 +569,6 @@ protected:
void calcBorders (int lastOofRef, int height);
void showMissingLines ();
void removeTemporaryLines ();
- void setClearPosition (int clearPosition);
void decorateText (core::View *view, core::style::Style *style,
core::style::Color::Shading shading,
diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc
index 8a7f1c9c..77cf46be 100644
--- a/dw/textblock_linebreaking.cc
+++ b/dw/textblock_linebreaking.cc
@@ -1935,21 +1935,6 @@ void Textblock::initNewLine ()
{
DBG_OBJ_ENTER0 ("construct.line", 0, "initNewLine");
- // At the very beginning, in Textblock::Textblock, where this
- // method is called, containingBlock is not yet defined.
-
- if (lines->size () == 0) {
- int clearPosition = 0;
-
- for (int i = 0; i < NUM_OOFM; i++)
- if (searchOutOfFlowMgr(i))
- clearPosition =
- misc::max (clearPosition,
- searchOutOfFlowMgr(i)->getClearPosition (this));
-
- setClearPosition (misc::max (clearPosition, 0));
- }
-
calcBorders (lines->size() > 0 ?
lines->getLastRef()->lastOofRefPositionedBeforeThisLine : -1,
1);