aboutsummaryrefslogtreecommitdiff
path: root/dw/textblock.hh
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-03-02 11:44:28 +0100
committerSebastian Geerken <devnull@localhost>2014-03-02 11:44:28 +0100
commit99c1ac5f4ac2681e2740b076a3ab9c0bcab7817e (patch)
tree55c41305a6f24dc5345dd9a1a8a1d430c4a350a7 /dw/textblock.hh
parent3945e91283e1aa2d69deed90f7f551ddda71a12a (diff)
Two more memory problems.
Diffstat (limited to 'dw/textblock.hh')
-rw-r--r--dw/textblock.hh14
1 files changed, 10 insertions, 4 deletions
diff --git a/dw/textblock.hh b/dw/textblock.hh
index e29b93d5..35eea189 100644
--- a/dw/textblock.hh
+++ b/dw/textblock.hh
@@ -658,10 +658,16 @@ protected:
{
if (lines->size() == 0)
return 0;
- else
- return
- (words->getRef(lines->getLastRef()->lastWord)->flags &
- (Word::DIV_CHAR_AT_EOL | Word::PERM_DIV_CHAR)) ? 1 : 0;
+ else {
+ Line *line = lines->getLastRef();
+ if (line->firstWord <= line->lastWord)
+ return
+ (words->getRef(line->lastWord)->flags &
+ (Word::DIV_CHAR_AT_EOL | Word::PERM_DIV_CHAR)) ? 1 : 0;
+ else
+ // empty line
+ return 0;
+ }
}
Textblock *getTextblockForLine (Line *line);