From 8d31ce8bf475dc026d5d4639a1408dc05751e760 Mon Sep 17 00:00:00 2001 From: Michael Schmitt Date: Fri, 24 Nov 2006 21:22:57 +0000 Subject: [PATCH] * src/CutAndPaste.C: simplify code by making use of Paragraph::isMergedOnEndOfParDeletion() git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16030 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/CutAndPaste.C | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/CutAndPaste.C b/src/CutAndPaste.C index 0272f978b5..28f6061a3a 100644 --- a/src/CutAndPaste.C +++ b/src/CutAndPaste.C @@ -297,18 +297,11 @@ PitPosPair eraseSelectionHelper(BufferParams const & params, pos_type const left = (pit == startpit ? startpos : 0); pos_type const right = (pit == endpit ? endpos : pars[pit].size() + 1); + bool const merge = pars[pit].isMergedOnEndOfParDeletion(params.trackChanges); + // Logically erase only, including the end-of-paragraph character pars[pit].eraseChars(left, right, params.trackChanges); - // A paragraph break has to be physically removed by merging only - // if either (1) change tracking is off, or (2) the imaginary - // end-of-paragraph character is marked as inserted even after - // the erase operation (please see Paragraph::Pimpl::eraseChar(...) - // for details on end-of-par handling) - - bool const merge = !params.trackChanges || - pars[pit].isInserted(pars[pit].size()); - // Separate handling of paragraph break: if (merge && pit != endpit && (pit + 1 != endpit || pars[pit].hasSameLayout(pars[pit + 1]))) {