mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 02:14:50 +00:00
* src/lyxfind.C: fix change tracking crash
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17011 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
cdd8c9e076
commit
1761baaf24
@ -348,12 +348,21 @@ bool findNextChange(BufferView * bv)
|
||||
Change orig_change = cur.paragraph().lookupChange(cur.pos());
|
||||
|
||||
DocIterator et = doc_iterator_end(cur.inset());
|
||||
DocIterator ok = cur; // see below
|
||||
for (; cur != et; cur.forwardPosNoDescend()) {
|
||||
ok = cur;
|
||||
Change change = cur.paragraph().lookupChange(cur.pos());
|
||||
if (change != orig_change) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// avoid crash (assertion violation) if the imaginary end-of-par
|
||||
// character of the last paragraph of the document is marked as changed
|
||||
if (cur == et) {
|
||||
cur = ok;
|
||||
}
|
||||
|
||||
// Now put cursor to end of selection:
|
||||
bv->cursor().setCursor(cur);
|
||||
bv->cursor().setSelection();
|
||||
|
Loading…
Reference in New Issue
Block a user