diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-08-22 18:27:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-08-23 14:30:08 +0200 |
commit | fc10c4a3a7700fc96890149ae9095206b5e67685 (patch) | |
tree | 11346c4dd32bd5d88b45b2a80dccb1411a19cb36 /sw | |
parent | 0d73352d7b8a26c4655ce138cab1cecab15ff053 (diff) |
use more SwPosition::GetNode
Change-Id: Iad8d3247062f459960767487d603711aff01f10e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138698
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/docnum.cxx | 13 | ||||
-rw-r--r-- | sw/source/core/doc/docredln.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/doc/docsort.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/docnode/ndsect.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/docnode/node.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/docnode/section.cxx | 6 |
7 files changed, 22 insertions, 23 deletions
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 7bd6ccdc07dc..c468d526249b 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -69,8 +69,8 @@ namespace { if ( rPam.HasMark() && rPam.End()->GetNode().GetTextNode() ) { - SwPaM aPam( rPam.Start()->nNode, 0, - rPam.End()->nNode, rPam.End()->GetNode().GetTextNode()->Len() ); + SwPaM aPam( rPam.Start()->GetNode(), 0, + rPam.End()->GetNode(), rPam.End()->GetNode().GetTextNode()->Len() ); pDoc->ResetAttrs( aPam, false, aResetAttrsArray, true, pLayout ); } else @@ -1297,8 +1297,7 @@ bool SwDoc::NoNum( const SwPaM& rPam ) if( bRet ) { // Set NoNum and Update - const SwNodeIndex& rIdx = rPam.GetPoint()->nNode; - SwTextNode* pNd = rIdx.GetNode().GetTextNode(); + SwTextNode* pNd = rPam.GetPoint()->GetNode().GetTextNode(); const SwNumRule* pRule = pNd->GetNumRule(); if( pRule ) { @@ -2075,8 +2074,8 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset const nOffset, SwDataChanged aTmp( rPam ); } - SwNodeIndex aIdx( nOffset > SwNodeOffset(0) ? pEnd->nNode : pStt->nNode, nOffs ); - SwNodeRange aMvRg( pStt->nNode, SwNodeOffset(0), pEnd->nNode, SwNodeOffset(+1) ); + SwNodeIndex aIdx( nOffset > SwNodeOffset(0) ? pEnd->GetNode() : pStt->GetNode(), nOffs ); + SwNodeRange aMvRg( pStt->GetNode(), SwNodeOffset(0), pEnd->GetNode(), SwNodeOffset(+1) ); SwRangeRedline* pOwnRedl = nullptr; if( getIDocumentRedlineAccess().IsRedlineOn() ) @@ -2126,7 +2125,7 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, SwNodeOffset const nOffset, // First the Insert, then the Delete SwPosition aInsPos( aIdx ); - SwPaM aPam( pStt->nNode, 0, aMvRg.aEnd, 0 ); + SwPaM aPam( pStt->GetNode(), 0, aMvRg.aEnd.GetNode(), 0 ); SwPaM& rOrigPam(rPam); rOrigPam.DeleteMark(); diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 05a8351c0328..1b0bb83f6c19 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -528,7 +528,7 @@ std::vector<SwRangeRedline*> GetAllValidRanges(std::unique_ptr<SwRangeRedline> p if( *pNew->GetPoint() > *pEnd ) { pC = nullptr; - if( aNewStt.nNode != pEnd->nNode ) + if( aNewStt.GetNode() != pEnd->GetNode() ) do { SwNode& rCurNd = aNewStt.GetNode(); if( rCurNd.IsStartNode() ) @@ -1630,7 +1630,7 @@ void SwRangeRedline::CopyToSection() } else { - SwNodeRange aRg( pStt->nNode, SwNodeOffset(0), pEnd->nNode, SwNodeOffset(1) ); + SwNodeRange aRg( pStt->GetNode(), SwNodeOffset(0), pEnd->GetNode(), SwNodeOffset(1) ); rDoc.GetDocumentContentOperationsManager().CopyWithFlyInFly(aRg, *pSttNd->EndOfSectionNode()); } } @@ -1780,8 +1780,8 @@ void SwRangeRedline::MoveFromSection(size_t nMyPos) else ++aPam.GetPoint()->nNode; - SwFormatColl* pColl = pCNd && pCNd->Len() && aPam.GetPoint()->nNode != - aPam.GetMark()->nNode + SwFormatColl* pColl = pCNd && pCNd->Len() && aPam.GetPoint()->GetNode() != + aPam.GetMark()->GetNode() ? pCNd->GetFormatColl() : nullptr; SwNodeIndex aNdIdx( GetPoint()->GetNode(), -1 ); diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index 7c172b089ae4..1252a941e7df 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -319,7 +319,7 @@ bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) // To-Do - add 'SwExtraRedlineTable' also ? if( getIDocumentRedlineAccess().IsRedlineOn() || (!getIDocumentRedlineAccess().IsIgnoreRedline() && !getIDocumentRedlineAccess().GetRedlineTable().empty() )) { - pRedlPam = new SwPaM( pStart->nNode, pEnd->nNode, SwNodeOffset(-1), SwNodeOffset(1) ); + pRedlPam = new SwPaM( pStart->GetNode(), pEnd->GetNode(), SwNodeOffset(-1), SwNodeOffset(1) ); SwContentNode* pCNd = pRedlPam->GetMarkContentNode(); if( pCNd ) pRedlPam->GetMark()->nContent = pCNd->Len(); @@ -332,8 +332,8 @@ bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) GetIDocumentUndoRedo().DoUndo(false); } // First copy the range - SwNodeIndex aEndIdx( pEnd->nNode, 1 ); - SwNodeRange aRg( pStart->nNode, aEndIdx ); + SwNodeIndex aEndIdx( pEnd->GetNode(), 1 ); + SwNodeRange aRg( pStart->GetNode(), aEndIdx.GetNode() ); GetNodes().Copy_( aRg, aEndIdx.GetNode() ); // range is new from pEnd->nNode+1 to aEndIdx diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 779e286ffdbb..5fb4438bb438 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -831,7 +831,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNode& rNd, { SwRangeRedline* pRedline = rRedlines[nIndex]; if ( RedlineType::Delete != pRedline->GetType() || - !pRedline->HasMark() || pRedline->GetMark()->nNode != aInsPos ) + !pRedline->HasMark() || pRedline->GetMark()->GetNode() != aInsPos.GetNode() ) { continue; } diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 8070e65985db..556f9a11a869 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -659,7 +659,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTableOpts, ::PaMCorrAbs( aOriginal, *pEnd ); // Make sure that the range is on Node Edges - SwNodeRange aRg( pStt->nNode, pEnd->nNode ); + SwNodeRange aRg( pStt->GetNode(), pEnd->GetNode() ); if( pStt->GetContentIndex() ) getIDocumentContentOperations().SplitNode( *pStt, false ); @@ -1158,7 +1158,7 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> > ::PaMCorrAbs( aOriginal, *pEnd ); // make sure that the range is on Node Edges - SwNodeRange aRg( pStt->nNode, pEnd->nNode ); + SwNodeRange aRg( pStt->GetNode(), pEnd->GetNode() ); if( pStt->GetContentIndex() ) getIDocumentContentOperations().SplitNode( *pStt, false ); @@ -1180,8 +1180,8 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> > ++aRg.aEnd; } - assert(aRg.aEnd == pEnd->nNode); - assert(aRg.aStart == pStt->nNode); + assert(aRg.aEnd.GetNode() == pEnd->GetNode()); + assert(aRg.aStart.GetNode() == pStt->GetNode()); if( aRg.aEnd.GetIndex() == aRg.aStart.GetIndex() ) { OSL_FAIL( "empty range" ); diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index d02d70258312..58096ad98047 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -585,7 +585,7 @@ const SwPageDesc* SwNode::FindPageDesc( SwNodeOffset* pPgDescNdIdx ) const break; } - pFlyNd = pAnchor->GetContentAnchor()->nNode. + pFlyNd = pAnchor->GetContentAnchor()-> GetNode().FindFlyStartNode(); break; } diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 34a15de0971b..f6a1297fb704 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -1226,7 +1226,7 @@ static void lcl_UpdateLinksInSect( const SwBaseLink& rUpdLnk, SwSectionNode& rSe } } - SwNodeIndex& rInsPos = pPam->GetPoint()->nNode; + SwNode& rInsPos = pPam->GetPoint()->GetNode(); SwPaM* pCpyPam = nullptr; if( !bRecursion && @@ -1234,7 +1234,7 @@ static void lcl_UpdateLinksInSect( const SwBaseLink& rUpdLnk, SwSectionNode& rSe && pCpyPam ) { if( pSrcDoc != pDoc || - pCpyPam->Start()->GetNode() > rInsPos.GetNode() || + pCpyPam->Start()->GetNode() > rInsPos || rInsPos >= pCpyPam->End()->GetNode() ) { pSrcDoc->getIDocumentContentOperations().CopyRange(*pCpyPam, *pPam->GetPoint(), SwCopyFlags::CheckPosInFly); @@ -1242,7 +1242,7 @@ static void lcl_UpdateLinksInSect( const SwBaseLink& rUpdLnk, SwSectionNode& rSe delete pCpyPam; } if( oCpyRg && pSrcDoc == pDoc && - oCpyRg->aStart < rInsPos && rInsPos < oCpyRg->aEnd ) + oCpyRg->aStart < rInsPos && rInsPos < oCpyRg->aEnd.GetNode() ) { oCpyRg.reset(); } |