From 66d2b93f7c7544b8c7069ed4803e9a092b0c88be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Mon, 3 Oct 2005 09:50:28 +0000 Subject: [PATCH] fix bug 2058 (crash when undoing math matrix delete) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10510 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/ChangeLog | 5 +++++ src/mathed/math_nestinset.C | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 9d148cedd4..5df4fb4dc5 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,8 @@ +2005-10-03 Jürgen Spitzmüller + + * math_nestinset.C (doDispatch): use recordUndoInset when deleting whole + cell via LFUN_BACKSPACE (fixes bug 2058). + 2005-09-27 Jürgen Spitzmüller * math_nestinset.C (doDispatch): leave inset to the right when hitting ESC. diff --git a/src/mathed/math_nestinset.C b/src/mathed/math_nestinset.C index 3f1e5a808c..136d9529c2 100644 --- a/src/mathed/math_nestinset.C +++ b/src/mathed/math_nestinset.C @@ -614,7 +614,11 @@ void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd) case LFUN_DELETE_WORD_BACKWARD: case LFUN_BACKSPACE: - recordUndo(cur, Undo::ATOMIC); + if (cur.pos() == 0) + // delete whole cell + recordUndoInset(cur, Undo::ATOMIC); + else + recordUndo(cur, Undo::ATOMIC); cur.backspace(); break;