sw/source/core/undo/undel.cxx     |   14 +++++++-------
 sw/source/core/undo/undobj.cxx    |    8 ++++----
 sw/source/filter/html/wrthtml.cxx |   12 ++++++------
 sw/source/filter/ww8/wrtww8.cxx   |    2 +-
 sw/source/filter/xml/swxml.cxx    |    6 +++---
 sw/source/uibase/docvw/edtwin.cxx |    2 +-
 6 files changed, 22 insertions(+), 22 deletions(-)

New commits:
commit 0df9418318b5f6718fd864f1755587b584d2a322
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Oct 8 15:14:04 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Oct 8 18:14:40 2022 +0200

    use more SwPosition::Assign
    
    part of the process of hiding the internals of SwPosition
    
    Change-Id: If1aa807be2963ab81fd535e12cc6a705186a6672
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141111
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 06774f56b997..e7d6176f193c 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -294,7 +294,7 @@ SwUndoDelete::SwUndoDelete(
         rPam.Exchange();
 
     if( !pSttTextNd && !pEndTextNd )
-        --rPam.GetPoint()->nNode;
+        rPam.GetPoint()->Adjust(SwNodeOffset(-1));
     rPam.DeleteMark();          // the SPoint is in the selection
 
     if( !pEndTextNd )
@@ -941,7 +941,7 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & 
rContext)
                         
lcl_ReAnchorAtContentFlyFrames(*rDoc.GetSpzFrameFormats(), aPos, nOldIdx);
                 }
                 else
-                    ++aPos.nNode;
+                    aPos.Adjust(SwNodeOffset(+1));
             }
         }
         if( m_nSectDiff )
@@ -959,12 +959,12 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & 
rContext)
                 ++nDiff;
             }
             SwNodeIndex aMvIdx(rDoc.GetNodes(), nMoveIndex);
-            SwNodeRange aRg( aPos.nNode, SwNodeOffset(0) - nDiff, aPos.nNode, 
SwNodeOffset(1) - nDiff );
-            --aPos.nNode;
+            SwNodeRange aRg( aPos.GetNode(), SwNodeOffset(0) - nDiff, 
aPos.GetNode(), SwNodeOffset(1) - nDiff );
+            aPos.Adjust(SwNodeOffset(-1));
             if( !m_bJoinNext )
                 pMovedNode = &aPos.GetNode();
             rDoc.GetNodes().MoveNodes(aRg, rDoc.GetNodes(), aMvIdx.GetNode());
-            ++aPos.nNode;
+            aPos.Adjust(SwNodeOffset(+1));
         }
 
         if( bNodeMove )
@@ -983,7 +983,7 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & 
rContext)
                 if( m_bJoinNext )
                 {
                     nMoveIndex = m_nEndNode - m_nNdDiff;
-                    aPos.nNode = nMoveIndex + m_nReplaceDummy;
+                    aPos.Assign( nMoveIndex + m_nReplaceDummy );
                 }
                 else
                 {
@@ -1298,7 +1298,7 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & 
rContext)
         assert(!"dead code");
         // The Pam was incremented by one at Point (== end) to provide space
         // for UNDO. This now needs to be reverted!
-        --rPam.End()->nNode;
+        rPam.End()->Adjust(SwNodeOffset(-1));
         if( rPam.GetPoint()->GetNode() == rPam.GetMark()->GetNode() )
             *rPam.GetMark() = *rPam.GetPoint();
         rDoc.getIDocumentContentOperations().DelFullPara( rPam );
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 8d77e807f2c8..a3ca96359c87 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -749,9 +749,9 @@ void SwUndoSaveContent::MoveToUndoNds( SwPaM& rPaM, 
SwNodeIndex* pNodeIdx,
         *pEndNdIdx = aPos.GetNodeIndex();
 
     // old position
-    aPos.nNode = nTmpMvNode;
+    aPos.Assign(nTmpMvNode);
     if( pNodeIdx )
-        *pNodeIdx = aPos.nNode;
+        *pNodeIdx = aPos.GetNode();
 }
 
 void SwUndoSaveContent::MoveFromUndoNds( SwDoc& rDoc, SwNodeOffset nNodeIdx,
@@ -767,10 +767,10 @@ void SwUndoSaveContent::MoveFromUndoNds( SwDoc& rDoc, 
SwNodeOffset nNodeIdx,
 
     SwPaM aPaM( rInsPos );
     if( pEndNdIdx )         // than get the section from it
-        aPaM.GetPoint()->nNode.Assign( rNds, *pEndNdIdx );
+        aPaM.GetPoint()->Assign( *rNds[SwNodeOffset(0)], *pEndNdIdx );
     else
     {
-        aPaM.GetPoint()->nNode = rNds.GetEndOfExtras();
+        aPaM.GetPoint()->Assign( rNds.GetEndOfExtras() );
         GoInContent( aPaM, fnMoveBackward );
     }
 
diff --git a/sw/source/filter/html/wrthtml.cxx 
b/sw/source/filter/html/wrthtml.cxx
index ccb21539e76a..2d5e3db6fce9 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -488,10 +488,10 @@ ErrCode SwHTMLWriter::WriteStream()
         if( pTNd && m_bWriteAll )
         {
             // start with table node !!
-            m_pCurrentPam->GetPoint()->nNode = *pTNd;
+            m_pCurrentPam->GetPoint()->Assign(*pTNd);
 
             if( m_bWriteOnlyFirstTable )
-                m_pCurrentPam->GetMark()->nNode = *pTNd->EndOfSectionNode();
+                m_pCurrentPam->GetMark()->Assign(*pTNd->EndOfSectionNode());
         }
 
         // first node (with can contain a page break)
@@ -503,7 +503,7 @@ ErrCode SwHTMLWriter::WriteStream()
             if( m_bWriteAll )
             {
                 // start with section node !!
-                m_pCurrentPam->GetPoint()->nNode = *pSNd;
+                m_pCurrentPam->GetPoint()->Assign(*pSNd);
             }
             else
             {
@@ -862,7 +862,7 @@ static Writer& OutHTML_Section( Writer& rWrt, const 
SwSectionNode& rSectNd )
         rHTMLWrt.Out_SwDoc( rHTMLWrt.m_pCurrentPam.get() );
     }
 
-    rHTMLWrt.m_pCurrentPam->GetPoint()->nNode = *rSectNd.EndOfSectionNode();
+    rHTMLWrt.m_pCurrentPam->GetPoint()->Assign(*rSectNd.EndOfSectionNode());
 
     if( bEndTag )
         lcl_html_OutSectionEndTag( rHTMLWrt );
@@ -923,7 +923,7 @@ void SwHTMLWriter::Out_SwDoc( SwPaM* pPam )
             else if( &rNd == &m_pDoc->GetNodes().GetEndOfContent() )
                 break;
 
-            ++m_pCurrentPam->GetPoint()->nNode;   // move
+            m_pCurrentPam->GetPoint()->Adjust(SwNodeOffset(+1));   // move
             SwNodeOffset nPos = m_pCurrentPam->GetPoint()->GetNodeIndex();
 
             if( m_bShowProgress )
@@ -1589,7 +1589,7 @@ HTMLSaveData::HTMLSaveData(SwHTMLWriter& rWriter, 
SwNodeOffset nStt,
     {
         const SwNode *pNd = rWrt.m_pDoc->GetNodes()[ nStt ];
         if( pNd->IsTableNode() || pNd->IsSectionNode() )
-            rWrt.m_pCurrentPam->GetMark()->nNode = nStt;
+            rWrt.m_pCurrentPam->GetMark()->Assign(*pNd);
     }
 
     rWrt.SetEndPaM( rWrt.m_pCurrentPam.get() );
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 47bbcaaa0a19..0e3765d39210 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2809,7 +2809,7 @@ void MSWordExportBase::WriteText()
             if ( pTemp )
                 m_pCurrentPageDesc = pTemp;
 
-            m_pCurPam->GetPoint()->nContent.Assign( pCNd, 0 );
+            m_pCurPam->GetPoint()->SetContent( 0 );
             OutputContentNode( *pCNd );
         }
         else if ( rNd.IsTableNode() )
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 9abaebaf5d15..21afc25b9152 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -110,9 +110,9 @@ static void lcl_EnsureValidPam( SwPaM& rPam )
     {
         // point is not valid, so move it into the first content
         rPam.DeleteMark();
-        rPam.GetPoint()->nNode =
-            *rPam.GetDoc().GetNodes().GetEndOfContent().StartOfSectionNode();
-        ++ rPam.GetPoint()->nNode;
+        rPam.GetPoint()->Assign(
+            *rPam.GetDoc().GetNodes().GetEndOfContent().StartOfSectionNode() );
+        rPam.GetPoint()->Adjust(SwNodeOffset(+1));
         rPam.Move( fnMoveForward, GoInContent ); // go into content
     }
 }
diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index d7fed1052210..35628a0ce50a 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -905,7 +905,7 @@ void SwEditWin::FlushInBuffer()
         rSh.NormalizePam();     // make point be the first (left) one
         if (!rSh.GetCursor()->HasMark())
             rSh.GetCursor()->SetMark();
-        rSh.GetCursor()->GetMark()->nContent = 0;
+        rSh.GetCursor()->GetMark()->SetContent(0);
 
         const OUString aOldText( rSh.GetCursor()->GetText() );
         const sal_Int32 nOldLen = aOldText.getLength();

Reply via email to