diff options
author | corvid <corvid@lavabit.com> | 2009-10-29 15:48:25 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2009-10-29 15:48:25 +0000 |
commit | dfc58e25a03ebca75f54ca975c0e7f162033feff (patch) | |
tree | e64f15230b96426c16494bfcb58a02df3b502fb4 /dw/textblock.cc | |
parent | 02d471f2cdc4173268ee92c20fef13b57a615a2c (diff) |
shouldn't need lines() test in addSpace
Diffstat (limited to 'dw/textblock.cc')
-rw-r--r-- | dw/textblock.cc | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc index 76c7569d..91f31d1f 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -1684,26 +1684,24 @@ bool Textblock::addAnchor (const char *name, core::style::Style *style) */ void Textblock::addSpace (core::style::Style *style) { - if (lines->size () > 0) { - int wordIndex = words->size () - 1; - - if (wordIndex >= 0) { - Word *word = words->getRef(wordIndex); - - if (!word->content.space) { - word->content.space = true; - word->effSpace = word->origSpace = style->font->spaceWidth; - - //DBG_OBJ_ARRSET_NUM (page, "words.%d.orig_space", nw, - // page->words[nw].orig_space); - //DBG_OBJ_ARRSET_NUM (page, "words.%d.eff_space", nw, - // page->words[nw].eff_space); - //DBG_OBJ_ARRSET_NUM (page, "words.%d.content.space", nw, - // page->words[nw].content.space); - word->spaceStyle->unref (); - word->spaceStyle = style; - style->ref (); - } + int wordIndex = words->size () - 1; + + if (wordIndex >= 0) { + Word *word = words->getRef(wordIndex); + + if (!word->content.space) { + word->content.space = true; + word->effSpace = word->origSpace = style->font->spaceWidth; + + //DBG_OBJ_ARRSET_NUM (page, "words.%d.orig_space", nw, + // page->words[nw].orig_space); + //DBG_OBJ_ARRSET_NUM (page, "words.%d.eff_space", nw, + // page->words[nw].eff_space); + //DBG_OBJ_ARRSET_NUM (page, "words.%d.content.space", nw, + // page->words[nw].content.space); + word->spaceStyle->unref (); + word->spaceStyle = style; + style->ref (); } } } |