sw/source/filter/ww8/WW8TableInfo.cxx |    6 +++---
 sw/source/filter/ww8/docxexport.cxx   |    2 +-
 sw/source/filter/ww8/rtfexport.cxx    |    7 +++----
 sw/source/filter/ww8/wrtw8sty.cxx     |    2 +-
 sw/source/filter/ww8/wrtww8.cxx       |    8 ++++----
 5 files changed, 12 insertions(+), 13 deletions(-)

New commits:
commit 006fd925feafcf9beecf01279907fb330d704a89
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Aug 24 13:02:37 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Aug 24 14:49:42 2022 +0200

    Use more SwPosition::Assign
    
    to keep the internal fields of SwPosition in sync.
    
    Change-Id: I49cf97b3beaa3ff79489ba23106ac9ede9475765
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138760
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx 
b/sw/source/filter/ww8/WW8TableInfo.cxx
index f5c318b6df23..e087d515fc5f 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -589,7 +589,7 @@ WW8TableInfo::processSwTableByLayout(const SwTable * 
pTable, RowEndInners_t &rLa
                         bDone = true;
                 }
 
-                aPam.GetPoint()->nNode++;
+                aPam.GetPoint()->Adjust(SwNodeOffset(1));
             }
             while (!bDone);
         }
@@ -708,7 +708,7 @@ WW8TableInfo::processTableBoxLines(const SwTableBox * pBox,
             if (aPaM.GetPoint()->GetNode() == aEndPaM.GetPoint()->GetNode())
                 bDone = true;
             else
-                aPaM.GetPoint()->nNode++;
+                aPaM.GetPoint()->Adjust(SwNodeOffset(1));
         }
     }
 
@@ -804,7 +804,7 @@ WW8TableInfo::processTableBox(const SwTable * pTable,
                     bDone = true;
             }
 
-            aPaM.GetPoint()->nNode++;
+            aPaM.GetPoint()->Adjust(SwNodeOffset(1));
         }
         while (!bDone);
 
diff --git a/sw/source/filter/ww8/docxexport.cxx 
b/sw/source/filter/ww8/docxexport.cxx
index 4894400011f1..52090fc74891 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -1872,7 +1872,7 @@ void DocxExport::WriteMainText()
     // body
     m_pDocumentFS->startElementNS(XML_w, XML_body);
 
-    m_pCurPam->GetPoint()->nNode = 
m_rDoc.GetNodes().GetEndOfContent().StartOfSectionNode()->GetIndex();
+    
m_pCurPam->GetPoint()->Assign(*m_rDoc.GetNodes().GetEndOfContent().StartOfSectionNode());
 
     // the text
     WriteText();
diff --git a/sw/source/filter/ww8/rtfexport.cxx 
b/sw/source/filter/ww8/rtfexport.cxx
index 7a7d110ca835..a48e70c8efe1 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -500,13 +500,12 @@ void RtfExport::WriteMainText()
     SwTableNode* pTableNode = m_pCurPam->GetPointNode().FindTableNode();
     if (m_pWriter && m_pWriter->m_bWriteOnlyFirstTable && pTableNode != 
nullptr)
     {
-        m_pCurPam->GetPoint()->nNode = *pTableNode;
-        m_pCurPam->GetMark()->nNode = *(pTableNode->EndOfSectionNode());
+        m_pCurPam->GetPoint()->Assign(*pTableNode);
+        m_pCurPam->GetMark()->Assign(*pTableNode->EndOfSectionNode());
     }
     else
     {
-        m_pCurPam->GetPoint()->nNode
-            = 
m_rDoc.GetNodes().GetEndOfContent().StartOfSectionNode()->GetIndex();
+        
m_pCurPam->GetPoint()->Assign(*m_rDoc.GetNodes().GetEndOfContent().StartOfSectionNode());
     }
 
     WriteText();
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index ff5af1a68785..06c930ba339d 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1013,7 +1013,7 @@ MSWordSections::MSWordSections( MSWordExportBase& rExport 
)
         if ( SectionType::ToxContent == pSectNd->GetSection().GetType() )
         {
             pNd = pSectNd;
-            rExport.m_pCurPam->GetPoint()->nNode = *pNd;
+            rExport.m_pCurPam->GetPoint()->Assign(*pNd);
         }
 
         if ( SectionType::Content == pSectNd->GetSection().GetType() )
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index d2eb7a99e95c..331b0038cdb9 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1883,7 +1883,7 @@ void MSWordExportBase::SetCurPam(SwNodeOffset nStt, 
SwNodeOffset nEnd)
     if ( nStt != m_pCurPam->GetMark()->GetNodeIndex() &&
          m_rDoc.GetNodes()[ nStt ]->IsTableNode() )
     {
-        m_pCurPam->GetMark()->nNode = nStt;
+        m_pCurPam->GetMark()->Assign(nStt);
     }
 
     m_pOrigPam = m_pCurPam.get(); // ???
@@ -2919,7 +2919,7 @@ void MSWordExportBase::WriteText()
         if (pNextNode != nullptr)
             m_pCurPam->GetPoint()->Assign(*pNextNode);
         else
-            ++m_pCurPam->GetPoint()->nNode;
+            m_pCurPam->GetPoint()->Adjust(SwNodeOffset(1));
 
         SwNodeOffset nPos = m_pCurPam->GetPoint()->GetNodeIndex();
         ::SetProgressState( sal_Int32(nPos), m_pCurPam->GetDoc().GetDocShell() 
);
@@ -2934,7 +2934,7 @@ void WW8Export::WriteMainText()
 
     m_pFib->m_fcMin = Strm().Tell();
 
-    m_pCurPam->GetPoint()->nNode = 
m_rDoc.GetNodes().GetEndOfContent().StartOfSectionNode()->GetIndex();
+    
m_pCurPam->GetPoint()->Assign(*m_rDoc.GetNodes().GetEndOfContent().StartOfSectionNode());
 
     WriteText();
 
@@ -3818,7 +3818,7 @@ ErrCode SwWW8Writer::WriteStorageImpl()
         SwTableNode* pTNd = m_pCurrentPam->GetPointNode().FindTableNode();
         if( pTNd && m_bWriteAll )
             // start with the table node !!
-            m_pCurrentPam->GetPoint()->nNode = *pTNd;
+            m_pCurrentPam->GetPoint()->Assign(*pTNd);
     }
 
     // Do the actual export

Reply via email to