]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiDocument.cpp
Merge remote-tracking branch 'features/properpaint' into 2.3.2-staging
[lyx.git] / src / frontends / qt4 / GuiDocument.cpp
index 09203781f0080a32dee27dfc67113478258d5552..560883ec6a545e6c00c7d62fb9bf601c58faa748 100644 (file)
@@ -4327,7 +4327,8 @@ void GuiDocument::dispatchParams()
        // We need a non-const buffer object.
        Buffer & buf = const_cast<BufferView *>(bufferview())->buffer();
        // There may be several undo records; group them (bug #8998)
-       buf.undo().beginUndoGroup();
+       // This handles undo groups automagically
+       UndoGroupHelper ugh(&buf);
 
        // This must come first so that a language change is correctly noticed
        setLanguage();
@@ -4394,10 +4395,6 @@ void GuiDocument::dispatchParams()
        // If we used an LFUN, we would not need these two lines:
        BufferView * bv = const_cast<BufferView *>(bufferview());
        bv->processUpdateFlags(Update::Force | Update::FitCursor);
-
-       // Don't forget to close the group. Note that it is important
-       // to check that there is no early return in the method.
-       buf.undo().endUndoGroup();
 }