]> git.lyx.org Git - features.git/commit
Fix bug #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:33:02 +0000 (15:33 +0200)
commit20f128582118777ec3e0bd6b1b3427784d4165b9
tree4b6db3329bc1cc154948a43e6f33bf88e2e5d97a
parent111f15f335f1c7fad2537e4df923b1d61978f75e
Fix bug #8159: Undo doesn't restore environment depth correctly
(backported from master)

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
status.20x