TextDocumentLayout: Fixed LineIndexForOffset()

It stepped over a wrong number of lines when skipping to the
ParagraphLayout containing the text offset.
This commit is contained in:
Stephan Aßmus 2013-12-07 14:37:52 +01:00
parent 287e53bd89
commit 1d70e2ccd4

View File

@ -112,8 +112,7 @@ TextDocumentLayout::LineIndexForOffset(int32 textOffset)
if (index >= 0) {
int32 lineIndex = 0;
for (int32 i = 0; i < index; i++) {
lineIndex += fParagraphLayouts.ItemAtFast(index)
.layout->CountLines();
lineIndex += fParagraphLayouts.ItemAtFast(i).layout->CountLines();
}
const ParagraphLayoutInfo& info = fParagraphLayouts.ItemAtFast(index);