]> git.lyx.org Git - features.git/commitdiff
Fix crash when accepting change
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 5 Jun 2014 10:18:09 +0000 (12:18 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 5 Jun 2014 10:23:19 +0000 (12:23 +0200)
The problem is the use of cursor movement methods to update cursor.
Cursor::forwardPos() steps into insets, which is not always what we
want. The problem here is that there is a math inset just after the
accepted change, and that the cursor steps into it for some reason.

This code is a nightmare anyway.

Fixes: bug #9145
src/lyxfind.cpp

index 0c10e1980d840128db3ff15fb6a0eeba69f47080..6b9556e8790e92fe3d2a4f87202cfce0d99927c7 100644 (file)
@@ -400,7 +400,7 @@ bool findChange(DocIterator & cur, bool next)
                        if (!next)
                                // if we search backwards, take a step forward
                                // to correctly set the anchor
-                               cur.forwardPos();
+                               cur.top().forwardPos();
                        return true;
                }