sw/inc/edimp.hxx | 1 + sw/source/core/edit/ednumber.cxx | 11 ++++++++--- sw/source/core/edit/edtab.cxx | 2 +- sw/source/core/frmedt/fecopy.cxx | 6 +++--- 4 files changed, 13 insertions(+), 7 deletions(-)
New commits: commit 0c04043aed64bc7800e4910bff47f86d229ed004 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Sat Aug 20 18:34:17 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sun Aug 21 08:46:59 2022 +0200 use more SwPosition::GetNode Change-Id: Iaf3b6430d444405a0e72435d8d03975226b3dba9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138594 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/inc/edimp.hxx b/sw/inc/edimp.hxx index ea2134875741..5c208677eb78 100644 --- a/sw/inc/edimp.hxx +++ b/sw/inc/edimp.hxx @@ -45,6 +45,7 @@ public: SwPamRanges( const SwPaM& rRing ); void Insert( const SwNodeIndex& rIdx1, const SwNodeIndex& rIdx2 ); + void Insert( const SwNode& rIdx1, const SwNode& rIdx2 ); SwPaM& SetPam( size_t nArrPos, SwPaM& rPam ); size_t Count() const diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx index 9e36f89cc0ff..6ff940036dca 100644 --- a/sw/source/core/edit/ednumber.cxx +++ b/sw/source/core/edit/ednumber.cxx @@ -31,10 +31,15 @@ SwPamRanges::SwPamRanges( const SwPaM& rRing ) { for(SwPaM& rTmp : const_cast<SwPaM*>(&rRing)->GetRingContainer()) - Insert( rTmp.GetMark()->nNode, rTmp.GetPoint()->nNode ); + Insert( rTmp.GetMark()->GetNode(), rTmp.GetPoint()->GetNode() ); } void SwPamRanges::Insert( const SwNodeIndex& rIdx1, const SwNodeIndex& rIdx2 ) +{ + Insert(rIdx1.GetNode(), rIdx2.GetNode()); +} + +void SwPamRanges::Insert( const SwNode& rIdx1, const SwNode& rIdx2 ) { SwPamRange aRg( rIdx1.GetIndex(), rIdx2.GetIndex() ); if( aRg.nEnd < aRg.nStart ) @@ -704,9 +709,9 @@ const SwNumRule* SwEditShell::GetNumRuleAtCurrentSelection() const bool bDifferentNumRuleFound = false; for(const SwPaM& rCurrentCursor : GetCursor()->GetRingContainer()) { - const SwNodeIndex aEndNode = rCurrentCursor.End()->nNode; + const SwNode& rEndNode(rCurrentCursor.End()->GetNode()); - for ( SwNodeIndex aNode = rCurrentCursor.Start()->nNode; aNode <= aEndNode; ++aNode ) + for ( SwNodeIndex aNode(rCurrentCursor.Start()->GetNode()); aNode <= rEndNode; ++aNode ) { SwPosition pos(aNode); const SwNumRule* pNumRule = SwDoc::GetNumRuleAtPos(pos, GetLayout()); diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx index 0fad9aae9401..6e83806595b7 100644 --- a/sw/source/core/edit/edtab.cxx +++ b/sw/source/core/edit/edtab.cxx @@ -151,7 +151,7 @@ bool SwEditShell::TableToText( sal_Unicode cCh ) SwWait aWait( *GetDoc()->GetDocShell(), true ); SwPaM* pCursor = GetCursor(); const SwTableNode* pTableNd = - SwDoc::IsIdxInTable( pCursor->GetPoint()->nNode ); + SwDoc::IsInTable( pCursor->GetPoint()->GetNode() ); if (!pTableNd) return false; diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index e67852b2d5ce..0f301dd4b95d 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -939,7 +939,7 @@ bool SwFEShell::Paste(SwDoc& rClpDoc, bool bNestedTable) SwPaM& rCopy = *item.first; const SwStartNode* pBoxNd = rInsPos.GetNode().FindTableBoxStartNode(); if( pBoxNd && SwNodeOffset(2) == pBoxNd->EndOfSectionIndex() - pBoxNd->GetIndex() && - rCopy.GetPoint()->nNode != rCopy.GetMark()->nNode ) + rCopy.GetPoint()->GetNode() != rCopy.GetMark()->GetNode() ) { // if more than one node will be copied into a cell // the box attributes have to be removed @@ -966,7 +966,7 @@ bool SwFEShell::Paste(SwDoc& rClpDoc, bool bNestedTable) for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { - SwTableNode *const pDestNd(SwDoc::IsIdxInTable(rPaM.GetPoint()->nNode)); + SwTableNode *const pDestNd(SwDoc::IsInTable(rPaM.GetPoint()->GetNode())); if (pSrcNd && nullptr != pDestNd && // not a forced nested table insertion !bNestedTable && @@ -1074,7 +1074,7 @@ bool SwFEShell::Paste(SwDoc& rClpDoc, bool bNestedTable) FindTableBoxStartNode(); if( pBoxNd && SwNodeOffset(2) == pBoxNd->EndOfSectionIndex() - pBoxNd->GetIndex() && - aCpyPam.GetPoint()->nNode != aCpyPam.GetMark()->nNode ) + aCpyPam.GetPoint()->GetNode() != aCpyPam.GetMark()->GetNode() ) { // Copy more than 1 node in the current box. But // then the BoxAttribute should be removed