From cac6814fedbbb4e4399900d9fb9fca69feca69f3 Mon Sep 17 00:00:00 2001 From: Alfredo Braunstein Date: Mon, 3 Nov 2003 21:22:31 +0000 Subject: [PATCH] fix undo crash git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8022 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/undo.C | 16 +++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 14c867dbd0..6e57b13d81 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2003-11-03 Alfredo Braunstein + + * undo.C (performUndoOrRedo): fix cursor positioning with lockPath + 2003-11-03 Lars Gullik Bjønnes * text3.C (dispatch): adjust for new DisptchResult semantics. diff --git a/src/undo.C b/src/undo.C index 44524212f5..e62cb06524 100644 --- a/src/undo.C +++ b/src/undo.C @@ -184,9 +184,11 @@ bool performUndoOrRedo(BufferView * bv, Undo const & undo) // set cursor lyxerr << "undo, text: " << undo.text - << " inset: " << pit.inset() - << " index: " << undo.index - << std::endl; + << " inset: " << pit.inset() + << " index: " << undo.index + << " par: " << undo.cursor_par + << " pos: " << undo.cursor_pos + << std::endl; // set cursor again to force the position to be the right one text->cursor.par(undo.cursor_par); @@ -200,12 +202,8 @@ bool performUndoOrRedo(BufferView * bv, Undo const & undo) // rebreak the entire lyxtext bv->text->fullRebreak(); - InsetOld * inset = pit.inset(); - if (inset) { - // magic needed to cope with inset locking - bv->lockInset(dynamic_cast(inset)); - } - + pit.lockPath(bv); + finishUndo(); return true; }