diff options
author | Sebastian Geerken <devnull@localhost> | 2014-11-08 14:57:16 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-11-08 14:57:16 +0100 |
commit | aa4f6269918fcfc5ebd11d3b712e88577773ba02 (patch) | |
tree | 9e914def2dc344a71c266f4361123abcbde88cba /dw/textblock.cc | |
parent | faa8d1b65d9f724445e068d2766356103204728a (diff) | |
parent | 550d933b21d548411fe862d6a24ce73e4d5621c5 (diff) |
Merge with main repo.
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 18303951..d88b411f 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -3129,7 +3129,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); |