sw/source/core/table/swnewtable.cxx      |   15 ++++++++-------
 sw/source/core/text/itratr.cxx           |    3 +--
 sw/source/core/text/redlnitr.cxx         |    6 +++---
 sw/source/core/txtnode/atrftn.cxx        |    2 +-
 sw/source/core/txtnode/attrlinebreak.cxx |    2 +-
 5 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 13a10516e71609d677d7f7d274f3ddc98cb8df18
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Thu Sep 29 18:49:06 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Sep 29 20:13:54 2022 +0200

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

diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 7e10a29d5629..a37536e76121 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -1466,8 +1466,7 @@ SwTwips SwTextNode::GetWidthOfLeadingTabs() const
 
     if ( nIdx > 0 )
     {
-        SwPosition aPos( *this );
-        aPos.nContent += nIdx;
+        SwPosition aPos( *this, nIdx );
 
         // Find the non-follow text frame:
         SwIterator<SwTextFrame, SwTextNode, sw::IteratorMode::UnwrapMulti> 
aIter(*this);
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index e5d16f2215cc..03697cce97c2 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -156,13 +156,13 @@ public:
                 {
                     m_Fieldmark.second.emplace(
                         sw::mark::FindFieldSep(*m_Fieldmark.first));
-                    ++m_Fieldmark.second->nContent;
-                    ++m_oNextFieldmarkHide->nContent; // skip start
+                    m_Fieldmark.second->AdjustContent(+1);
+                    m_oNextFieldmarkHide->AdjustContent(+1); // skip start
                 }
                 else
                 {
                     m_Fieldmark.second.emplace(pFieldmark->GetMarkEnd());
-                    --m_Fieldmark.second->nContent;
+                    m_Fieldmark.second->AdjustContent(-1);
                 }
             }
         }
diff --git a/sw/source/core/txtnode/atrftn.cxx 
b/sw/source/core/txtnode/atrftn.cxx
index 518bca0403b3..7cbba1e5efbf 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -276,7 +276,7 @@ uno::Reference<text::XTextRange> 
SwFormatFootnote::getAnchor(SwDoc& rDoc) const
         return uno::Reference<text::XTextRange>();
     SwPaM aPam(m_pTextAttr->GetTextNode(), m_pTextAttr->GetStart());
     aPam.SetMark();
-    ++aPam.GetMark()->nContent;
+    aPam.GetMark()->AdjustContent(+1);
     const uno::Reference<text::XTextRange> xRet =
         SwXTextRange::CreateXTextRange(rDoc, *aPam.Start(), aPam.End());
     return xRet;
diff --git a/sw/source/core/txtnode/attrlinebreak.cxx 
b/sw/source/core/txtnode/attrlinebreak.cxx
index 59d7c247e47b..1c5c7882ee31 100644
--- a/sw/source/core/txtnode/attrlinebreak.cxx
+++ b/sw/source/core/txtnode/attrlinebreak.cxx
@@ -85,7 +85,7 @@ uno::Reference<text::XTextRange> 
SwFormatLineBreak::GetAnchor() const
 
     SwPaM aPam(m_pTextAttr->GetTextNode(), m_pTextAttr->GetStart());
     aPam.SetMark();
-    ++aPam.GetMark()->nContent;
+    aPam.GetMark()->AdjustContent(+1);
     uno::Reference<text::XTextRange> xRet
         = SwXTextRange::CreateXTextRange(aPam.GetDoc(), *aPam.Start(), 
aPam.End());
     return xRet;
commit 3c68edf8fc8343300de500f01b11ae36e02819a6
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Thu Sep 29 19:00:13 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Sep 29 20:13:42 2022 +0200

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

diff --git a/sw/source/core/table/swnewtable.cxx 
b/sw/source/core/table/swnewtable.cxx
index 59428ec61f97..d87c039185c0 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -884,11 +884,12 @@ bool SwTable::PrepareMerge( const SwPaM& rPam, 
SwSelBoxes& rBoxes,
                 // we do not transfer this paragraph.
                 if( !IsEmptyBox( *pBox, aChkPam ) )
                 {
-                    SwNodeIndex& rInsPosNd = aInsPos.nNode;
+                    SwNode& rInsPosNd = aInsPos.GetNode();
                     SwPaM aPam( aInsPos );
-                    aPam.GetPoint()->nNode.Assign( 
*pBox->GetSttNd()->EndOfSectionNode(), -1 );
+                    aPam.GetPoint()->Assign( 
*pBox->GetSttNd()->EndOfSectionNode(), SwNodeOffset(-1) );
                     SwContentNode* pCNd = aPam.GetPointContentNode();
-                    aPam.GetPoint()->nContent.Assign( pCNd, pCNd ? pCNd->Len() 
: 0 );
+                    if( pCNd )
+                        aPam.GetPoint()->SetContent( pCNd->Len() );
                     SwNodeIndex aSttNdIdx( *pBox->GetSttNd(), 1 );
                     bool const bUndo = pDoc->GetIDocumentUndoRedo().DoesUndo();
                     if( pUndo )
@@ -902,10 +903,10 @@ bool SwTable::PrepareMerge( const SwPaM& rPam, 
SwSelBoxes& rBoxes,
                     }
                     SwNodeRange aRg( aSttNdIdx.GetNode(), 
aPam.GetPoint()->GetNode() );
                     if( pUndo )
-                        pUndo->MoveBoxContent( *pDoc, aRg, rInsPosNd.GetNode() 
);
+                        pUndo->MoveBoxContent( *pDoc, aRg, rInsPosNd );
                     else
                     {
-                        pDoc->getIDocumentContentOperations().MoveNodeRange( 
aRg, rInsPosNd.GetNode(),
+                        pDoc->getIDocumentContentOperations().MoveNodeRange( 
aRg, rInsPosNd,
                             SwMoveFlags::NO_DELFRMS );
                     }
                 }
@@ -948,13 +949,13 @@ bool SwTable::PrepareMerge( const SwPaM& rPam, 
SwSelBoxes& rBoxes,
                     if( nCurrLine )
                     {
                         SwPaM aPam( *pBox->GetSttNd(), 0 );
-                        aPam.GetPoint()->nNode++;
+                        aPam.GetPoint()->Adjust(SwNodeOffset(+1));
                         SwTextNode* pNd = aPam.GetPointNode().GetTextNode();
                         while( pNd )
                         {
                             pNd->SetCountedInList( false );
 
-                            aPam.GetPoint()->nNode++;
+                            aPam.GetPoint()->Adjust(SwNodeOffset(+1));
                             pNd = aPam.GetPointNode().GetTextNode();
                         }
                     }

Reply via email to