]> git.lyx.org Git - lyx.git/commit
Fix to #8159: Undo doesn't restore environment depth correctly
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 4 Jun 2012 16:02:59 +0000 (18:02 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 29 Jun 2012 13:25:47 +0000 (15:25 +0200)
commitbbbc2b654175edbccb1ce54ae6dbb15f8a042360
tree8736f74c91a5eb9f171b4f2a648d1cf2be398d5c
parentc22334eb3bafa51bd0d1527388abca3668d03600
Fix to #8159: Undo doesn't restore environment depth correctly

The idea is to record undo at the place where the document is modified:

1/ in Buffer::updateBuffer, add a recordUndo, with the caveat that a
   const_cast has to be used (because updateBuffer is const but
   modifies the document, go figure).

2/ in GuiApplication::dispatch, add an extra undo group that
   encompasses the updateBuffer call. Some other undo groups may be
   redundant now, but it is not a problem since they do not cost
   anything.
src/Buffer.cpp
src/frontends/qt4/GuiApplication.cpp