]> git.lyx.org Git - lyx.git/commitdiff
Fix bug #8370: crash when searching for next change
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 5 Apr 2013 13:58:08 +0000 (15:58 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 7 Apr 2013 12:22:37 +0000 (14:22 +0200)
Cursor::backwardPos() may enter in a nested inset, while CursorSlice::backwardPos() will not.

src/lyxfind.cpp

index 50a50598e7566906a9e57fdfe539cd9626016b75..a01fbd63091dfe42b7089c140cc2d4f860e1ad0c 100644 (file)
@@ -452,13 +452,14 @@ bool findChange(BufferView * bv, bool next)
        bv->cursor().setCursor(cur);
        bv->cursor().resetAnchor();
 
+       CursorSlice & tip = cur.top();
+
        if (!next)
                // take a step into the change
-               cur.backwardPos();
+               tip.backwardPos();
 
-       Change orig_change = cur.paragraph().lookupChange(cur.pos());
+       Change orig_change = tip.paragraph().lookupChange(tip.pos());
 
-       CursorSlice & tip = cur.top();
        if (next) {
                for (; !tip.at_end(); tip.forwardPos()) {
                        Change change = tip.paragraph().lookupChange(tip.pos());