sw/source/core/crsr/crstrvl.cxx                         |    4 ++--
 sw/source/core/crsr/pam.cxx                             |    8 ++++----
 sw/source/core/doc/DocumentContentOperationsManager.cxx |    4 ++--
 sw/source/core/doc/DocumentRedlineManager.cxx           |    4 ++--
 sw/source/core/doc/docfmt.cxx                           |    2 +-
 sw/source/core/doc/docredln.cxx                         |    2 +-
 sw/source/core/doc/docsort.cxx                          |    2 +-
 sw/source/core/undo/undobj.cxx                          |    2 +-
 sw/source/core/unocore/unoobj2.cxx                      |    4 ++--
 9 files changed, 16 insertions(+), 16 deletions(-)

New commits:
commit 4478a78767e1d03126de4d875704a6b88ff132cc
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Thu Aug 18 18:35:09 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Aug 19 09:33:56 2022 +0200

    convert more nNode to SwPosition::GetNode
    
    in places where we are using the result with operator<
    
    Change-Id: I2859b3e45bca141401feb557a27b4643280f8c27
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138502
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 6993d5810c65..be4b081bf7b4 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -278,7 +278,7 @@ bool SwCursorShell::GotoNextTOXBase( const OUString* pName )
             SwSectionNode const*const pSectNd(
                     pSect->GetFormat()->GetSectionNode());
             if (   pSectNd
-                && m_pCurrentCursor->GetPoint()->nNode < pSectNd->GetIndex()
+                && m_pCurrentCursor->GetPoint()->GetNode() < *pSectNd
                 && (!pFnd  || pFnd->GetIndex() > pSectNd->GetIndex())
                 && (!pName || *pName ==
                     static_cast<SwTOXBaseSection const*>(pSect)->GetTOXName()))
@@ -2412,7 +2412,7 @@ const SwRangeRedline* SwCursorShell::GotoRedline_( 
SwRedlineTable::size_type nAr
                                     true, IsReadOnlyAvailable() );
             if( pCNd )
             {
-                if( *pIdx <= pFnd->End()->nNode )
+                if( *pIdx <= pFnd->End()->GetNode() )
                     m_pCurrentCursor->GetPoint()->nContent.Assign( pCNd, 0 );
                 else
                     pFnd = nullptr;
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index dd2da8a80897..4154ed39b176 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -896,7 +896,7 @@ bool SwPaM::HasReadonlySel( bool bFormView ) const
     {
         SwPosition const& rStart(*Start());
         SwPosition const& rEnd(*End());
-        for (SwNodeIndex n = rStart.nNode; n <= rEnd.nNode; ++n)
+        for (SwNodeIndex n(rStart.GetNode()); n <= rEnd.GetNode(); ++n)
         {
             if (SwTextNode const*const pNode = n.GetNode().GetTextNode())
             {
@@ -905,11 +905,11 @@ bool SwPaM::HasReadonlySel( bool bFormView ) const
                     for (size_t i = 0; i < pHints->Count(); ++i)
                     {
                         SwTextAttr const*const pHint(pHints->Get(i));
-                        if (n == rStart.nNode && pHint->GetStart() < 
rStart.GetContentIndex())
+                        if (n == rStart.GetNode() && pHint->GetStart() < 
rStart.GetContentIndex())
                         {
                             continue; // before selection
                         }
-                        if (n == rEnd.nNode && rEnd.GetContentIndex() <= 
pHint->GetStart())
+                        if (n == rEnd.GetNode() && rEnd.GetContentIndex() <= 
pHint->GetStart())
                         {
                             break; // after selection
                         }
@@ -1278,7 +1278,7 @@ OUString SwPaM::GetText() const
 
 void SwPaM::InvalidatePaM()
 {
-    for (SwNodeIndex index = Start()->nNode; index <= End()->nNode; ++index)
+    for (SwNodeIndex index(Start()->GetNode()); index <= End()->GetNode(); 
++index)
     {
         if (SwTextNode *const pTextNode = index.GetNode().GetTextNode())
         {
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 5f027b12e204..93529a5fbbdd 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -5269,9 +5269,9 @@ bool 
DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo
     rPos.nContent.Assign( rPos.GetNode().GetContentNode(),
                             rPos.GetContentIndex() );
 
-    if( rPos.nNode != aInsPos )
+    if( rPos.GetNode() != aInsPos.GetNode() )
     {
-        if (aInsPos < rPos.nNode)
+        if (aInsPos < rPos.GetNode())
         {   // tdf#134250 decremented in (pEndTextNd && !pDestTextNd) above
             
pCopyPam->GetMark()->AssignEndIndex(*aInsPos.GetNode().GetContentNode());
         }
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index d69f4b3be223..01e780c1d265 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -3202,7 +3202,7 @@ const SwRangeRedline* 
DocumentRedlineManager::SelNextRedline( SwPaM& rPam ) cons
                 pCNd = m_rDoc.GetNodes().GoNextSection( pIdx );
                 if( pCNd )
                 {
-                    if( *pIdx <= rPam.GetPoint()->nNode )
+                    if( *pIdx <= rPam.GetPoint()->GetNode() )
                         rPam.GetMark()->nContent.Assign( pCNd, 0 );
                     else
                         pFnd = nullptr;
@@ -3344,7 +3344,7 @@ const SwRangeRedline* 
DocumentRedlineManager::SelPrevRedline( SwPaM& rPam ) cons
                     pCNd = m_rDoc.GetNodes().GoNextSection( pIdx );
                     if( pCNd )
                     {
-                        if( *pIdx <= rPam.GetMark()->nNode )
+                        if( *pIdx <= rPam.GetMark()->GetNode() )
                             rPam.GetPoint()->nContent.Assign( pCNd, 0 );
                         else
                             pFnd = nullptr;
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 43e1e24e9b25..91091116aad1 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1648,7 +1648,7 @@ void SwDoc::MoveLeftMargin(const SwPaM& rPam, bool 
bRight, bool bModulus,
     const sal_Int32 nDefDist = rTabItem.Count() ? rTabItem[0].GetTabPos() : 
1134;
     const SwPosition &rStt = *rPam.Start(), &rEnd = *rPam.End();
     SwNodeIndex aIdx( rStt.nNode );
-    while( aIdx <= rEnd.nNode )
+    while( aIdx <= rEnd.GetNode() )
     {
         SwTextNode* pTNd = aIdx.GetNode().GetTextNode();
         if( pTNd )
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 565bf4d29d4d..ad84d7b58c82 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -386,7 +386,7 @@ void 
SwRedlineTable::LOKRedlineNotification(RedlineNotification nType, SwRangeRe
         {
             pSh = rDoc.getIDocumentLayoutAccess().GetCurrentViewShell();
             if( pSh )
-                for(SwNodeIndex nIdx = pStartPos->nNode; nIdx <= 
pEndPos->nNode; ++nIdx)
+                for(SwNodeIndex nIdx(pStartPos->GetNode()); nIdx <= 
pEndPos->GetNode(); ++nIdx)
                 {
                     SwContentNode* pContentNode = 
nIdx.GetNode().GetContentNode();
                     if (pContentNode)
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index 9623a62d6e75..7c172b089ae4 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -369,7 +369,7 @@ bool SwDoc::SortText(const SwPaM& rPaM, const 
SwSortOptions& rOpt)
     SwNodeIndex aStart(pStart->GetNode());
     SwSortElement::Init( this, rOpt );
     std::multiset<SwSortTextElement> aSortSet;
-    while( aStart <= pEnd->nNode )
+    while( aStart <= pEnd->GetNode() )
     {
         // Iterate over a selected range
         aSortSet.insert(SwSortTextElement(aStart));
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 34d5de35d581..99c316bd0915 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1665,7 +1665,7 @@ bool IsSelectFrameAnchoredAtPara(SwPosition const & 
rAnchorPos,
         // stupid code temp. overrides it - instead rely on setting the ALLFLYS
         // flag in MoveFromSection() and converting that to CheckNoCntnt with
         // adjusted cursor!
-        return (rStart.GetNode() < rAnchorPos.GetNode()) && (rAnchorPos.nNode 
< rEnd.GetNode());
+        return (rStart.GetNode() < rAnchorPos.GetNode()) && 
(rAnchorPos.GetNode() < rEnd.GetNode());
     }
 
     // in general, exclude the start and end position
diff --git a/sw/source/core/unocore/unoobj2.cxx 
b/sw/source/core/unocore/unoobj2.cxx
index beab3975a53b..2661081665d1 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -876,7 +876,7 @@ void SwXTextRange::DeleteAndInsert(
         aCursor.SetMark();
         *aCursor.GetPoint() = SwPosition(end);
         aCursor.Move( fnMoveBackward, GoInContent );
-        assert(start <= aCursor.GetPoint()->nNode);
+        assert(start <= aCursor.GetPoint()->GetNode());
     }
     else
     {
@@ -1032,7 +1032,7 @@ SwXTextRange::getEnd()
         auto const pSectFormat(static_cast<SwSectionFormat 
const*>(m_pImpl->m_pTableOrSectionFormat));
         SwPaM 
aPaM(*pSectFormat->GetContent().GetContentIdx()->GetNode().EndOfSectionNode());
         aPaM.Move( fnMoveBackward, GoInContent );
-        assert(*pSectFormat->GetContent().GetContentIdx() < 
aPaM.GetPoint()->nNode);
+        assert(*pSectFormat->GetContent().GetContentIdx() < 
aPaM.GetPoint()->GetNode());
         xRet = new SwXTextRange(aPaM, m_pImpl->m_xParentText);
     }
     else

Reply via email to