diff options
-rw-r--r-- | dw/textblock.cc | 22 | ||||
-rw-r--r-- | dw/textblock.hh | 1 | ||||
-rw-r--r-- | dw/textblock_linebreaking.cc | 2 |
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); |