mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-16 01:53:20 +00:00
undo fixes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7982 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
4c3beeee65
commit
875cec0af0
@ -1,3 +1,9 @@
|
|||||||
|
2003-10-27 Alfredo Braunstein <abraunst@libero.it>
|
||||||
|
|
||||||
|
* undo.C (performUndoOrRedo): fix two crashes by setting a
|
||||||
|
cursor by hand and reordering some calls. Use bv->lockInset instead
|
||||||
|
of inset->edit because the latter loses cursor information
|
||||||
|
|
||||||
2003-10-25 Martin Vermeer <martin.vermeer@hut.fi>
|
2003-10-25 Martin Vermeer <martin.vermeer@hut.fi>
|
||||||
|
|
||||||
* MenuBackend.C:
|
* MenuBackend.C:
|
||||||
|
18
src/undo.C
18
src/undo.C
@ -23,6 +23,8 @@
|
|||||||
#include "lyxtext.h"
|
#include "lyxtext.h"
|
||||||
#include "paragraph.h"
|
#include "paragraph.h"
|
||||||
|
|
||||||
|
#include "insets/updatableinset.h" // for dynamic_cast<UpdatableInset *>
|
||||||
|
|
||||||
using lyx::paroffset_type;
|
using lyx::paroffset_type;
|
||||||
|
|
||||||
|
|
||||||
@ -188,23 +190,25 @@ bool performUndoOrRedo(BufferView * bv, Undo const & undo)
|
|||||||
<< " inset: " << pit.inset()
|
<< " inset: " << pit.inset()
|
||||||
<< " index: " << undo.index
|
<< " index: " << undo.index
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
InsetOld * inset = pit.inset();
|
|
||||||
if (inset) {
|
|
||||||
// magic needed to cope with inset locking
|
|
||||||
inset->edit(bv, undo.index);
|
|
||||||
}
|
|
||||||
|
|
||||||
// set cursor again to force the position to be the right one
|
// set cursor again to force the position to be the right one
|
||||||
text->setCursorIntern(undo.cursor_par, undo.cursor_pos);
|
text->cursor.par(undo.cursor_par);
|
||||||
|
text->cursor.pos(undo.cursor_pos);
|
||||||
|
|
||||||
// clear any selection
|
// clear any selection
|
||||||
text->clearSelection();
|
text->clearSelection();
|
||||||
text->selection.cursor = text->cursor;
|
text->selection.cursor = text->cursor;
|
||||||
text->updateCounters();
|
text->updateCounters();
|
||||||
|
|
||||||
// rebreak the entire document
|
// rebreak the entire lyxtext
|
||||||
bv->text->fullRebreak();
|
bv->text->fullRebreak();
|
||||||
|
|
||||||
|
InsetOld * inset = pit.inset();
|
||||||
|
if (inset) {
|
||||||
|
// magic needed to cope with inset locking
|
||||||
|
bv->lockInset(dynamic_cast<UpdatableInset *>(inset));
|
||||||
|
}
|
||||||
|
|
||||||
finishUndo();
|
finishUndo();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user