diff options
author | Sebastian Geerken <devnull@localhost> | 2014-04-01 14:07:32 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-04-01 14:07:32 +0200 |
commit | 244a03a0baef40605e2c1d3e5805241bf7a142b4 (patch) | |
tree | d21dd20e2b01c1d10ec023861051e5a8ecadcd64 /dw/textblock.cc | |
parent | 4184225ff4fb71cc4cef003f18b85f1f949e115a (diff) |
Solved problems with OOF references at the end of a textblock.
Diffstat (limited to 'dw/textblock.cc')
-rw-r--r-- | dw/textblock.cc | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc index e0e35237..49030d26 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -294,19 +294,8 @@ Textblock::~Textblock () /* make sure not to call a free'd tooltip (very fast overkill) */ hoverTooltip = NULL; - for (int i = 0; i < words->size(); i++) { - Word *word = words->getRef (i); - - if (word->content.type == core::Content::WIDGET_IN_FLOW) - delete word->content.widget; - /** \todo Widget references? What about texts? */ - - removeWordImgRenderer (i); - removeSpaceImgRenderer (i); - - word->style->unref (); - word->spaceStyle->unref (); - } + for (int i = 0; i < words->size(); i++) + cleanupWord (i); for (int i = 0; i < anchors->size(); i++) { Anchor *anchor = anchors->getRef (i); @@ -1708,6 +1697,21 @@ void Textblock::initWord (int wordNo) word->spaceImgRenderer = NULL; } +void Textblock::cleanupWord (int wordNo) +{ + Word *word = words->getRef (wordNo); + + if (word->content.type == core::Content::WIDGET_IN_FLOW) + delete word->content.widget; + /** \todo Widget references? What about texts? */ + + removeWordImgRenderer (wordNo); + removeSpaceImgRenderer (wordNo); + + word->style->unref (); + word->spaceStyle->unref (); +} + void Textblock::removeWordImgRenderer (int wordNo) { Word *word = words->getRef (wordNo); |