tdf#126340 sw_redlinehide: only move merged frames in JoinPrev
The problem was that the first and second node were not actually merged
by a redline, so moving the frames doesn't make sense.
(regression from 41d8ca9686c7c184f586e99674b443c34bfd4f33)
Change-Id: Ib401e4b0b2b207666f65c038ab5c346807bfea92
Reviewed-on: https://gerrit.libreoffice.org/76125
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 1388bdc..fad87ae 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -465,7 +465,8 @@ bool sw_JoinText( SwPaM& rPam, bool bJoinPrev )
}
// delete the Node, at last!
SwNode::Merge const eOldMergeFlag(pOldTextNd->GetRedlineMergeFlag());
if (eOldMergeFlag == SwNode::Merge::First)
if (eOldMergeFlag == SwNode::Merge::First
&& !pTextNd->IsCreateFrameWhenHidingRedlines())
{
sw::MoveDeletedPrevFrames(*pOldTextNd, *pTextNd);
}
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 691c20f..cced718 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1126,7 +1126,8 @@ void SwTextNode::JoinPrev()
pDoc->CorrAbs( aIdx, SwPosition( *this ), nLen, true );
}
SwNode::Merge const eOldMergeFlag(pTextNode->GetRedlineMergeFlag());
if (eOldMergeFlag == SwNode::Merge::First)
if (eOldMergeFlag == SwNode::Merge::First
&& !IsCreateFrameWhenHidingRedlines())
{
sw::MoveDeletedPrevFrames(*pTextNode, *this);
}