diff options
author | Sebastian Geerken <devnull@localhost> | 2014-11-06 23:20:48 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-11-06 23:20:48 +0100 |
commit | 88943c42e9d667f93b4ec12b5eb0c886a29a02a1 (patch) | |
tree | 61db2b4757e39e055de3db15b50f81d14b57b0a5 /dw/textblock.cc | |
parent | aa797832f08ae3fcfd3fbd00054e16861f3eb2d5 (diff) |
Fixed TextblockIterator::getAllocation() for words not yet belonging to a line.
Diffstat (limited to 'dw/textblock.cc')
-rw-r--r-- | dw/textblock.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc index bad00624..47ed7bdb 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -3108,7 +3108,8 @@ Textblock *Textblock::getTextblockForLine (Line *line) Textblock *Textblock::getTextblockForLine (int lineNo) { - int firstWord = lineNo == 0 ? 0 :lines->getRef(lineNo - 1)->lastWord + 1; + // Can also be used for a line not yet existing. + int firstWord = lineNo == 0 ? 0 : lines->getRef(lineNo - 1)->lastWord + 1; int lastWord = lineNo < lines->size() ? lines->getRef(lineNo)->lastWord : words->size() - 1; return getTextblockForLine (firstWord, lastWord); |