]> git.lyx.org Git - features.git/commitdiff
Revert "Second tentative fix to #8159: Undo doesn't restore environment depth correctly"
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 5 Jun 2012 10:52:42 +0000 (12:52 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 5 Jun 2012 10:55:37 +0000 (12:55 +0200)
Did not mean to commit that.

This reverts commit 8f01556236591a1d72c427159974d261b71198ee.

src/Buffer.cpp
src/frontends/qt4/GuiApplication.cpp

index f8f5272e352241452131cff4e8a64896fdffcfd3..8fb72aecb1bd5475863309e635e41d0faadb8a6c 100644 (file)
@@ -4413,17 +4413,7 @@ void Buffer::updateBuffer(ParIterator & parit, UpdateType utype) const
        pit_type const lastpit = parit.lastpit();
        for ( ; parit.pit() <= lastpit ; ++parit.pit()) {
                // reduce depth if necessary
-               if (parit->params().depth() > maxdepth) {
-                       /** FIXME: this function is const, but
-                        * nevertheless it modifies the buffer. To be
-                        * cleaner, one should modify the buffer in
-                        * another function, which is actually
-                        * non-const. This would however be costly in
-                        * terms of code duplication.
-                        */
-                       const_cast<Buffer *>(this)->undo().recordUndo(parit);
-                       parit->params().depth(maxdepth);
-               }
+               parit->params().depth(min(parit->params().depth(), maxdepth));
                maxdepth = parit->getMaxDepthAfter();
 
                if (utype == OutputUpdate) {
index b00fe2d5082fa78ad34cc5d74b8ac8fa3e8b973a..2cec2e333ade2cde742a1cc14a06c1d3747a387a 100644 (file)
@@ -1132,13 +1132,8 @@ static docstring makeDispatchMessage(docstring const & msg,
 
 void GuiApplication::dispatch(FuncRequest const & cmd)
 {
-       Buffer * buffer = 0;
-       if (current_view_ && current_view_->currentBufferView()) {
+       if (current_view_ && current_view_->currentBufferView())
                current_view_->currentBufferView()->cursor().saveBeforeDispatchPosXY();
-               buffer = &current_view_->currentBufferView()->buffer();
-               if (buffer)
-                       buffer->undo().beginUndoGroup();
-       }
 
        DispatchResult dr;
        // redraw the screen at the end (first of the two drawing steps).
@@ -1146,10 +1141,6 @@ void GuiApplication::dispatch(FuncRequest const & cmd)
        dr.screenUpdate(Update::FitCursor);
        dispatch(cmd, dr);
        updateCurrentView(cmd, dr);
-
-       // the buffer may have been closed by one action
-       if (theBufferList().isLoaded(buffer))
-               buffer->undo().endUndoGroup();
 }