Commit 2900f7be authored by Pierre Ducroquet's avatar Pierre Ducroquet 🛩

Don't look further than what we are currently layouting

This code was off by one and tried to look for anchors after the line current
layouting.

Testing done on :
- the two test cases for bug 332220 : no more crash, comment still visible.
- a simple non-crashing file : no crash, comment still visible.

REVIEW: 120375
BUG: 332220
parent 2e3bcccb
......@@ -562,7 +562,7 @@ void KoTextDocumentLayout::positionAnchorTextRanges(int pos, int length, const Q
if (!textRangeManager()) {
return;
}
QHash<int, KoTextRange *> ranges = textRangeManager()->textRangesChangingWithin(effectiveDocument, pos, pos+length, pos, pos+length);
QHash<int, KoTextRange *> ranges = textRangeManager()->textRangesChangingWithin(effectiveDocument, pos, pos + length - 1, pos, pos + length - 1);
foreach(KoTextRange *range, ranges.values()) {
KoAnchorTextRange *anchorRange = dynamic_cast<KoAnchorTextRange *>(range);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment