sw/source/core/doc/DocumentContentOperationsManager.cxx | 4 +-- sw/source/core/doc/docedt.cxx | 20 ++++++++-------- sw/source/core/doc/doctxm.cxx | 2 - sw/source/core/docnode/section.cxx | 2 - sw/source/core/inc/mvsave.hxx | 4 +-- 5 files changed, 16 insertions(+), 16 deletions(-)
New commits: commit 56cf1d210b4d0d0f80c8c197866b706c619ece82 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Aug 10 14:01:50 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Aug 13 11:05:54 2022 +0200 pass SwNode to DelFlyInRange instead of SwNodeIndex part of the process of hiding the internals of SwPosition Change-Id: I84fd5fbb800c822868840710e1b9fda3de2abaf5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138173 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 19af2534a9ae..1fc6dd71015d 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -2088,7 +2088,7 @@ void DocumentContentOperationsManager::DeleteSection( SwNode *pNode ) SwNodeIndex aSttIdx( *pSttNd ), aEndIdx( *pNode->EndOfSectionNode() ); // delete all Flys, Bookmarks, ... - DelFlyInRange( aSttIdx, aEndIdx ); + DelFlyInRange( aSttIdx.GetNode(), aEndIdx.GetNode() ); m_rDoc.getIDocumentRedlineAccess().DeleteRedline( *pSttNd, true, RedlineType::Any ); DelBookmarks(aSttIdx, aEndIdx); @@ -4341,7 +4341,7 @@ bool DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM & rPam, SwDelet // Delete and move all "Flys at the paragraph", which are within the Selection if (!(flags & SwDeleteFlags::ArtificialSelection)) { - DelFlyInRange(rPam.GetMark()->nNode, rPam.GetPoint()->nNode, + DelFlyInRange(rPam.GetMark()->GetNode(), rPam.GetPoint()->GetNode(), &rPam.GetMark()->nContent, &rPam.GetPoint()->nContent); } DelBookmarks( diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 27b9418dd8b0..116f023f4db3 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -205,21 +205,21 @@ void SaveFlyInRange( const SwPaM& rPam, const SwPosition& rInsPos, /// Delete and move all Flys at the paragraph, that are within the selection. /// If there is a Fly at the SPoint, it is moved onto the Mark. -void DelFlyInRange( const SwNodeIndex& rMkNdIdx, - const SwNodeIndex& rPtNdIdx, +void DelFlyInRange( SwNode& rMkNd, + SwNode& rPtNd, SwContentIndex const*const pMkIdx, SwContentIndex const*const pPtIdx) { assert((pMkIdx == nullptr) == (pPtIdx == nullptr)); SwPosition const point(pPtIdx - ? SwPosition(rPtNdIdx, *pPtIdx) - : SwPosition(rPtNdIdx)); + ? SwPosition(rPtNd, *pPtIdx) + : SwPosition(rPtNd)); SwPosition const mark(pPtIdx - ? SwPosition(rMkNdIdx, *pMkIdx) - : SwPosition(rMkNdIdx)); + ? SwPosition(rMkNd, *pMkIdx) + : SwPosition(rMkNd)); SwPosition const& rStart = mark <= point ? mark : point; SwPosition const& rEnd = mark <= point ? point : mark; - SwDoc& rDoc = rMkNdIdx.GetNode().GetDoc(); + SwDoc& rDoc = rMkNd.GetDoc(); SwFrameFormats& rTable = *rDoc.GetSpzFrameFormats(); for ( auto i = rTable.size(); i; ) { @@ -241,9 +241,9 @@ void DelFlyInRange( const SwNodeIndex& rMkNdIdx, // But only fly formats own their content, not draw formats. if (rContent.GetContentIdx() && pFormat->Which() == RES_FLYFRMFMT) { - DelFlyInRange( *rContent.GetContentIdx(), - SwNodeIndex( *rContent.GetContentIdx()-> - GetNode().EndOfSectionNode() )); + DelFlyInRange( rContent.GetContentIdx()->GetNode(), + *rContent.GetContentIdx()-> + GetNode().EndOfSectionNode() ); // Position could have been moved! if (i > rTable.size()) i = rTable.size(); diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 232e9b31cc27..8ad0ddc79c0e 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -1029,7 +1029,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr, // delete flys in whole range including start node which requires // giving the node before start node as Mark parameter, hence -1. // (flys must be deleted because the anchor nodes are removed) - DelFlyInRange( SwNodeIndex(aSttIdx, -1), aEndIdx ); + DelFlyInRange( SwNodeIndex(aSttIdx, -1).GetNode(), aEndIdx.GetNode() ); rDoc.GetNodes().Delete( aSttIdx, aEndIdx.GetIndex() - aSttIdx.GetIndex() ); } diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index ad3049b10dcb..89d9d2516e60 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -1139,7 +1139,7 @@ static void lcl_UpdateLinksInSect( const SwBaseLink& rUpdLnk, SwSectionNode& rSe // Delete everything succeeding it --aIdx; - DelFlyInRange( aIdx, aEndIdx ); + DelFlyInRange( aIdx.GetNode(), aEndIdx.GetNode() ); DelBookmarks(aIdx, aEndIdx); ++aIdx; diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx index dffac84ff422..896a2228311f 100644 --- a/sw/source/core/inc/mvsave.hxx +++ b/sw/source/core/inc/mvsave.hxx @@ -122,8 +122,8 @@ void SaveFlyInRange( const SwNodeRange& rRg, SaveFlyArr& rArr ); void SaveFlyInRange( const SwPaM& rPam, const SwPosition& rInsPos, SaveFlyArr& rArr, bool bMoveAllFlys, SwHistory * pHistory = nullptr); -void DelFlyInRange( const SwNodeIndex& rMkNdIdx, - const SwNodeIndex& rPtNdIdx, +void DelFlyInRange( SwNode& rMkNd, + SwNode& rPtNd, SwContentIndex const* pMkIdx = nullptr, SwContentIndex const* pPtIdx = nullptr);