aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-10-14 16:52:10 +0200
committerSebastian Geerken <devnull@localhost>2014-10-14 16:52:10 +0200
commit3143688e32d73fa788fd2d37e395753bae578e7d (patch)
treeeafdaac3cd9e5543173abc6b7442803f51a7b7a3
parentf2e8f4db64703ef02275b5f1ede8ea79dac1d2ad (diff)
Removed Textblock::calcWidgetSize. (Has finally become obsolete.)
-rw-r--r--dw/textblock.cc22
-rw-r--r--dw/textblock.hh1
-rw-r--r--dw/textblock_linebreaking.cc2
3 files changed, 2 insertions, 23 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 77135143..bad00624 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -1213,26 +1213,6 @@ core::Iterator *Textblock::iterator (core::Content::Type mask, bool atEnd)
return new TextblockIterator (this, mask, atEnd);
}
-/**
- * Calculate the size of a widget within the page.
- */
-void Textblock::calcWidgetSize (core::Widget *widget, core::Requisition *size)
-{
- DBG_OBJ_ENTER ("resize", 0, "calcWidgetSize", "%p, ...", widget);
-
- widget->sizeRequest (size);
-
- // Ascent and descent in words do not contain margins.
- // TODO: Re-evaluate (GROWS)!
- //core::style::Style *wstyle = widget->getStyle();
- //size->ascent -= wstyle->margin.top;
- //size->descent -= wstyle->margin.bottom;
-
- DBG_OBJ_MSGF ("resize", 1, "result: %d * (%d + %d)",
- size->width, size->ascent, size->descent);
- DBG_OBJ_LEAVE ();
-}
-
/*
* Draw the decorations on a word.
*/
@@ -2398,7 +2378,7 @@ void Textblock::addWidget (core::Widget *widget, core::style::Style *style)
this, words->size ());
core::Requisition size;
- calcWidgetSize (widget, &size);
+ widget->sizeRequest (&size);
Word *word = addWord (size.width, size.ascent, size.descent, 0, style);
word->content.type = core::Content::WIDGET_IN_FLOW;
word->content.widget = widget;
diff --git a/dw/textblock.hh b/dw/textblock.hh
index 9f0994ea..7dbb9d52 100644
--- a/dw/textblock.hh
+++ b/dw/textblock.hh
@@ -629,7 +629,6 @@ protected:
void justifyLine (Line *line, int diff);
Line *addLine (int firstWord, int lastWord, int newLastOofPos,
bool temporary, int minHeight);
- void calcWidgetSize (core::Widget *widget, core::Requisition *size);
void rewrap ();
void fillParagraphs ();
void initNewLine ();
diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc
index 2a4f0b7c..66391952 100644
--- a/dw/textblock_linebreaking.cc
+++ b/dw/textblock_linebreaking.cc
@@ -1828,7 +1828,7 @@ void Textblock::rewrap ()
Word *word = words->getRef (i);
if (word->content.type == core::Content::WIDGET_IN_FLOW)
- calcWidgetSize (word->content.widget, &word->size);
+ word->content.widget->sizeRequest (&word->size);
wordWrap (i, false);