From 1085810635c1a666e31ca4614f5f32b30af5fb1d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 17 Aug 2022 18:53:35 +0200 Subject: convert more nNode to SwPosition::GetNode in places where we are using the result with operator< Change-Id: I3440d1204e69e30f21eaf833c2d0c42cde59e55c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138454 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/core/doc/DocumentContentOperationsManager.cxx | 16 ++++++++-------- sw/source/core/doc/docbm.cxx | 4 ++-- sw/source/core/doc/docedt.cxx | 2 +- sw/source/core/doc/docglbl.cxx | 4 ++-- sw/source/core/doc/docsort.cxx | 2 +- sw/source/core/doc/tblcpy.cxx | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) (limited to 'sw/source/core/doc') diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 866558d5bff1..5f027b12e204 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -911,10 +911,10 @@ namespace pTmpPos->Assign(rRg.aEnd); } } - else if( pRStt->nNode < rRg.aEnd ) + else if( pRStt->GetNode() < rRg.aEnd.GetNode() ) { rRedlTable.Remove( nRedlPos-- ); - if( pREnd->nNode < rRg.aEnd || + if( pREnd->GetNode() < rRg.aEnd.GetNode() || ( pREnd->GetNode() == rRg.aEnd.GetNode() && !pREnd->GetContentIndex()) ) { // move everything @@ -1854,7 +1854,7 @@ namespace //local functions originally from docfmt.cxx /* * The selection spans more than one Node. */ - if( pStt->nNode < pEnd->nNode ) + if( pStt->GetNode() < pEnd->GetNode() ) { pNode = pEnd->GetNode().GetContentNode(); if(pNode) @@ -2300,7 +2300,7 @@ bool DocumentContentOperationsManager::DelFullPara( SwPaM& rPam ) // note: here use <= not < like in // IsDestroyFrameAnchoredAtChar() because of the increment // of rPam in the bDoesUndo path above! - aRg.aStart <= pAPos->nNode && pAPos->nNode <= aRg.aEnd ) + aRg.aStart <= pAPos->GetNode() && pAPos->GetNode() <= aRg.aEnd.GetNode() ) { m_rDoc.getIDocumentLayoutAccess().DelLayoutFormat( pFly ); --n; @@ -2596,11 +2596,11 @@ bool DocumentContentOperationsManager::MoveNodeRange( SwNodeRange& rRange, SwNod SwRangeRedline* pTmp = m_rDoc.getIDocumentRedlineAccess().GetRedlineTable()[ nRedlPos ]; pRStt = pTmp->Start(); pREnd = pTmp->End(); - if( pREnd->GetNode() == rPos.GetNode() && pRStt->nNode < rPos ) + if( pREnd->GetNode() == rPos.GetNode() && pRStt->GetNode() < rPos.GetNode() ) { aSavRedlInsPosArr.push_back( pTmp ); } - } while( pRStt->nNode < rPos && ++nRedlPos < m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().size()); + } while( pRStt->GetNode() < rPos.GetNode() && ++nRedlPos < m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().size()); } } @@ -3629,7 +3629,7 @@ void DocumentContentOperationsManager::CopyWithFlyInFly( SwCopyFlags const flags) const { assert(!pCopiedPaM || pCopiedPaM->first.End()->GetNode() == rRg.aEnd.GetNode()); - assert(!pCopiedPaM || pCopiedPaM->second.nNode <= rInsPos); + assert(!pCopiedPaM || pCopiedPaM->second.GetNode() <= rInsPos.GetNode()); SwDoc& rDest = rInsPos.GetNode().GetDoc(); SwNodeIndex aSavePos( rInsPos ); @@ -3850,7 +3850,7 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl( // or a text frame then they have to be copied //- if the content index in this node is > 0 then paragraph and frame bound objects are copied //- to-character bound objects are copied if their index is <= nEndContentIndex - if (pAPos->nNode < rRg.aEnd) + if (pAPos->GetNode() < rRg.aEnd.GetNode()) bAdd = true; if (!bAdd && !m_rDoc.getIDocumentRedlineAccess().IsRedlineMove()) // fdo#40599: not for redline move { diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index f7d87e0daa86..2da73745fb2f 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -196,7 +196,7 @@ namespace bool lcl_Lower( const SwPosition& rPos, const SwNode& rNdIdx, std::optional oContentIdx ) { - return rPos.nNode < rNdIdx + return rPos.GetNode() < rNdIdx || ( oContentIdx.has_value() && rPos.GetNode() == rNdIdx && rPos.nContent < *oContentIdx ); @@ -209,7 +209,7 @@ namespace auto const& rSecondStart(pSecond->GetMarkStart()); if (rFirstStart.nNode != rSecondStart.nNode) { - return rFirstStart.nNode < rSecondStart.nNode; + return rFirstStart.GetNode() < rSecondStart.GetNode(); } const sal_Int32 nFirstContent = rFirstStart.GetContentIndex(); const sal_Int32 nSecondContent = rSecondStart.GetContentIndex(); diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 3d3812014f5e..e89f30e9f0f4 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -114,7 +114,7 @@ void SaveFlyInRange( const SwNodeRange& rRg, SaveFlyArr& rArr ) if (pAPos && ((RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId()) || (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId())) && - rRg.aStart <= pAPos->nNode && pAPos->nNode < rRg.aEnd ) + rRg.aStart <= pAPos->GetNode() && pAPos->GetNode() < rRg.aEnd.GetNode() ) { SaveFly aSave( pAPos->GetNodeIndex() - rRg.aStart.GetIndex(), (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId()) diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index 79dc2c885f82..2e9be7c67717 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -379,8 +379,8 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline, if (pAPos && ((RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId()) || (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId())) && - aSIdx <= pAPos->nNode && - pAPos->nNode < aEIdx ) + aSIdx <= pAPos->GetNode() && + pAPos->GetNode() < aEIdx.GetNode() ) { getIDocumentLayoutAccess().DelLayoutFormat( pFly ); --n; diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index 2708e1cbc13d..9623a62d6e75 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -292,7 +292,7 @@ bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) SwPosition const*const pAPos = pAnchor->GetContentAnchor(); if (pAPos && (RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId()) && - pStart->nNode <= pAPos->nNode && pAPos->nNode <= pEnd->nNode ) + pStart->GetNode() <= pAPos->GetNode() && pAPos->GetNode() <= pEnd->GetNode() ) return false; } diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx index b0fa499f0b3c..aaab4e837bee 100644 --- a/sw/source/core/doc/tblcpy.cxx +++ b/sw/source/core/doc/tblcpy.cxx @@ -546,7 +546,7 @@ static void lcl_CpyBox( const SwTable& rCpyTable, const SwTableBox* pCpyBox, if (pAPos && ((RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId()) || (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId())) && - aInsIdx <= pAPos->nNode && pAPos->nNode <= aEndNdIdx ) + aInsIdx <= pAPos->GetNode() && pAPos->GetNode() <= aEndNdIdx.GetNode() ) { pDoc->getIDocumentLayoutAccess().DelLayoutFormat( pFly ); } -- cgit