diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-09-25 18:23:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-25 19:36:39 +0200 |
commit | b0cab944460816b96921bf4efd76e25d1cf75816 (patch) | |
tree | 498d56370ce43ca2e8f6869e770630449f1881f8 | |
parent | 16429ec437f4bf2acf33b4b2d968b45548f779b4 (diff) |
use more SwPosition::SetContent
part of the process of hiding the internals of SwPosition
Change-Id: I466640e5cf7aac57b0248e9a5069e75ccd7e779a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140572
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sw/source/core/doc/doccorr.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docedt.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/docfld.cxx | 3 |
3 files changed, 4 insertions, 5 deletions
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx index b4167611f8e9..a98fedb58708 100644 --- a/sw/source/core/doc/doccorr.cxx +++ b/sw/source/core/doc/doccorr.cxx @@ -176,7 +176,7 @@ void SwDoc::CorrAbs(const SwNode& rOldNode, SwPaM const aPam(rOldNode, 0, rOldNode, pContentNode ? pContentNode->Len() : 0); SwPosition aNewPos(rNewPos); - aNewPos.nContent += nOffset; + aNewPos.AdjustContent(nOffset); getIDocumentMarkAccess()->correctMarksAbsolute(rOldNode, rNewPos, nOffset); // fix redlines diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 56eb5a6065aa..daf3a00d83dd 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -84,9 +84,9 @@ void RestFlyInRange( SaveFlyArr & rArr, const SwPosition& rStartPos, } else { - aPos.nNode = rStartPos.GetNodeIndex() + rSave.nNdDiff; + aPos.Assign(rStartPos.GetNodeIndex() + rSave.nNdDiff); assert(aPos.GetNode().GetContentNode()); - aPos.nContent.Assign(aPos.GetNode().GetContentNode(), + aPos.SetContent( rSave.nNdDiff == SwNodeOffset(0) ? rStartPos.GetContentIndex() + rSave.nContentIndex : rSave.nContentIndex); diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index f6f9cc210824..03afc4668401 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -193,8 +193,7 @@ void SetGetExpField::GetPosOfContent( SwPosition& rPos ) const if( pNd ) { - rPos.nNode = *pNd; - rPos.nContent.Assign( static_cast<const SwContentNode*>(pNd), GetCntPosFromContent() ); + rPos.Assign( *static_cast<const SwContentNode*>(pNd), GetCntPosFromContent() ); } else { |