sw/source/core/access/parachangetrackinginfo.cxx | 2 +- sw/source/core/crsr/crstrvl.cxx | 4 ++-- sw/source/core/crsr/swcrsr.cxx | 2 +- sw/source/core/doc/DocumentContentOperationsManager.cxx | 6 +++--- sw/source/core/doc/DocumentRedlineManager.cxx | 4 ++-- sw/source/core/doc/docbm.cxx | 6 +++--- sw/source/core/doc/docedt.cxx | 8 ++++---- sw/source/core/doc/docnum.cxx | 6 +++--- sw/source/core/doc/docredln.cxx | 4 ++-- sw/source/core/docnode/ndtbl.cxx | 4 ++-- sw/source/core/docnode/section.cxx | 4 ++-- sw/source/core/edit/edlingu.cxx | 2 +- sw/source/core/frmedt/fecopy.cxx | 4 ++-- sw/source/core/table/swtable.cxx | 2 +- sw/source/core/text/porlay.cxx | 2 +- sw/source/core/txtnode/txtedt.cxx | 2 +- 16 files changed, 31 insertions(+), 31 deletions(-)
New commits: commit dcd45e25407bc4e50a3faa1ede9c1c3149c21ad7 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Wed Aug 17 07:54:24 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Aug 17 20:52:58 2022 +0200 convert more nNode to SwPosition::GetNode in places where we are using the result with operator< Change-Id: I2aae14e9130efc31f5afd3450defdf6df4099950 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138403 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/access/parachangetrackinginfo.cxx b/sw/source/core/access/parachangetrackinginfo.cxx index 41f697af60bf..b20d9702e744 100644 --- a/sw/source/core/access/parachangetrackinginfo.cxx +++ b/sw/source/core/access/parachangetrackinginfo.cxx @@ -86,7 +86,7 @@ namespace { ++nActRedline) { const SwRangeRedline* pActRedline = rRedlineTable[ nActRedline ]; - if ( pActRedline->Start()->nNode > rTextNode.GetIndex() ) + if ( pActRedline->Start()->GetNode() > rTextNode ) { break; } diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 2f22db198aa3..759b8bc9b847 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -328,8 +328,8 @@ bool SwCursorShell::GotoPrevTOXBase( const OUString* pName ) SwSectionNode const*const pSectNd( pSect->GetFormat()->GetSectionNode()); if ( pSectNd - && m_pCurrentCursor->GetPoint()->nNode > pSectNd->EndOfSectionIndex() - && (!pFnd || pFnd->GetIndex() < pSectNd->GetIndex()) + && m_pCurrentCursor->GetPoint()->GetNode() > *pSectNd->EndOfSectionNode() + && (!pFnd || *pFnd < *pSectNd) && (!pName || *pName == static_cast<SwTOXBaseSection const*>(pSect)->GetTOXName())) { diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index ce4c35cf8f75..884d9f7fedd3 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -1536,7 +1536,7 @@ static OUString lcl_MaskDeletedRedlines( const SwTextNode* pTextNd ) for ( ; nAct < rDoc.getIDocumentRedlineAccess().GetRedlineTable().size(); nAct++ ) { const SwRangeRedline* pRed = rDoc.getIDocumentRedlineAccess().GetRedlineTable()[ nAct ]; - if ( pRed->Start()->nNode > pTextNd->GetIndex() ) + if ( pRed->Start()->GetNode() > *pTextNd ) break; if( RedlineType::Delete == pRed->GetType() ) diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 65f566b4c795..866558d5bff1 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -890,9 +890,9 @@ namespace auto [pRStt, pREnd] = pTmp->StartEnd(); // SwPosition* - if( pRStt->nNode < rRg.aStart ) + if( pRStt->GetNode() < rRg.aStart.GetNode() ) { - if( pREnd->nNode > rRg.aStart && pREnd->nNode < rRg.aEnd ) + if( pREnd->GetNode() > rRg.aStart.GetNode() && pREnd->GetNode() < rRg.aEnd.GetNode() ) { // Create a copy and set the end of the original to the end of the MoveArea. // The copy is moved too. @@ -3843,7 +3843,7 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl( { if (nStart > nSkipAfter) continue; - if (pAPos->nNode > rRg.aEnd) + if (pAPos->GetNode() > rRg.aEnd.GetNode()) continue; //frames at the last source node are not always copied: //- if the node is empty and is the last node of the document or a table cell diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 5c1353989b38..d69f4b3be223 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -2734,14 +2734,14 @@ bool DocumentRedlineManager::HasRedline( const SwPaM& rPam, RedlineType nType, b { SwPosition currentStart(*rPam.Start()); SwPosition currentEnd(*rPam.End()); - SwNodeIndex pEndNodeIndex(currentEnd.GetNode()); + const SwNode& rEndNode(currentEnd.GetNode()); for( SwRedlineTable::size_type n = GetRedlinePos( rPam.Start()->GetNode(), nType ); n < maRedlineTable.size(); ++n ) { const SwRangeRedline* pTmp = maRedlineTable[ n ]; - if ( pTmp->Start()->nNode > pEndNodeIndex ) + if ( pTmp->Start()->GetNode() > rEndNode ) break; if( RedlineType::Any != nType && nType != pTmp->GetType() ) diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index a4b38b911d6c..f7d87e0daa86 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -188,10 +188,10 @@ namespace bool lcl_GreaterThan( const SwPosition& rPos, const SwNode& rNdIdx, std::optional<sal_Int32> oContentIdx ) { return oContentIdx.has_value() - ? ( rPos.nNode > rNdIdx + ? ( rPos.GetNode() > rNdIdx || ( rPos.GetNode() == rNdIdx && rPos.nContent >= *oContentIdx ) ) - : rPos.nNode >= rNdIdx; + : rPos.GetNode() >= rNdIdx; } bool lcl_Lower( const SwPosition& rPos, const SwNode& rNdIdx, std::optional<sal_Int32> oContentIdx ) @@ -1782,7 +1782,7 @@ namespace { bool lcl_Greater( const SwPosition& rPos, const SwNode& rNdIdx, std::optional<sal_Int32> oContentIdx ) { - return rPos.nNode > rNdIdx || ( oContentIdx && rPos.GetNode() == rNdIdx && rPos.nContent > *oContentIdx ); + return rPos.GetNode() > rNdIdx || ( oContentIdx && rPos.GetNode() == rNdIdx && rPos.nContent > *oContentIdx ); } } diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 7f0f126dad44..3d3812014f5e 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -162,8 +162,8 @@ void SaveFlyInRange( const SwPaM& rPam, const SwPosition& rInsPos, (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId())) && // do not move if the InsPos is in the ContentArea of the Fly ( nullptr == ( pContentIdx = pFormat->GetContent().GetContentIdx() ) || - (*pContentIdx >= rInsPos.nNode || - rInsPos.nNode >= pContentIdx->GetNode().EndOfSectionIndex()))) + (*pContentIdx >= rInsPos.GetNode() || + rInsPos.GetNode() >= *pContentIdx->GetNode().EndOfSectionNode()))) { bool bInsPos = false; @@ -350,8 +350,8 @@ void sw_GetJoinFlags( SwPaM& rPam, bool& rJoinText, bool& rJoinPrev ) rJoinPrev = rPam.GetPoint() == pStt; OSL_ENSURE( !pStt->GetContentIndex() && pEndNd->GetText().getLength() != pEnd->GetContentIndex() - ? (rPam.GetPoint()->nNode < rPam.GetMark()->nNode) - : (rPam.GetPoint()->nNode > rPam.GetMark()->nNode), + ? (rPam.GetPoint()->GetNode() < rPam.GetMark()->GetNode()) + : (rPam.GetPoint()->GetNode() > rPam.GetMark()->GetNode()), "sw_GetJoinFlags"); } diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index b7f774b1dbf6..b8a98703a697 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -2091,9 +2091,9 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset const nOffset, const SwContentNode* pCEndNd = pEnd->GetNode().GetContentNode(); // Is completely in the range and is the own Redline too? if( aTmpRedl.IsOwnRedline( *pTmp ) && - (pRStt->nNode < pStt->nNode || + (pRStt->GetNode() < pStt->GetNode() || (pRStt->GetNode() == pStt->GetNode() && !pRStt->GetContentIndex()) ) && - (pEnd->nNode < pREnd->nNode || + (pEnd->GetNode() < pREnd->GetNode() || (pEnd->GetNode() == pREnd->GetNode() && pCEndNd ? pREnd->GetContentIndex() == pCEndNd->Len() : !pREnd->GetContentIndex() )) ) @@ -2108,7 +2108,7 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset const nOffset, } if( pOwnRedl && - ( pRStt->nNode > aIdx || aIdx > pREnd->nNode || + ( pRStt->GetNode() > aIdx.GetNode() || aIdx > pREnd->GetNode() || // pOwnRedl doesn't start at the beginning of a node, so it's not // possible to resize it to contain the line moved before it ( pRStt->GetNode() == aIdx.GetNode() && pRStt->GetContentIndex() > 0 ) ) ) diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index c44775391a44..565bf4d29d4d 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -909,13 +909,13 @@ void SwRedlineExtraData_FormatColl::Reject( SwPaM& rPam ) const if ( !m_bFormatAll || pEnd->GetContentIndex() == 0 ) { // don't reject the format of the next paragraph (that is handled by the next redline) - if (aPam.GetPoint()->nNode > aPam.GetMark()->nNode) + if (aPam.GetPoint()->GetNode() > aPam.GetMark()->GetNode()) { aPam.GetPoint()->nNode--; SwContentNode* pNode = aPam.GetPoint()->GetNode().GetContentNode(); aPam.GetPoint()->nContent.Assign( pNode, pNode->Len() ); } - else if (aPam.GetPoint()->nNode < aPam.GetMark()->nNode) + else if (aPam.GetPoint()->GetNode() < aPam.GetMark()->GetNode()) { aPam.GetMark()->nNode--; SwContentNode* pNode = aPam.GetMark()->GetNode().GetContentNode(); diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 6c85bb0a3336..edcbf151ce31 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -351,8 +351,8 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTableOpts, { // Do not copy into Footnotes! - if( rPos.nNode < GetNodes().GetEndOfInserts().GetIndex() && - rPos.nNode >= GetNodes().GetEndOfInserts().StartOfSectionIndex() ) + if( rPos.GetNode() < GetNodes().GetEndOfInserts() && + rPos.GetNode().GetIndex() >= GetNodes().GetEndOfInserts().StartOfSectionIndex() ) return nullptr; // If the ColumnArray has a wrong count, ignore it! diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 0ac078f1d3ba..324dae6d22a7 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -1234,8 +1234,8 @@ static void lcl_UpdateLinksInSect( const SwBaseLink& rUpdLnk, SwSectionNode& rSe && pCpyPam ) { if( pSrcDoc != pDoc || - pCpyPam->Start()->nNode > rInsPos || - rInsPos >= pCpyPam->End()->nNode ) + pCpyPam->Start()->GetNode() > rInsPos.GetNode() || + rInsPos >= pCpyPam->End()->GetNode() ) { pSrcDoc->getIDocumentContentOperations().CopyRange(*pCpyPam, *pPam->GetPoint(), SwCopyFlags::CheckPosInFly); } diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 52d8c0a553b9..00590e931fbb 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -1256,7 +1256,7 @@ static SpellContentPositions lcl_CollectDeletedRedlines(SwEditShell const * pSh) { const SwRangeRedline* pRed = pDoc->getIDocumentRedlineAccess().GetRedlineTable()[ nAct ]; - if ( pRed->Start()->nNode > pTextNode->GetIndex() ) + if ( pRed->Start()->GetNode() > *pTextNode ) break; if( RedlineType::Delete == pRed->GetType() ) diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index f44e8e597100..7004c7e5b698 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -494,8 +494,8 @@ bool SwFEShell::Copy( SwFEShell& rDestShell, const Point& rSttPt, { // do not copy in itself const SwNodeIndex *pTmp = pFlyFormat->GetContent().GetContentIdx(); - if ( aPos.nNode > *pTmp && aPos.nNode < - pTmp->GetNode().EndOfSectionIndex() ) + if ( aPos.GetNodeIndex() > pTmp->GetIndex() && + aPos.GetNodeIndex() < pTmp->GetNode().EndOfSectionIndex() ) { bRet = false; } diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 554617e81ec0..bf5ee443661f 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -1646,7 +1646,7 @@ SwRedlineTable::size_type SwTableLine::UpdateTextChangesOnly( { const SwRangeRedline* pRedline = aRedlineTable[ rRedlinePos ]; - if ( pRedline->Start()->nNode > pEndNodeIndex ) + if ( pRedline->Start()->GetNodeIndex() > pEndNodeIndex.GetIndex() ) { // no more redlines in the actual cell, // check the next ones diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 86cf7d6c6454..dca9757a1365 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -2753,7 +2753,7 @@ void SwScriptInfo::selectRedLineDeleted(const SwTextNode& rNode, MultiSelection { const SwRangeRedline* pRed = rIDRA.GetRedlineTable()[ nAct ]; - if (pRed->Start()->nNode > rNode.GetIndex()) + if (pRed->Start()->GetNode() > rNode) break; if (pRed->GetType() != RedlineType::Delete) diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 1ac899955d3c..05a830ef6082 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -157,7 +157,7 @@ lcl_MaskRedlines( const SwTextNode& rNode, OUStringBuffer& rText, { const SwRangeRedline* pRed = rDoc.getIDocumentRedlineAccess().GetRedlineTable()[ nAct ]; - if ( pRed->Start()->nNode > rNode.GetIndex() ) + if ( pRed->Start()->GetNode() > rNode ) break; if( RedlineType::Delete == pRed->GetType() )