From 411ece27876dd1eff20e6bfa97835a805260160d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Fri, 19 Aug 2005 16:22:22 +0000 Subject: [PATCH] =?utf8?q?2005-08-19=20=20Lars=20Gullik=20Bj=EF=BF=BD?= =?utf8?q?=EF=BF=BD=EF=BF=BD=EF=BF=BDnnes=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * CutAndPaste.C (eraseSelectionHelper): fix bug 1920 use old deleteion algorithm when changetracking is on. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10400 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/CutAndPaste.C | 22 +++++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e93df99fb7..262e49ad74 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-08-19 Lars Gullik Bjønnes + + * CutAndPaste.C (eraseSelectionHelper): fix bug 1920 + use old deleteion algorithm when changetracking is on. 2005-08-18 Martin Vermeer diff --git a/src/CutAndPaste.C b/src/CutAndPaste.C index d839dea055..8483d004d0 100644 --- a/src/CutAndPaste.C +++ b/src/CutAndPaste.C @@ -278,9 +278,25 @@ PitPosPair eraseSelectionHelper(BufferParams const & params, all_erased = false; // Erase all the "middle" paragraphs. - pars.erase(pars.begin() + startpit + 1, pars.begin() + endpit); - endpit = startpit + 1; - + if (params.tracking_changes) { + // Look through the deleted pars if any, erasing as needed + for (pit_type pit = startpit + 1; pit != endpit;) { + // "erase" the contents of the par + pars[pit].erase(0, pars[pit].size()); + if (pars[pit].empty()) { + // remove the par if it's now empty + pars.erase(pars.begin() + pit); + --endpit; + } else { + ++pit; + all_erased = false; + } + } + } else { + pars.erase(pars.begin() + startpit + 1, pars.begin() + endpit); + endpit = startpit + 1; + } + #if 0 // FIXME: why for cut but not copy ? // the cut selection should begin with standard layout if (realcut) { -- 2.39.2