sw/inc/pam.hxx                                          |    3 +
 sw/source/core/crsr/crsrsh.cxx                          |    6 --
 sw/source/core/crsr/crstrvl.cxx                         |   21 +++------
 sw/source/core/crsr/pam.cxx                             |   11 ++++
 sw/source/core/crsr/swcrsr.cxx                          |    9 +--
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   13 ++---
 sw/source/core/doc/DocumentRedlineManager.cxx           |    6 --
 sw/source/core/doc/docbm.cxx                            |    1 
 sw/source/core/doc/doccomp.cxx                          |    6 --
 sw/source/core/doc/docedt.cxx                           |    6 --
 sw/source/core/doc/docglbl.cxx                          |    2 
 sw/source/core/doc/doclay.cxx                           |    2 
 sw/source/core/doc/docnum.cxx                           |   37 +++++-----------
 sw/source/core/doc/docsort.cxx                          |    4 -
 sw/source/core/doc/notxtfrm.cxx                         |    4 -
 sw/source/core/docnode/ndsect.cxx                       |    2 
 sw/source/core/docnode/nodes.cxx                        |    3 -
 sw/source/core/edit/autofmt.cxx                         |    9 +--
 sw/source/core/edit/ednumber.cxx                        |    6 --
 sw/source/core/frmedt/feshview.cxx                      |    6 --
 sw/source/core/frmedt/fetab.cxx                         |    3 -
 sw/source/core/layout/flycnt.cxx                        |    3 -
 sw/source/core/text/txtfrm.cxx                          |    5 --
 sw/source/core/undo/undobj.cxx                          |    3 -
 sw/source/core/undo/unmove.cxx                          |    3 -
 sw/source/core/undo/untbl.cxx                           |   26 +----------
 sw/source/core/unocore/unoobj2.cxx                      |    3 -
 sw/source/filter/html/htmltab.cxx                       |    4 -
 sw/source/filter/ww8/writerhelper.cxx                   |    6 --
 sw/source/filter/ww8/ww8par.cxx                         |   10 +---
 sw/source/filter/ww8/ww8par5.cxx                        |    3 -
 sw/source/filter/ww8/ww8par6.cxx                        |    3 -
 sw/source/filter/xml/XMLRedlineImportHelper.cxx         |    4 -
 sw/source/filter/xml/xmltbli.cxx                        |    1 
 34 files changed, 75 insertions(+), 159 deletions(-)

New commits:
commit 9b58abd841d5fbca5ed9f4423d3f137b412ff761
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Aug 3 09:36:34 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Aug 4 10:40:35 2022 +0200

    add more SwPosition::Assign
    
    These are just the "obviously correct" places where we
    can use SwPosition::Assign, i.e. the places where we
    are already correctly setting both nNode and nContent
    in SwPosition.
    
    Change-Id: I27078c91e491c9162770ce729364197056d62cb6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137775
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx
index a0b7124d58dd..735b9882654d 100644
--- a/sw/inc/pam.hxx
+++ b/sw/inc/pam.hxx
@@ -86,6 +86,9 @@ struct SAL_WARN_UNUSED SW_DLLPUBLIC SwPosition
     void Assign( const SwNode& rNd, SwNodeOffset nDelta, sal_Int32 
nContentOffset = 0 );
     void Assign( SwNodeOffset nNodeOffset, sal_Int32 nContentOffset = 0 );
     void Assign( const SwNode& rNd );
+    void Assign( const SwNodeIndex& rNdIdx );
+    /// Adjust node position, and resets content position to zero
+    void Adjust( SwNodeOffset nDelta );
 };
 
 SW_DLLPUBLIC std::ostream &operator <<(std::ostream& s, const SwPosition& 
position);
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index e415a6c7fdc3..8097ca0823b1 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -2855,8 +2855,7 @@ void SwCursorShell::ParkPams( SwPaM* pDelRg, 
SwShellCursor** ppDelRing )
             }
             else
             {
-                pTmpDel->GetPoint()->nContent.Assign(nullptr, 0);
-                pTmpDel->GetPoint()->nNode = SwNodeOffset(0);
+                pTmpDel->GetPoint()->Assign(SwNodeOffset(0));
                 pTmpDel->DeleteMark();
             }
             pTmpDel = nullptr;
@@ -2917,8 +2916,7 @@ void SwCursorShell::ParkCursor( const SwNodeIndex &rIdx )
                 SwNode* pTableNd = 
pTCursor->GetPoint()->GetNode().FindTableNode();
                 if ( pTableNd )
                 {
-                    pTCursor->GetPoint()->nContent.Assign(nullptr, 0);
-                    pTCursor->GetPoint()->nNode = SwNodeOffset(0);
+                    pTCursor->GetPoint()->Assign(SwNodeOffset(0));
                     pTCursor->DeleteMark();
                     pSh->m_pCurrentCursor->GetPoint()->nNode = *pTableNd;
                 }
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index d3ffee6f4913..451a5913fe62 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -251,8 +251,7 @@ bool SwCursorShell::SetCursorInHdFt( size_t nDescNo, bool 
bInHeader )
                 ClearMark();
 
                 SwPosition& rPos = *m_pCurrentCursor->GetPoint();
-                rPos.nNode = *pCNd;
-                rPos.nContent.Assign( pCNd, 0 );
+                rPos.Assign( *pCNd );
 
                 bRet = !m_pCurrentCursor->IsSelOvr();
                 if( bRet )
@@ -306,8 +305,7 @@ bool SwCursorShell::GotoNextTOXBase( const OUString* pName )
     {
         SwCallLink aLk( *this ); // watch Cursor-Moves
         SwCursorSaveState aSaveState( *m_pCurrentCursor );
-        m_pCurrentCursor->GetPoint()->nNode = *pFnd;
-        m_pCurrentCursor->GetPoint()->nContent.Assign( pFnd, 0 );
+        m_pCurrentCursor->GetPoint()->Assign( *pFnd );
         bRet = !m_pCurrentCursor->IsSelOvr();
         if( bRet )
             
UpdateCursor(SwCursorShell::SCROLLWIN|SwCursorShell::CHKRANGE|SwCursorShell::READONLY);
@@ -358,8 +356,7 @@ bool SwCursorShell::GotoPrevTOXBase( const OUString* pName )
     {
         SwCallLink aLk( *this ); // watch Cursor-Moves
         SwCursorSaveState aSaveState( *m_pCurrentCursor );
-        m_pCurrentCursor->GetPoint()->nNode = *pFnd;
-        m_pCurrentCursor->GetPoint()->nContent.Assign( pFnd, 0 );
+        m_pCurrentCursor->GetPoint()->Assign(*pFnd);
         bRet = !m_pCurrentCursor->IsSelOvr();
         if( bRet )
             
UpdateCursor(SwCursorShell::SCROLLWIN|SwCursorShell::CHKRANGE|SwCursorShell::READONLY);
@@ -1065,8 +1062,7 @@ void SwCursorShell::GotoOutline( 
SwOutlineNodes::size_type nIdx )
 
     const SwNodes& rNds = GetDoc()->GetNodes();
     SwTextNode* pTextNd = rNds.GetOutLineNds()[ nIdx ]->GetTextNode();
-    pCursor->GetPoint()->nNode = *pTextNd;
-    pCursor->GetPoint()->nContent.Assign( pTextNd, 0 );
+    pCursor->GetPoint()->Assign(*pTextNd);
 
     if( !pCursor->IsSelOvr() )
         
UpdateCursor(SwCursorShell::SCROLLWIN|SwCursorShell::CHKRANGE|SwCursorShell::READONLY);
@@ -1147,8 +1143,7 @@ bool SwCursorShell::GotoNextOutline()
     CurrShell aCurr( this );
     SwCallLink aLk( *this ); // watch Cursor-Moves
     SwCursorSaveState aSaveState( *pCursor );
-    pCursor->GetPoint()->nNode = *pNd;
-    pCursor->GetPoint()->nContent.Assign( pNd->GetTextNode(), 0 );
+    pCursor->GetPoint()->Assign(*pNd);
 
     bool bRet = !pCursor->IsSelOvr();
     if( bRet )
@@ -1207,8 +1202,7 @@ bool SwCursorShell::GotoPrevOutline()
         CurrShell aCurr( this );
         SwCallLink aLk( *this ); // watch Cursor-Moves
         SwCursorSaveState aSaveState( *pCursor );
-        pCursor->GetPoint()->nNode = *pNd;
-        pCursor->GetPoint()->nContent.Assign( pNd->GetTextNode(), 0 );
+        pCursor->GetPoint()->Assign(*pNd);
 
         bRet = !pCursor->IsSelOvr();
         if( bRet )
@@ -1295,8 +1289,7 @@ void 
SwCursorShell::MakeOutlineSel(SwOutlineNodes::size_type nSttPos, SwOutlineN
     SwCursorSaveState aSaveState( *m_pCurrentCursor );
 
     // set end to the end of the previous content node
-    m_pCurrentCursor->GetPoint()->nNode = *pSttNd;
-    m_pCurrentCursor->GetPoint()->nContent.Assign( pSttNd->GetContentNode(), 0 
);
+    m_pCurrentCursor->GetPoint()->Assign(*pSttNd);
     m_pCurrentCursor->SetMark();
     m_pCurrentCursor->GetPoint()->nNode = *pEndNd;
     m_pCurrentCursor->Move( fnMoveBackward, GoInNode ); // end of predecessor
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 99d53c2e72b3..64c8a5ddd3a2 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -224,6 +224,17 @@ void SwPosition::Assign( const SwNode& rNd )
     nNode.Assign(rNd);
     nContent.Assign(rNd.GetContentNode(), 0);
 }
+void SwPosition::Assign( const SwNodeIndex& rNdIdx )
+{
+    nNode = rNdIdx;
+    nContent.Assign(nNode.GetNode().GetContentNode(), 0);
+}
+void SwPosition::Adjust( SwNodeOffset nDelta )
+{
+    nNode += nDelta;
+    nContent.Assign(nNode.GetNode().GetContentNode(), 0);
+}
+
 
 std::ostream &operator <<(std::ostream& s, const SwPosition& position)
 {
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index b4b360113481..ff0aefe52708 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -2498,8 +2498,7 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* 
pCurrentCursor )
             SwPaM *const pNew = (!pCurrentCursor->IsMultiSelection() && 
!pCurrentCursor->HasMark())
                 ? pCurrentCursor
                 : pCurrentCursor->Create( pCurrentCursor );
-            pNew->GetPoint()->nNode = *pNd;
-            pNew->GetPoint()->nContent.Assign( 
static_cast<SwContentNode*>(pNd), 0 );
+            pNew->GetPoint()->Assign( *pNd );
             pNew->SetMark();
 
             SwPosition* pPos = pNew->GetPoint();
@@ -2602,14 +2601,12 @@ void SwTableCursor::ParkCursor()
     SwNode* pNd = &GetPoint()->GetNode();
     if( !pNd->IsStartNode() )
         pNd = pNd->StartOfSectionNode();
-    GetPoint()->nNode = *pNd;
-    GetPoint()->nContent.Assign( nullptr, 0 );
+    GetPoint()->Assign(*pNd);
 
     pNd = &GetMark()->GetNode();
     if( !pNd->IsStartNode() )
         pNd = pNd->StartOfSectionNode();
-    GetMark()->nNode = *pNd;
-    GetMark()->nContent.Assign( nullptr, 0 );
+    GetMark()->Assign(*pNd);
 
     m_bChanged = true;
     m_bParked = true;
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 6dfb312fefa9..e68ad2ea7731 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -876,8 +876,8 @@ namespace
     {
         SwDoc& rDoc = rRg.aStart.GetNode().GetDoc();
         SwRedlineTable::size_type nRedlPos;
-        SwPosition aSrchPos( rRg.aStart ); aSrchPos.nNode--;
-        aSrchPos.nContent.Assign( aSrchPos.GetNode().GetContentNode(), 0 );
+        SwPosition aSrchPos( rRg.aStart );
+        aSrchPos.Adjust(SwNodeOffset(-1));
         if( rDoc.getIDocumentRedlineAccess().GetRedline( aSrchPos, &nRedlPos ) 
&& nRedlPos )
             --nRedlPos;
         else if( nRedlPos >= 
rDoc.getIDocumentRedlineAccess().GetRedlineTable().size() )
@@ -2468,8 +2468,7 @@ bool DocumentContentOperationsManager::MoveRange( SwPaM& 
rPaM, SwPosition& rPos,
     const bool bNullContent = !bSplit && aSavePam.GetPoint()->nContent == 0;
     if( bNullContent )
     {
-        aSavePam.GetPoint()->nNode--;
-        aSavePam.GetPoint()->nContent.Assign(aSavePam.GetContentNode(), 0);
+        aSavePam.GetPoint()->Adjust(SwNodeOffset(-1));
     }
     else
     {
@@ -2526,8 +2525,7 @@ bool DocumentContentOperationsManager::MoveRange( SwPaM& 
rPaM, SwPosition& rPos,
     }
     if (bNullContent)
     {
-        aSavePam.GetPoint()->nNode++;
-        aSavePam.GetPoint()->nContent.Assign( aSavePam.GetContentNode(), 0 );
+        aSavePam.GetPoint()->Adjust(SwNodeOffset(1));
     }
     else if (bRemove) // No move forward after joining with next paragraph
     {
@@ -5215,8 +5213,7 @@ bool 
DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo
                 pEnd->nContent = 0; // TODO why this?
                 CopyWithFlyInFly(aRg, aInsPos, &tmp, /*bMakeNewFrames*/true, 
false, /*bCopyFlyAtFly=*/false, flags);
                 ++aSaveIdx;
-                pEnd->nNode = aSaveIdx;
-                pEnd->nContent.Assign( aSaveIdx.GetNode().GetTextNode(), 0 );
+                pEnd->Assign(aSaveIdx);
             }
             else
                 CopyWithFlyInFly(aRg, aInsPos, &tmp, /*bMakeNewFrames*/true, 
false, /*bCopyFlyAtFly=*/false, flags);
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index ce9ff1be6d04..490b2bc00953 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -178,8 +178,7 @@ void UpdateFramesForAddDeleteRedline(SwDoc & rDoc, SwPaM 
const& rPam)
                 }
             }
         }
-        currentStart.nNode = pTableOrSectionNode->EndOfSectionIndex() + 1;
-        currentStart.nContent.Assign(currentStart.GetNode().GetContentNode(), 
0);
+        currentStart.Assign( pTableOrSectionNode->EndOfSectionIndex() + 1 );
         pStartNode = currentStart.GetNode().GetTextNode();
     }
     if (currentStart < *rPam.End())
@@ -281,8 +280,7 @@ void UpdateFramesForRemoveDeleteRedline(SwDoc & rDoc, SwPaM 
const& rPam)
             ::MakeFrames(&rDoc, currentStart.nNode, end);
             isAppendObjsCalled = true;
         }
-        currentStart.nNode = pTableOrSectionNode->EndOfSectionIndex() + 1;
-        currentStart.nContent.Assign(currentStart.GetNode().GetContentNode(), 
0);
+        currentStart.Assign( pTableOrSectionNode->EndOfSectionIndex() + 1 );
         pStartNode = currentStart.GetNode().GetTextNode();
     }
     if (currentStart < *rPam.End())
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 83cf9410c6e4..4102c97aa25c 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -805,7 +805,6 @@ namespace sw::mark
         const IDocumentMarkAccess::MarkType eType )
     {
         SwPosition aPos(rTextNode);
-        aPos.nContent.Assign(&const_cast<SwTextNode&>(rTextNode), 0);
         auto const ppExistingMark = lcl_FindMarkAtPos(m_vBookmarks, aPos, 
eType);
         if(ppExistingMark != m_vBookmarks.end())
             return *ppExistingMark;
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 05d4fc7d580c..1d236a6aba7d 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1665,8 +1665,7 @@ void CompareData::SetRedlinesToDoc( bool bUseDocInfo )
             // #i65201#: Expand again, see comment above.
             if( pTmp->GetPoint()->nContent == 0 )
             {
-                ++pTmp->GetPoint()->nNode;
-                pTmp->GetPoint()->nContent.Assign( pTmp->GetContentNode(), 0 );
+                pTmp->GetPoint()->Adjust(SwNodeOffset(1));
             }
             // #i101009#
             // prevent redlines that end on structural end node
@@ -1709,8 +1708,7 @@ void CompareData::SetRedlinesToDoc( bool bUseDocInfo )
     do {
         if( pTmp->GetPoint()->nContent == 0 )
         {
-            ++pTmp->GetPoint()->nNode;
-            pTmp->GetPoint()->nContent.Assign( pTmp->GetContentNode(), 0 );
+            pTmp->GetPoint()->Adjust(SwNodeOffset(1));
         }
         // #i101009#
         // prevent redlines that end on structural end node
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 3273cabe3332..48608b9b2dce 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -79,9 +79,8 @@ void RestFlyInRange( SaveFlyArr & rArr, const SwPosition& 
rStartPos,
             }
             else
             {
-                aPos.nNode = rStartPos.nNode;
+                aPos.Assign(rStartPos.nNode);
                 assert(aPos.GetNode().GetContentNode());
-                aPos.nContent.Assign(aPos.GetNode().GetContentNode(), 0);
             }
         }
         else
@@ -150,8 +149,7 @@ void SaveFlyInRange( const SwPaM& rPam, const SwPosition& 
rInsPos,
     {
         assert(!rPam.End()->GetNode().IsTextNode() // can be table end-node
             || rPam.End()->GetContentIndex() == 
rPam.End()->GetNode().GetTextNode()->Len());
-        ++atParaEnd.nNode;
-        atParaEnd.nContent.Assign(atParaEnd.GetNode().GetContentNode(), 0);
+        atParaEnd.Adjust(SwNodeOffset(1));
     }
 
     for( SwFrameFormats::size_type n = 0; n < rFormats.size(); ++n )
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index 3f5546f9fe94..29ed06b4cd60 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -353,8 +353,6 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& 
rPath, bool bOutline,
                         if( nNodeDiff )
                         {
                             SwPaM aTmp( *pStartNd, aEndIdx.GetNode(), 
SwNodeOffset(1), SwNodeOffset(-1) );
-                            aTmp.GetPoint()->nContent.Assign( nullptr, 0 );
-                            aTmp.GetMark()->nContent.Assign( nullptr, 0 );
                             SwNodeIndex aSIdx( aTmp.GetMark()->nNode );
                             SwNodeIndex aEIdx( aTmp.GetPoint()->nNode );
 
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index ca49fdc781b5..24b2ea408c2e 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -357,12 +357,10 @@ SwFlyFrameFormat* SwDoc::MakeFlyAndMove( const SwPaM& 
rPam, const SfxItemSet& rS
             const SwFormatContent &rContent = pFormat->GetContent();
             OSL_ENSURE( rContent.GetContentIdx(), "No content prepared." );
             SwNodeIndex aIndex( *(rContent.GetContentIdx()), 1 );
-            SwContentNode *pNode = aIndex.GetNode().GetContentNode();
 
             // Attention: Do not create an index on the stack, or we
             // cannot delete ContentNode in the end!
             SwPosition aPos( aIndex );
-            aPos.nContent.Assign( pNode, 0 );
 
             if( pSelBoxes && !pSelBoxes->empty() )
             {
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 9fff2306da69..1a18daa44fda 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -90,13 +90,11 @@ namespace {
         // to which the attributes should be applied
         if (rPam.GetPoint()->GetNode().IsTextNode())
         {
-            rPam.GetPoint()->nNode = *sw::GetParaPropsNode(*pLayout, 
rPam.GetPoint()->nNode);
-            
rPam.GetPoint()->nContent.Assign(rPam.GetPoint()->GetNode().GetContentNode(), 
0);
+            rPam.GetPoint()->Assign( *sw::GetParaPropsNode(*pLayout, 
rPam.GetPoint()->nNode) );
         }
         if (rPam.GetMark()->GetNode().IsTextNode())
         {
-            rPam.GetMark()->nNode = *sw::GetParaPropsNode(*pLayout, 
rPam.GetMark()->nNode);
-            
rPam.GetMark()->nContent.Assign(rPam.GetMark()->GetNode().GetContentNode(), 0);
+            rPam.GetMark()->Assign( *sw::GetParaPropsNode(*pLayout, 
rPam.GetMark()->nNode) );
         }
     }
 }
@@ -771,16 +769,14 @@ bool SwDoc::GotoOutline(SwPosition& rPos, const OUString& 
rName, SwRootFrame con
                     pNd = pTmpNd;
                 }
             }
-            rPos.nNode = *pNd;
-            rPos.nContent.Assign( pNd, 0 );
+            rPos.Assign(*pNd);
             return true;
         }
 
         pNd = ::lcl_FindOutlineName(rOutlNds, pLayout, rName, false);
         if ( pNd )
         {
-            rPos.nNode = *pNd;
-            rPos.nContent.Assign( pNd, 0 );
+            rPos.Assign(*pNd);
             return true;
         }
 
@@ -790,8 +786,7 @@ bool SwDoc::GotoOutline(SwPosition& rPos, const OUString& 
rName, SwRootFrame con
             pNd = ::lcl_FindOutlineName(rOutlNds, pLayout, sName, false);
             if ( pNd )
             {
-                rPos.nNode = *pNd;
-                rPos.nContent.Assign( pNd, 0 );
+                rPos.Assign(*pNd);
                 return true;
             }
         }
@@ -1855,8 +1850,7 @@ bool SwDoc::MoveParagraph(SwPaM& rPam, SwNodeOffset 
nOffset, bool const bIsOutlM
                 rPam.SetMark();
             }
             assert(nodes.first->GetIndex() < rPam.Start()->GetNodeIndex());
-            rPam.Start()->nNode = *nodes.first;
-            rPam.Start()->nContent.Assign(nodes.first, 0);
+            rPam.Start()->Assign(*nodes.first);
         }
         nodes = sw::GetFirstAndLastNode(*pLayout, rPam.End()->nNode);
         if (nodes.second && nodes.second != &rPam.End()->GetNode())
@@ -2135,14 +2129,12 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset 
const nOffset,
 
             // First the Insert, then the Delete
             SwPosition aInsPos( aIdx );
-            aInsPos.nContent.Assign( aIdx.GetNode().GetContentNode(), 0 );
 
             SwPaM aPam( pStt->nNode, 0, aMvRg.aEnd, 0 );
 
             SwPaM& rOrigPam(rPam);
             rOrigPam.DeleteMark();
-            rOrigPam.GetPoint()->nNode = aIdx.GetIndex() - 1;
-            rOrigPam.GetPoint()->nContent.Assign( rOrigPam.GetContentNode(), 0 
);
+            rOrigPam.GetPoint()->Assign(aIdx.GetIndex() - 1);
 
             bool bDelLastPara = !aInsPos.GetNode().IsContentNode();
             SwNodeOffset nOrigIdx = aIdx.GetIndex();
@@ -2236,14 +2228,12 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset 
const nOffset,
                     SwPosition* pPos = &pTmp->GetBound();
                     if( pPos->nNode == aIdx )
                     {
-                        ++pPos->nNode;
-                        pPos->nContent.Assign( 
pPos->GetNode().GetContentNode(),0);
+                        pPos->Adjust(SwNodeOffset(1));
                     }
                     pPos = &pTmp->GetBound(false);
                     if( pPos->nNode == aIdx )
                     {
-                        ++pPos->nNode;
-                        pPos->nContent.Assign( 
pPos->GetNode().GetContentNode(),0);
+                        pPos->Adjust(SwNodeOffset(1));
                     }
                 }
                 CorrRel( aIdx, aInsPos );
@@ -2252,8 +2242,7 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset 
const nOffset,
                     pCNd->JoinNext();
             }
 
-            ++rOrigPam.GetPoint()->nNode;
-            rOrigPam.GetPoint()->nContent.Assign( rOrigPam.GetContentNode(), 0 
);
+            rOrigPam.GetPoint()->Adjust(SwNodeOffset(1));
             assert(*aPam.GetMark() < *aPam.GetPoint());
             if (aPam.GetPoint()->GetNode().IsEndNode())
             {   // ensure redline ends on content node
@@ -2387,8 +2376,7 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset 
const nOffset,
         auto [pRStt, pREnd] = pOwnRedl->StartEnd(); // SwPosition*
         if( pRStt->GetNodeIndex() != nRedlSttNd )
         {
-            pRStt->nNode = nRedlSttNd;
-            pRStt->nContent.Assign( pRStt->GetNode().GetContentNode(),0);
+            pRStt->Assign(nRedlSttNd);
         }
         if( pREnd->GetNodeIndex() != nRedlEndNd )
         {
@@ -2451,8 +2439,7 @@ SwNumRule* SwDoc::GetNumRuleAtPos(SwPosition& rPos,
         if (pLayout && !sw::IsParaPropsNode(*pLayout, *pTNd))
         {
             pTNd = 
static_cast<SwTextFrame*>(pTNd->getLayoutFrame(pLayout))->GetMergedPara()->pParaPropsNode;
-            rPos.nNode = *pTNd;
-            rPos.nContent.Assign(pTNd, 0);
+            rPos.Assign(*pTNd);
         }
         pRet = pTNd->GetNumRule();
     }
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index bf3d0353df41..dfbf338ddb23 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -430,9 +430,7 @@ bool SwDoc::SortText(const SwPaM& rPaM, const 
SwSortOptions& rOpt)
 
         // pRedlPam points to nodes that may be deleted (hidden) by
         // AppendRedline, so adjust it beforehand to prevent ASSERT
-        pRedlPam->GetPoint()->nNode = aSttIdx;
-        SwContentNode* pCNd = aSttIdx.GetNode().GetContentNode();
-        pRedlPam->GetPoint()->nContent.Assign( pCNd, 0 );
+        pRedlPam->GetPoint()->Assign(aSttIdx);
 
         getIDocumentRedlineAccess().AppendRedline(pDeleteRedline, true);
 
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index ceb1439d184f..7436d235485b 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -699,9 +699,7 @@ bool SwNoTextFrame::GetCharRect( SwRect &rRect, const 
SwPosition& rPos,
 bool SwNoTextFrame::GetModelPositionForViewPoint(SwPosition* pPos, Point& ,
                              SwCursorMoveState*, bool ) const
 {
-    SwContentNode* pCNd = const_cast<SwContentNode*>(GetNode());
-    pPos->nNode = *pCNd;
-    pPos->nContent.Assign( pCNd, 0 );
+    pPos->Assign(*GetNode());
     return true;
 }
 
diff --git a/sw/source/core/docnode/ndsect.cxx 
b/sw/source/core/docnode/ndsect.cxx
index 99b628691121..0654bd0abf4e 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -254,7 +254,6 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & 
rNewData,
             if( pPrvNd && 1 == nRegionRet )
             {
                 pSttPos->Assign( *pPrvNd );
-                pSttPos->nContent.Assign( pSttPos->GetNode().GetContentNode(), 
0 );
             }
             else if( pSttPos->GetContentIndex() )
             {
@@ -264,7 +263,6 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & 
rNewData,
             if( pPrvNd && 2 == nRegionRet )
             {
                 pEndPos->Assign( *pPrvNd );
-                pEndPos->nContent.Assign( pEndPos->GetNode().GetContentNode(), 
0 );
             }
             else
             {
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 70fc729f0321..2c0511ea9298 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -1620,8 +1620,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, 
SwNodes& rNodes )
         }
         if( !bSplitDestNd )
         {
-            ++rPos.nNode;
-            rPos.nContent.Assign( rPos.GetNode().GetContentNode(), 0 );
+            rPos.Adjust(SwNodeOffset(1));
         }
     }
 
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 500e80b292d7..4005ce8e14b1 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -999,8 +999,7 @@ CHECK_ROMAN_5:
 void SwAutoFormat::SetColl( sal_uInt16 nId, bool bHdLineOrText )
 {
     m_aDelPam.DeleteMark();
-    m_aDelPam.GetPoint()->nNode = *m_pCurTextFrame->GetTextNodeForParaProps();
-    
m_aDelPam.GetPoint()->nContent.Assign(m_aDelPam.GetPoint()->GetNode().GetContentNode(),
 0);
+    m_aDelPam.GetPoint()->Assign( *m_pCurTextFrame->GetTextNodeForParaProps() 
);
 
     // keep hard tabs, alignment, language, hyphenation, DropCaps and nearly 
all frame attributes
     SfxItemSetFixed<
@@ -1329,8 +1328,7 @@ void SwAutoFormat::DelMoreLinesBlanks( bool 
bWithLineBreaks )
 void SwAutoFormat::JoinPrevPara()
 {
     m_aDelPam.DeleteMark();
-    m_aDelPam.GetPoint()->nNode = *m_pCurTextFrame->GetTextNodeFirst();
-    m_aDelPam.GetPoint()->nContent.Assign(m_pCurTextFrame->GetTextNodeFirst(), 
0);
+    m_aDelPam.GetPoint()->Assign( *m_pCurTextFrame->GetTextNodeFirst() );
     m_aDelPam.SetMark();
 
     --m_aDelPam.GetPoint()->nNode;
@@ -1898,8 +1896,7 @@ void SwAutoFormat::BuildHeadLine( sal_uInt16 nLvl )
             pNextFrame = GetNextNode(false);
         }
         m_aDelPam.DeleteMark();
-        m_aDelPam.GetPoint()->nNode = *pNextFrame->GetTextNodeForParaProps();
-        m_aDelPam.GetPoint()->nContent.Assign( m_aDelPam.GetContentNode(), 0 );
+        m_aDelPam.GetPoint()->Assign( *pNextFrame->GetTextNodeForParaProps() );
         m_pDoc->SetTextFormatColl( m_aDelPam, &rNxtColl );
     }
     else
diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx
index bf6739d6de02..4366094d7c50 100644
--- a/sw/source/core/edit/ednumber.cxx
+++ b/sw/source/core/edit/ednumber.cxx
@@ -99,11 +99,9 @@ SwPaM& SwPamRanges::SetPam( size_t nArrPos, SwPaM& rPam )
 {
     assert( nArrPos < Count() );
     const SwPamRange& rTmp = maVector[ nArrPos ];
-    rPam.GetPoint()->nNode = rTmp.nStart;
-    rPam.GetPoint()->nContent.Assign( rPam.GetContentNode(), 0 );
+    rPam.GetPoint()->Assign(rTmp.nStart);
     rPam.SetMark();
-    rPam.GetPoint()->nNode = rTmp.nEnd;
-    rPam.GetPoint()->nContent.Assign( rPam.GetContentNode(), 0 );
+    rPam.GetPoint()->Assign(rTmp.nEnd);
     return rPam;
 }
 
diff --git a/sw/source/core/frmedt/feshview.cxx 
b/sw/source/core/frmedt/feshview.cxx
index 735a32536773..d390d29c930d 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -817,8 +817,7 @@ const SwFrameFormat* SwFEShell::SelFlyGrabCursor()
                 {
                     assert(pCFrame->IsNoTextFrame());
                     SwContentNode *const pCNode = static_cast<SwNoTextFrame 
*>(pCFrame)->GetNode();
-                    pCursor->GetPoint()->nNode = *pCNode;
-                    pCursor->GetPoint()->nContent.Assign( pCNode, 0 );
+                    pCursor->GetPoint()->Assign(*pCNode);
                 }
 
                 SwRect& rChrRect = const_cast<SwRect&>(GetCharRect());
@@ -2655,8 +2654,7 @@ bool SwFEShell::GotoFly( const OUString& rName, 
FlyCntType eType, bool bSelFrame
                         assert(pCFrame->IsNoTextFrame());
                         SwContentNode *const pCNode = 
static_cast<SwNoTextFrame *>(pCFrame)->GetNode();
 
-                        pCursor->GetPoint()->nNode = *pCNode;
-                        pCursor->GetPoint()->nContent.Assign( pCNode, 0 );
+                        pCursor->GetPoint()->Assign(*pCNode);
                     }
 
                     SwRect& rChrRect = const_cast<SwRect&>(GetCharRect());
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index 5dda0abfef25..5184bfda4284 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -196,8 +196,7 @@ void SwFEShell::InsertRow( sal_uInt16 nCnt, bool bBehind )
         SwPaM* pPaM = getShellCursor(false);
         SwNode* pNode = 
pPaM->Start()->GetNode().FindTableNode()->EndOfSectionNode();
         // pNode is the end node of the table, we want the last node before 
the end node of the last cell.
-        pPaM->End()->nNode = pNode->GetIndex() - 2;
-        pPaM->End()->nContent.Assign(pPaM->End()->GetNode().GetContentNode(), 
0);
+        pPaM->End()->Assign( pNode->GetIndex() - 2 );
     }
     GetTableSel( *this, aBoxes, SwTableSearchType::Row );
 
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index fc6eb8e8ba45..dd2b9002e0a4 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -1413,8 +1413,7 @@ void SwFlyAtContentFrame::SetAbsPos( const Point &rNew )
         else // is that even possible? maybe if there was a change of anchor 
type from AT_FLY or something?
         {
             assert(pCnt->IsNoTextFrame());
-            pos.nNode = *static_cast<SwNoTextFrame*>(pCnt)->GetNode();
-            pos.nContent.Assign(static_cast<SwNoTextFrame*>(pCnt)->GetNode(), 
0);
+            pos.Assign(*static_cast<SwNoTextFrame*>(pCnt)->GetNode());
         }
         aAnch.SetAnchor( &pos );
 
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 51586a297dfb..496c717aff28 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -346,10 +346,7 @@ namespace sw {
         SwPosition pos(rPos);
         SwTextNode const*const pNode(pos.GetNode().GetTextNode());
         if (pNode)
-        {
-            pos.nNode = *sw::GetParaPropsNode(rLayout, *pNode);
-            pos.nContent.Assign(pos.GetNode().GetContentNode(), 0);
-        }
+            pos.Assign( *sw::GetParaPropsNode(rLayout, *pNode) );
         return pos;
     }
 
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 3730ec84f41d..dfa4fc114ba3 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -139,8 +139,7 @@ void SwUndo::RemoveIdxFromRange( SwPaM& rPam, bool 
bMoveNext )
             rPam.Exchange();
             if( !rPam.Move( fnMoveBackward ) )
             {
-                rPam.GetPoint()->nNode = 
rPam.GetDoc().GetNodes().GetEndOfPostIts();
-                rPam.GetPoint()->nContent.Assign( nullptr, 0 );
+                rPam.GetPoint()->Assign( 
rPam.GetDoc().GetNodes().GetEndOfPostIts() );
             }
         }
 
diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx
index ddd7fb11498b..d000afe8dba5 100644
--- a/sw/source/core/undo/unmove.cxx
+++ b/sw/source/core/undo/unmove.cxx
@@ -124,9 +124,6 @@ SwUndoMove::SwUndoMove( SwDoc& rDoc, const SwNodeRange& rRg,
         if( pCNd )
             aPtPos.nContent.Assign( pCNd, pCNd->Len() );
         SwPosition aMkPos( rRg.aStart );
-        pCNd = aMkPos.GetNode().GetContentNode();
-        if( nullptr != pCNd )
-            aMkPos.nContent.Assign( pCNd, 0 );
 
         DelContentIndex( aMkPos, aPtPos, DelContentType::Ftn );
 
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 0a928afb5dc4..5525ebbf7767 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -305,8 +305,7 @@ void SwUndoInsTable::UndoImpl(::sw::UndoRedoContext & 
rContext)
 
     SwPaM & rPam( rContext.GetCursorSupplier().CreateNewShellCursor() );
     rPam.DeleteMark();
-    rPam.GetPoint()->nNode = aIdx;
-    rPam.GetPoint()->nContent.Assign( rPam.GetContentNode(), 0 );
+    rPam.GetPoint()->Assign(aIdx);
 }
 
 void SwUndoInsTable::RedoImpl(::sw::UndoRedoContext & rContext)
@@ -771,8 +770,7 @@ void SwUndoTextToTable::UndoImpl(::sw::UndoRedoContext & 
rContext)
     SwPosition *const pPos = aPam.GetPoint();
     if( m_nSttContent )
     {
-        pPos->nNode = nTableNd;
-        pPos->nContent.Assign(pPos->GetNode().GetContentNode(), 0);
+        pPos->Assign(nTableNd);
         if (aPam.Move(fnMoveBackward, GoInContent))
         {
             SwNodeIndex & rIdx = aPam.GetPoint()->nNode;
@@ -2441,15 +2439,7 @@ void SwUndoTableCpyTable::UndoImpl(::sw::UndoRedoContext 
& rContext)
                     // for step forward later on.
                     bDeleteCompleteParagraph = true;
                     bShiftPam = true;
-                    SwNodeIndex aTmpIdx( *pEndNode, -1 );
-                    SwTextNode *pText = aTmpIdx.GetNode().GetTextNode();
-                    if( pText )
-                    {
-                        aPam.GetPoint()->nNode = *pText;
-                        aPam.GetPoint()->nContent.Assign( pText, 0 );
-                    }
-                    else
-                        *aPam.GetPoint() = SwPosition( aTmpIdx );
+                    aPam.GetPoint()->Assign(*pEndNode, SwNodeOffset(-1));
                 }
             }
             rDoc.getIDocumentRedlineAccess().DeleteRedline( aPam, true, 
RedlineType::Any );
@@ -2463,15 +2453,7 @@ void SwUndoTableCpyTable::UndoImpl(::sw::UndoRedoContext 
& rContext)
             {
                 // The aPam.Point is at the moment at the last position of the 
new content and has to be
                 // moved to the first position of the old content for the 
SwUndoDelete operation
-                SwNodeIndex aTmpIdx( aPam.GetPoint()->nNode, 1 );
-                SwTextNode *pText = aTmpIdx.GetNode().GetTextNode();
-                if( pText )
-                {
-                    aPam.GetPoint()->nNode = *pText;
-                    aPam.GetPoint()->nContent.Assign( pText, 0 );
-                }
-                else
-                    *aPam.GetPoint() = SwPosition( aTmpIdx );
+                aPam.GetPoint()->Assign(aPam.GetPoint()->nNode.GetNode(), 
SwNodeOffset(1));
             }
             pUndo = std::make_unique<SwUndoDelete>(aPam, 
SwDeleteFlags::Default, bDeleteCompleteParagraph, true);
         }
diff --git a/sw/source/core/unocore/unoobj2.cxx 
b/sw/source/core/unocore/unoobj2.cxx
index c45bab5b91b7..cc2b2e36212e 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -1075,8 +1075,7 @@ bool SwXTextRange::GetPositions(SwPaM& rToFill, 
::sw::TextRangeMode const eMode)
             assert(pSectionNode);
             assert(pSectionNode->GetNodes().IsDocNodes());
             rToFill.GetPoint()->nNode = *pSectionNode;
-            ++rToFill.GetPoint()->nNode;
-            
rToFill.GetPoint()->nContent.Assign(rToFill.GetPoint()->GetNode().GetContentNode(),
 0);
+            rToFill.GetPoint()->Adjust(SwNodeOffset(1));
             rToFill.SetMark();
             rToFill.GetMark()->nNode = 
*pSectionNode->GetNode().EndOfSectionNode();
             --rToFill.GetMark()->nNode;
diff --git a/sw/source/filter/html/htmltab.cxx 
b/sw/source/filter/html/htmltab.cxx
index 707e60acd34b..6db247527c31 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -2630,9 +2630,7 @@ const SwStartNode *SwHTMLParser::InsertTableSection( 
sal_uInt16 nPoolId )
         pStNd = m_xDoc->GetNodes().MakeTextSection( aIdx, SwTableBoxStartNode,
                                                   pColl );
 
-        m_pPam->GetPoint()->nNode = pStNd->GetIndex() + 1;
-        SwTextNode *pTextNd = m_pPam->GetPoint()->GetNode().GetTextNode();
-        m_pPam->GetPoint()->nContent.Assign( pTextNd, 0 );
+        m_pPam->GetPoint()->Assign( pStNd->GetIndex() + 1 );
         m_xTable->IncBoxCount();
     }
 
diff --git a/sw/source/filter/ww8/writerhelper.cxx 
b/sw/source/filter/ww8/writerhelper.cxx
index 9a76a61d5e3d..c3abd77a18b3 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -123,12 +123,6 @@ namespace
             else
             {
                 SwPosition aPos(rpFly->GetNdIndex());
-
-                if (SwTextNode* pTextNd = aPos.GetNode().GetTextNode())
-                {
-                    aPos.nContent.Assign(pTextNd, 0);
-                }
-
                 aRet.emplace_back(rEntry, aPos);
             }
         }
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 442634a3cbc6..bfeb0a0bdb82 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2107,8 +2107,7 @@ void SwWW8ImplReader::Read_HdFtFootnoteText( const 
SwNodeIndex* pSttIdx,
     // Saves Flags (amongst other things) and resets them
     WW8ReaderSave aSave( this );
 
-    m_pPaM->GetPoint()->nNode = pSttIdx->GetIndex() + 1;
-    m_pPaM->GetPoint()->nContent.Assign( m_pPaM->GetContentNode(), 0 );
+    m_pPaM->GetPoint()->Assign( pSttIdx->GetIndex() + 1 );
 
     // Read Text for Header, Footer or Footnote
     ReadText( nStartCp, nLen, nType ); // Ignore Sepx when doing so
@@ -2203,8 +2202,7 @@ void SwWW8ImplReader::Read_HdFtTextAsHackedFrame(WW8_CP 
nStart, WW8_CP nLen,
 
     SwPosition aTmpPos(*m_pPaM->GetPoint());
 
-    m_pPaM->GetPoint()->nNode = pSttIdx->GetIndex() + 1;
-    m_pPaM->GetPoint()->nContent.Assign(m_pPaM->GetContentNode(), 0);
+    m_pPaM->GetPoint()->Assign( pSttIdx->GetIndex() + 1 );
 
     // tdf#122425: Explicitly remove borders and spacing
     SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END - 1> 
aFlySet(m_rDoc.GetAttrPool());
@@ -5239,8 +5237,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const 
*pGloss)
             SwStartNode *pNode =
                 m_rDoc.GetNodes().MakeTextSection(aIdx,
                 SwNormalStartNode,pColl);
-            m_pPaM->GetPoint()->nNode = pNode->GetIndex()+1;
-            m_pPaM->GetPoint()->nContent.Assign(m_pPaM->GetContentNode(),0);
+            m_pPaM->GetPoint()->Assign( pNode->GetIndex()+1 );
             aPlc.Get( nStart, nEnd, pDummy );
             ReadText(nStart,nEnd-nStart-1,MAN_MAINTEXT);
         }
@@ -6363,7 +6360,6 @@ bool TestImportDOC(SvStream &rStream, const OUString 
&rFltName)
 
     SwNodeIndex aIdx(pD->GetNodes().GetEndOfContent(), -1);
     SwPaM aPaM(aIdx);
-    aPaM.GetPoint()->nContent.Assign(aIdx.GetNode().GetContentNode(), 0);
     pD->SetInReading(true);
     bool bRet = xReader->Read(*pD, OUString(), aPaM, OUString()) == 
ERRCODE_NONE;
     pD->SetInReading(false);
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 2a6aa140ca4b..d59f41d68174 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -2580,8 +2580,7 @@ eF_ResT SwWW8ImplReader::Read_F_IncludeText( 
WW8FieldDesc* /*pF*/, OUString& rSt
     if (!pSectionNode)
         return eF_ResT::TEXT;
 
-    m_pPaM->GetPoint()->nNode = pSectionNode->GetIndex()+1;
-    m_pPaM->GetPoint()->nContent.Assign(m_pPaM->GetContentNode(), 0 );
+    m_pPaM->GetPoint()->Assign( pSectionNode->GetIndex()+1 );
 
     //we have inserted a section before this point, so adjust pos
     //for future page/section segment insertion
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 19e888c9cfe1..553a62dc296b 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2324,8 +2324,7 @@ void SwWW8ImplReader::MoveInsideFly(const SwFrameFormat 
*pFlyFormat)
     // set Pam in FlyFrame
     const SwFormatContent& rContent = pFlyFormat->GetContent();
     OSL_ENSURE( rContent.GetContentIdx(), "No content prepared." );
-    m_pPaM->GetPoint()->nNode = rContent.GetContentIdx()->GetIndex() + 1;
-    m_pPaM->GetPoint()->nContent.Assign( m_pPaM->GetContentNode(), 0 );
+    m_pPaM->GetPoint()->Assign( rContent.GetContentIdx()->GetIndex() + 1 );
 
     aDup.Insert(*m_pPaM->GetPoint());
 }
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx 
b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 9d4cf7f28377..7bc78f4e77e7 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -160,9 +160,7 @@ XTextRangeOrNodeIndexPosition::CopyPositionInto(SwPosition& 
rPos, SwDoc & rDoc)
     }
     else
     {
-        rPos.nNode = *m_pIndex;
-        rPos.nNode++;           // pIndex points to previous index !!!
-        rPos.nContent.Assign( rPos.GetNode().GetContentNode(), 0 );
+        rPos.Assign( m_pIndex->GetNode(), SwNodeOffset(1) ); // pIndex points 
to previous index !!!
     }
 }
 
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index fd22425306bd..c749d6e783ef 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -2710,7 +2710,6 @@ const SwStartNode *SwXMLTableContext::InsertTableSection(
             SwContentNode *pCNd = pDoc->GetNodes()[ pStNd->GetIndex() + 1 ]
                                                             ->GetContentNode();
             SwPosition aPos( *pCNd );
-            aPos.nContent.Assign( pCNd, 0U );
 
             const uno::Reference< text::XTextRange > xTextRange =
                 SwXTextRange::CreateXTextRange( *pDoc, aPos, nullptr );

Reply via email to