sw/source/core/docnode/ndsect.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
New commits: commit c1cf478e77db23f688d697112ea31c6d470b2539 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Sep 29 14:16:44 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Sep 29 17:46:42 2022 +0200 use more SwPosition::SetContent part of the process of hiding the internals of SwPosition Change-Id: Ib643b5ea126ada9edb7c2ec07ea3536fc93d36d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140738 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 34492a2f5a71..bae8f8a367ef 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -275,19 +275,19 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, SwTextNode* pTNd; if( pEndPos->GetNodeIndex() == pSttPos->GetNodeIndex() ) { - --pSttPos->nNode; - --pEndPos->nNode; + pSttPos->Adjust(SwNodeOffset(-1)); + pEndPos->Adjust(SwNodeOffset(-1)); pTNd = pSttPos->GetNode().GetTextNode(); - pSttPos->nContent.Assign( pTNd, nContent ); + pSttPos->SetContent( nContent ); } else { // Set to the end of the previous - --pEndPos->nNode; + pEndPos->Adjust(SwNodeOffset(-1)); pTNd = pEndPos->GetNode().GetTextNode(); } nContent = pTNd ? pTNd->GetText().getLength() : 0; - pEndPos->nContent.Assign( pTNd, nContent ); + pEndPos->SetContent( nContent ); } } pNewSectNode = GetNodes().InsertTextSection(