sw/source/core/doc/doccorr.cxx |    2 +-
 sw/source/core/doc/docedt.cxx  |    4 ++--
 sw/source/core/doc/docfld.cxx  |    3 +--
 3 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit b0cab944460816b96921bf4efd76e25d1cf75816
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sun Sep 25 18:23:19 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Sep 25 19:36:39 2022 +0200

    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.gran...@collabora.co.uk>

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
     {

Reply via email to