From 605912d57599f35065bab27ad3ab4d0b2d3653b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Wed, 30 Apr 2003 07:04:33 +0000 Subject: [PATCH] fix Undo as suggested by Alfredo git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6895 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/undo_funcs.C | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 598c6e62a1..d884f4a6a4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ + +2003-04-30 André Pönitz + + * undo_func.C: revert part of yesterday's patch 2 + 2003-04-30 John Levon * LColor.C: s/tabular/table/ diff --git a/src/undo_funcs.C b/src/undo_funcs.C index 0e7b3a1a61..d0d9571881 100644 --- a/src/undo_funcs.C +++ b/src/undo_funcs.C @@ -321,11 +321,18 @@ bool createUndo(BufferView * bv, Undo::undo_kind kind, } // create a new Undo - Paragraph * undopar = 0; // nothing to replace yet (undo of delete maybe) + Paragraph * undopar = 0; // nothing to replace (undo of delete maybe) Paragraph * start = first; - Paragraph * end = &*boost::prior(itbehind); + Paragraph * end = 0; + if (behind) + end = const_cast(behind->previous()); + else { + end = start; + while (end->next()) + end = end->next(); + } if (start && end && (start != end->next()) && ((before_number != behind_number) || ((before_number < 0) && (behind_number < 0)))) -- 2.39.2