]> git.lyx.org Git - lyx.git/commitdiff
* LyXFunc.cpp (dispatch): make sure that a group os created before calling LyXView...
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 15 Sep 2008 15:44:49 +0000 (15:44 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 15 Sep 2008 15:44:49 +0000 (15:44 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26413 a592a061-630c-0410-9148-cb99ea01b6c8

src/LyXFunc.cpp

index 9af54af532a72252b5cb25080ceb1f48bd760b48..6f4f61609511030a9bbf6b65f547c31050c548d6 100644 (file)
@@ -1561,20 +1561,22 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        if (lyx_view_ == 0)
                                break;
 
+                       // Start an undo group. This may be needed for
+                       // some stuff like inset-apply on labels.
+                       if (lyx_view_->view())
+                               view()->cursor().beginUndoGroup();
+                               
                        // Let the current LyXView dispatch its own actions.
                        if (lyx_view_->dispatch(cmd)) {
-                               if (lyx_view_->view())
+                               if (lyx_view_->view()) {
                                        updateFlags = lyx_view_->view()->cursor().result().update();
+                                       view()->cursor().endUndoGroup();
+                               }
                                break;
                        }
 
                        LASSERT(lyx_view_->view(), /**/);
 
-                       // Start an undo group. Normally, all the code
-                       // above only invoked recordUndoFullDocument,
-                       // which does not really require a group.
-                       view()->cursor().beginUndoGroup();
-
                        // Let the current BufferView dispatch its own actions.
                        if (view()->dispatch(cmd)) {
                                // The BufferView took care of its own updates if needed.