]> git.lyx.org Git - features.git/commitdiff
Fix properly bug 5287: http://bugzilla.lyx.org/show_bug.cgi?id=5287
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 30 Sep 2008 13:47:16 +0000 (13:47 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 30 Sep 2008 13:47:16 +0000 (13:47 +0000)
* BufferView.cpp (setCursorFromInset): do not ignore the first inset
of the document; revert first tentative patch for this bug.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26645 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp

index c9b03bd607068679b1b39284af7d616bfd251b63..cea5b723c6d890a1c0e60e68bc9f1ec7bd906b31 100644 (file)
@@ -1742,15 +1742,14 @@ void BufferView::setCursorFromRow(int row)
 bool BufferView::setCursorFromInset(Inset const * inset)
 {
        // are we already there?
-       if (&cursor().inset() == inset || cursor().nextInset() == inset)
+       if (cursor().nextInset() == inset)
                return true;
 
        // Inset is not at cursor position. Find it in the document.
        Cursor cur(*this);
        cur.reset(buffer().inset());
-       do 
+       while (cur && cur.nextInset() != inset)
                cur.forwardInset();
-       while (cur && cur.nextInset() != inset);
 
        if (cur) {
                setCursor(cur);