summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/docnum.cxx
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2021-01-06 18:10:39 +0100
committerLászló Németh <nemeth@numbertext.org>2021-01-14 18:18:36 +0100
commitb5ab4836c03e9428aff6a48843f2a054ceff0f85 (patch)
tree741f746cd0ba43445b0a69ced373dbea9169a36e /sw/source/core/doc/docnum.cxx
parent5eda63e85cf400b4f85c69777b1607ad6d657e3e (diff)
tdf#39721 sw change tracking: fix move down
When moving list items by Move Down (see Bullets and Numbering toolbar) to a non-content node (e.g. tables, images or end of the document), tracked deletions of the inserted paragraphs reappeared as non-deleted text. Note: disable unit test on Windows because of a not reproducable problem of the Jenkins build (moreover, reverting the patch, and modifying the unit test according to the revert has still resulted the same problem on the Windows test machine). Change-Id: I3fb49061a81f832e1070da0f78cf7c5b3bd7d2c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108888 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/core/doc/docnum.cxx')
-rw-r--r--sw/source/core/doc/docnum.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 194ba1e2450e..b0bffd31c205 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -2141,6 +2141,7 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, tools::Long const nOffset,
rOrigPam.GetPoint()->nContent.Assign( rOrigPam.GetContentNode(), 0 );
bool bDelLastPara = !aInsPos.nNode.GetNode().IsContentNode();
+ sal_uLong nOrigIdx = aIdx.GetIndex();
/* When copying to a non-content node Copy will
insert a paragraph before that node and insert before
@@ -2195,7 +2196,7 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, tools::Long const nOffset,
{
SwPaM pam(*pRedline, nullptr);
sal_uLong const nCurrentOffset(
- aIdx.GetIndex() + 1 - aPam.Start()->nNode.GetIndex());
+ nOrigIdx - aPam.Start()->nNode.GetIndex());
pam.GetPoint()->nNode += nCurrentOffset;
pam.GetPoint()->nContent.Assign(pam.GetPoint()->nNode.GetNode().GetContentNode(), pam.GetPoint()->nContent.GetIndex());
pam.GetMark()->nNode += nCurrentOffset;