sw/source/core/text/redlnitr.cxx   |    2 +-
 sw/source/core/undo/undel.cxx      |   16 ++++++++--------
 sw/source/core/undo/undobj.cxx     |    6 +++---
 sw/source/core/undo/unmove.cxx     |    2 +-
 sw/source/core/undo/unsort.cxx     |    2 +-
 sw/source/core/undo/untblk.cxx     |   11 +++++------
 sw/source/core/unocore/unodraw.cxx |    2 +-
 7 files changed, 20 insertions(+), 21 deletions(-)

New commits:
commit 65d90df1acfd2b014af835e4ed997a14e1182c22
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Aug 20 16:58:11 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Aug 20 18:34:58 2022 +0200

    use more SwPosition::GetNode
    
    Change-Id: Ic23fab765316d5e6423bff035c8ee3ec605210ee
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138591
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index 1296496828c3..72b919a3d6db 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -271,7 +271,7 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & 
rTextNode,
             // and is likely a SwTableNode!
             if (!pEnd->GetNode().IsTextNode())
             {
-                assert(pEnd->nNode != pStart->nNode);
+                assert(pEnd->GetNode() != pStart->GetNode());
                 // must set pNode too because it will mark the last node
                 pNode = nodes.back();
                 assert(pNode == pNode->GetNodes()[pEnd->GetNodeIndex() - 1]);
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index b047fb73a8d8..342ba821eef7 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -531,7 +531,7 @@ bool SwUndoDelete::CanGrouping( SwDoc& rDoc, const SwPaM& 
rDelPam )
 
     auto [pStt, pEnd] = rDelPam.StartEnd(); // SwPosition*
 
-    if( pStt->nNode != pEnd->nNode ||
+    if( pStt->GetNode() != pEnd->GetNode() ||
         pStt->GetContentIndex()+1 != pEnd->GetContentIndex() ||
         pEnd->nNode != m_nSttNode )
         return false;
@@ -1240,10 +1240,10 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & 
rContext)
             DelFullParaMoveFrames(rDoc, *this, *m_pRedlSaveData);
         }
 
-        SwNodeIndex aSttIdx = ( m_bDelFullPara || m_bJoinNext )
-                                    ? rPam.GetMark()->nNode
-                                    : rPam.GetPoint()->nNode;
-        SwTableNode* pTableNd = aSttIdx.GetNode().GetTableNode();
+        SwNode& rSttNd = ( m_bDelFullPara || m_bJoinNext )
+                                    ? rPam.GetMark()->GetNode()
+                                    : rPam.GetPoint()->GetNode();
+        SwTableNode* pTableNd = rSttNd.GetTableNode();
         if( pTableNd )
         {
             if( m_bTableDelLastNd )
@@ -1284,13 +1284,13 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & 
rContext)
             *aTmp.GetPoint() = *rPam.Start();
             aTmp.Move(fnMoveBackward, GoInNode);
         }
-        assert(aTmp.GetPoint()->nNode != rPam.GetPoint()->nNode
-            && aTmp.GetPoint()->nNode != rPam.GetMark()->nNode);
+        assert(aTmp.GetPoint()->GetNode() != rPam.GetPoint()->GetNode()
+            && aTmp.GetPoint()->GetNode() != rPam.GetMark()->GetNode());
         ::PaMCorrAbs(rPam, *aTmp.GetPoint());
 
         rPam.DeleteMark();
 
-        rDoc.GetNodes().Delete( aSttIdx, m_nEndNode - m_nSttNode );
+        rDoc.GetNodes().Delete( rSttNd, m_nEndNode - m_nSttNode );
     }
     else if( m_bDelFullPara )
     {
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index e7d20d28d70f..b20ca460868f 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -746,7 +746,7 @@ void SwUndoSaveContent::MoveToUndoNds( SwPaM& rPaM, 
SwNodeIndex* pNodeIdx,
 
     if( pCpyNd || pEndNdIdx )
     {
-        SwNodeRange aRg( pStt->nNode, SwNodeOffset(0), pEnd->nNode, 
SwNodeOffset(1) );
+        SwNodeRange aRg( pStt->GetNode(), SwNodeOffset(0), pEnd->GetNode(), 
SwNodeOffset(1) );
         rDoc.GetNodes().MoveNodes( aRg, rNds, aPos.GetNode(), true );
         aPos.nContent = 0;
         --aPos.nNode;
@@ -1673,7 +1673,7 @@ bool IsSelectFrameAnchoredAtPara(SwPosition const & 
rAnchorPos,
             || (rStart.GetNode() == rAnchorPos.GetNode()
                 && !(nDelContentType & DelContentType::ExcludeFlyAtStartEnd)
                 // special case: fully deleted node
-                && ((rStart.nNode != rEnd.nNode && rStart.GetContentIndex() == 0
+                && ((rStart.GetNode() != rEnd.GetNode() && 
rStart.GetContentIndex() == 0
                         // but not if the selection is backspace/delete!
                         && IsNotBackspaceHeuristic(rStart, rEnd))
                     || (IsAtStartOfSection2(rStart) && 
IsAtEndOfSection2(rEnd)))))
@@ -1681,7 +1681,7 @@ bool IsSelectFrameAnchoredAtPara(SwPosition const & 
rAnchorPos,
             || (rAnchorPos.GetNode() == rEnd.GetNode()
                 && !(nDelContentType & DelContentType::ExcludeFlyAtStartEnd)
                 // special case: fully deleted node
-                && ((rEnd.nNode != rStart.nNode && rEnd.GetContentIndex() == 
rEnd.GetNode().GetTextNode()->Len()
+                && ((rEnd.GetNode() != rStart.GetNode() && 
rEnd.GetContentIndex() == rEnd.GetNode().GetTextNode()->Len()
                         && IsNotBackspaceHeuristic(rStart, rEnd))
                     || (IsAtEndOfSection2(rEnd) && 
IsAtStartOfSection2(rStart)))));
 }
diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx
index e5d629978ac5..4ddaca99051e 100644
--- a/sw/source/core/undo/unmove.cxx
+++ b/sw/source/core/undo/unmove.cxx
@@ -257,7 +257,7 @@ void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext)
         DelFootnote( aPam );
         RemoveIdxFromRange( aPam, false );
 
-        aIdx = aPam.Start()->nNode;
+        aIdx = aPam.Start()->GetNode();
         bool bJoinText = aIdx.GetNode().IsTextNode();
 
         --aIdx;
diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx
index 3a06ea4574c8..516f341a17a3 100644
--- a/sw/source/core/undo/unsort.cxx
+++ b/sw/source/core/undo/unsort.cxx
@@ -235,7 +235,7 @@ void SwUndoSort::RepeatImpl(::sw::RepeatContext & rContext)
         SwPaM *const pPam = & rContext.GetRepeatPaM();
         SwDoc& rDoc = pPam->GetDoc();
 
-        if( !SwDoc::IsIdxInTable( pPam->Start()->nNode ) )
+        if( !SwDoc::IsInTable( pPam->Start()->GetNode() ) )
             rDoc.SortText(*pPam, *m_pSortOptions);
     }
 }
diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx
index ac5b40dcfdb9..1ecf62309204 100644
--- a/sw/source/core/undo/untblk.cxx
+++ b/sw/source/core/undo/untblk.cxx
@@ -321,14 +321,13 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & 
rContext)
         }
     }
 
-    SwNodeIndex& rIdx = rPam.GetPoint()->nNode;
-    SwTextNode* pTextNode = rIdx.GetNode().GetTextNode();
+    SwTextNode* pTextNode = rPam.GetPoint()->GetNode().GetTextNode();
     if( !pTextNode )
         return;
 
     if( !m_pTextFormatColl ) // if 0 than it's no TextNode -> delete
     {
-        SwNodeIndex aDelIdx( rIdx );
+        SwNodeIndex aDelIdx( *pTextNode );
         assert(SwNodeOffset(0) < m_nDeleteTextNodes && m_nDeleteTextNodes < 
SwNodeOffset(3));
         for (SwNodeOffset i(0); i < m_nDeleteTextNodes; ++i)
         {
@@ -348,8 +347,8 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & 
rContext)
         if( bJoinNext && pTextNode->CanJoinNext())
         {
             {
-                RemoveIdxRel( rIdx.GetIndex()+1,
-                    SwPosition( rIdx, pTextNode, 
pTextNode->GetText().getLength() ) );
+                RemoveIdxRel( pTextNode->GetIndex()+1,
+                    SwPosition( *pTextNode, pTextNode, 
pTextNode->GetText().getLength() ) );
             }
             pTextNode->JoinNext();
         }
@@ -429,7 +428,7 @@ void SwUndoInserts::RedoImpl(::sw::UndoRedoContext & 
rContext)
     m_pTextFormatColl = pSavTextFormatColl;
 
     if (m_pLastNodeColl && rDoc.GetTextFormatColls()->IsAlive(m_pLastNodeColl)
-        && rPam.GetPoint()->nNode != rPam.GetMark()->nNode)
+        && rPam.GetPoint()->GetNode() != rPam.GetMark()->GetNode())
     {
         SwTextNode* pTextNd = rPam.GetPoint()->GetNode().GetTextNode();
         if( pTextNd )
diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index ac4d4a04abe9..0cf271b70b0f 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -2122,7 +2122,7 @@ uno::Reference< text::XTextRange >  SwXShape::getAnchor()
             const SwPosition &rPos = 
*(pFormat->GetAnchor().GetContentAnchor());
             if (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA)
             {   // ensure that SwXTextRange has SwContentIndex
-                aRef = SwXTextRange::CreateXTextRange(*pFormat->GetDoc(), 
SwPosition(rPos.nNode), nullptr);
+                aRef = SwXTextRange::CreateXTextRange(*pFormat->GetDoc(), 
SwPosition(rPos.GetNode()), nullptr);
             }
             else
             {

Reply via email to