sw/source/core/doc/docnum.cxx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
New commits: commit 850e8823cd20476f66810c8ca5fa4c65212b8648 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Fri Oct 7 08:56:15 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Oct 7 12:01:41 2022 +0200 use more SwPosition::Adjust part of the process of hiding the internals of SwPosition Change-Id: I77cae5313f00b283e7bb5e4f23323473fa57f252 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141042 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 68788fae1484..8324015cf7ae 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -2206,7 +2206,7 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset const nOffset, if( bDelLastPara ) { // We need to remove the last empty Node again - aIdx = aInsPos.nNode; + aIdx = aInsPos.GetNode(); SwContentNode* pCNd = SwNodes::GoPrevious( &aInsPos ); if (pCNd) aInsPos.AssignEndIndex( *pCNd ); @@ -2236,10 +2236,10 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset const nOffset, assert(*aPam.GetMark() < *aPam.GetPoint()); if (aPam.GetPoint()->GetNode().IsEndNode()) { // ensure redline ends on content node - --aPam.GetPoint()->nNode; + aPam.GetPoint()->Adjust(SwNodeOffset(-1)); assert(aPam.GetPoint()->GetNode().IsTextNode()); SwTextNode *const pNode(aPam.GetPoint()->GetNode().GetTextNode()); - aPam.GetPoint()->nContent.Assign(pNode, pNode->Len()); + aPam.GetPoint()->SetContent(pNode->Len()); } RedlineFlags eOld = getIDocumentRedlineAccess().GetRedlineFlags(); @@ -2287,10 +2287,7 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset const nOffset, --aIdx2; SwTextNode const*const pEmptyNode(aIdx2.GetNode().GetTextNode()); if ( pEmptyNode && pEmptyNode->Len() == 0 ) - { - --(pRPos->nNode); - pRPos->nContent.Assign( aIdx2.GetNode().GetContentNode(), 0 ); - } + pRPos->Adjust(SwNodeOffset(-1)); } else if ( pEmptyNode0 && pEmptyNode0->Len() == 0 ) { @@ -2298,10 +2295,7 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset const nOffset, ++aIdx2; SwTextNode const*const pEmptyNode(aIdx2.GetNode().GetTextNode()); if (pEmptyNode) - { - ++(pRPos->nNode); - pRPos->nContent.Assign( aIdx2.GetNode().GetContentNode(), 0 ); - } + pRPos->Adjust(SwNodeOffset(+1)); } // sort redlines, when the trimmed range results bad redline order