sw/source/core/doc/docnew.cxx  |    5 ++---
 sw/source/core/doc/docsort.cxx |   13 ++++++-------
 2 files changed, 8 insertions(+), 10 deletions(-)

New commits:
commit 18ea40107ae3b44b1fa5c3d44cb9d5cf1da7d80f
Author:     Noel Grandin <[email protected]>
AuthorDate: Sun Sep 4 14:21:57 2022 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Mon Sep 5 08:54:31 2022 +0200

    use more SwPosition::Assign
    
    part of hiding the internals of SwPosition
    
    Change-Id: Iaa316112fedfe3b28f1cd302917bb49a9f125282
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139360
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index c7469065143e..798a279b930a 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -1179,7 +1179,7 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, 
sal_uInt16 const nStartPageNu
         SwPosition& rInsPos = *aInsertPam.GetPoint();
 
         {
-            SwNodeIndex aIndexBefore(rInsPos.nNode);
+            SwNodeIndex aIndexBefore(rInsPos.GetNode());
 
             aIndexBefore--;
 #ifdef DBG_UTIL
@@ -1192,8 +1192,7 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, 
sal_uInt16 const nStartPageNu
 #endif
 
             ++aIndexBefore;
-            SwPaM aPaM(SwPosition(aIndexBefore),
-                       SwPosition(rInsPos.nNode));
+            SwPaM aPaM(aIndexBefore.GetNode(), rInsPos.GetNode());
 
             aPaM.GetDoc().MakeUniqueNumRules(aPaM);
 
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index 4ebabdc74821..3061f1b4ed56 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -322,7 +322,7 @@ bool SwDoc::SortText(const SwPaM& rPaM, const 
SwSortOptions& rOpt)
         pRedlPam = new SwPaM( pStart->GetNode(), pEnd->GetNode(), 
SwNodeOffset(-1), SwNodeOffset(1) );
         SwContentNode* pCNd = pRedlPam->GetMarkContentNode();
         if( pCNd )
-            pRedlPam->GetMark()->nContent = pCNd->Len();
+            pRedlPam->GetMark()->SetContent( pCNd->Len() );
 
         if( getIDocumentRedlineAccess().IsRedlineOn() && 
!IDocumentRedlineAccess::IsShowOriginal( 
getIDocumentRedlineAccess().GetRedlineFlags() ) )
         {
@@ -339,7 +339,7 @@ bool SwDoc::SortText(const SwPaM& rPaM, const 
SwSortOptions& rOpt)
             // range is new from pEnd->nNode+1 to aEndIdx
             getIDocumentRedlineAccess().DeleteRedline( *pRedlPam, true, 
RedlineType::Any );
 
-            pRedlPam->GetMark()->nNode.Assign( pEnd->GetNode(), 1 );
+            pRedlPam->GetMark()->Assign( pEnd->GetNode(), SwNodeOffset(1) );
 
             pRedlPam->GetPoint()->Assign( aEndIdx.GetNode() );
             pCNd = pRedlPam->GetPointContentNode();
@@ -353,7 +353,8 @@ bool SwDoc::SortText(const SwPaM& rPaM, const 
SwSortOptions& rOpt)
                     pRedlPam->GetPoint()->Assign( *pCNd );
                 }
             }
-            pRedlPam->GetPoint()->nContent.Assign( pCNd, nCLen );
+            if (pCNd)
+                pRedlPam->GetPoint()->SetContent( nCLen );
 
             if( pRedlUndo )
                 pRedlUndo->SetValues( rPaM );
@@ -440,10 +441,8 @@ bool SwDoc::SortText(const SwPaM& rPaM, const 
SwSortOptions& rOpt)
         if( pRedlUndo )
         {
             SwNodeIndex aInsEndIdx( pRedlPam->GetMark()->GetNode(), -1 );
-            pRedlPam->GetMark()->nNode = aInsEndIdx;
-            SwContentNode *const pPrevNode =
-                pRedlPam->GetMark()->GetNode().GetContentNode();
-            pRedlPam->GetMark()->nContent.Assign( pPrevNode, pPrevNode->Len() 
);
+            SwContentNode *const pContentNode = 
aInsEndIdx.GetNode().GetContentNode();
+            pRedlPam->GetMark()->Assign( *pContentNode, pContentNode->Len() );
 
             pRedlUndo->SetValues( *pRedlPam );
         }

Reply via email to