]> git.lyx.org Git - lyx.git/commitdiff
Georg's fix for my crash moved too much inside the inTexted() crash: We
authorRichard Heck <rgheck@comcast.net>
Wed, 8 Dec 2010 21:46:57 +0000 (21:46 +0000)
committerRichard Heck <rgheck@comcast.net>
Wed, 8 Dec 2010 21:46:57 +0000 (21:46 +0000)
never update the buffer if we're not in text!!

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

src/frontends/qt4/GuiApplication.cpp

index 47b3eaa06c8dbbc6e9f0938c45c9488b31d394ee..152d3a5ba3719e0fafc7e4a887091862a8f06d9c 100644 (file)
@@ -1113,17 +1113,17 @@ void GuiApplication::dispatch(FuncRequest const & cmd)
                // Actually, this test ought not to be done at all, since the
                // whole InsetBibitem business is a mess. But that is a different
                // story.
+               int moveCursor = 0;
                if (cursor.inTexted()) {
-                       int const moveCursor = cursor.paragraph().checkBiblio(buf);
+                       moveCursor = cursor.paragraph().checkBiblio(buf);
                        if (moveCursor > 0)
                                cursor.posForward();
                        else if (moveCursor < 0 && cursor.pos() >= -moveCursor)
                                cursor.posBackward();
-
-                       if (moveCursor != 0 || dr.needBufferUpdate()) {
-                               cursor.clearBufferUpdate();
-                               buf.updateBuffer();
-                       }
+               }
+               if (moveCursor != 0 || dr.needBufferUpdate()) {
+                       cursor.clearBufferUpdate();
+                       buf.updateBuffer();
                }
                // BufferView::update() updates the ViewMetricsInfo and
                // also initializes the position cache for all insets in