sw/source/core/doc/DocumentContentOperationsManager.cxx | 20 ++++++++-------- sw/source/core/doc/DocumentLayoutManager.cxx | 2 - sw/source/core/doc/DocumentRedlineManager.cxx | 7 ++--- sw/source/core/doc/doccomp.cxx | 2 - sw/source/core/doc/docedt.cxx | 7 ++--- sw/source/core/doc/docglbl.cxx | 3 -- sw/source/core/doc/docredln.cxx | 3 -- sw/source/core/doc/tblcpy.cxx | 2 - sw/source/core/doc/tblrwcl.cxx | 2 - sw/source/core/docnode/ndsect.cxx | 9 +++---- sw/source/core/docnode/section.cxx | 9 +++---- sw/source/core/inc/DocumentContentOperationsManager.hxx | 2 - sw/source/core/inc/flowfrm.hxx | 3 +- sw/source/core/inc/frmtool.hxx | 4 +-- sw/source/core/inc/mvsave.hxx | 2 - sw/source/core/layout/frmtool.cxx | 5 +--- sw/source/core/layout/wsfrm.cxx | 4 --- sw/source/core/txtnode/atrftn.cxx | 2 - sw/source/core/undo/undel.cxx | 12 ++++----- sw/source/core/undo/undobj.cxx | 2 - sw/source/uibase/wrtsh/wrtsh1.cxx | 2 - 21 files changed, 48 insertions(+), 56 deletions(-)
New commits: commit e74c77f420281ff730ba981ddeddbb7b9b10fb8e Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Sun Aug 21 23:18:22 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Aug 23 09:28:37 2022 +0200 use more SwPosition::GetNode in CopyWithFlyInFly Change-Id: I2f74694466f7a01dcc12fd39527900c53825e1b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138647 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 93529a5fbbdd..2ce53a29ea9c 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -3621,7 +3621,7 @@ void DocumentContentOperationsManager::RemoveLeadingWhiteSpace(const SwPosition /// pCopiedPaM *includes* a partially selected start text node void DocumentContentOperationsManager::CopyWithFlyInFly( const SwNodeRange& rRg, - const SwNodeIndex& rInsPos, + SwNode& rInsPos, const std::pair<const SwPaM&, const SwPosition&>* pCopiedPaM /*and real insert pos*/, const bool bMakeNewFrames, const bool bDelRedlines, @@ -3629,19 +3629,19 @@ void DocumentContentOperationsManager::CopyWithFlyInFly( SwCopyFlags const flags) const { assert(!pCopiedPaM || pCopiedPaM->first.End()->GetNode() == rRg.aEnd.GetNode()); - assert(!pCopiedPaM || pCopiedPaM->second.GetNode() <= rInsPos.GetNode()); + assert(!pCopiedPaM || pCopiedPaM->second.GetNode() <= rInsPos); - SwDoc& rDest = rInsPos.GetNode().GetDoc(); + SwDoc& rDest = rInsPos.GetDoc(); SwNodeIndex aSavePos( rInsPos ); if (rRg.aStart != rRg.aEnd) { - bool bEndIsEqualEndPos = rInsPos == rRg.aEnd; + bool bEndIsEqualEndPos = rInsPos == rRg.aEnd.GetNode(); --aSavePos; SaveRedlEndPosForRestore aRedlRest( rInsPos, 0 ); // insert behind the already copied start node - m_rDoc.GetNodes().CopyNodes( rRg, rInsPos.GetNode(), false, true ); + m_rDoc.GetNodes().CopyNodes( rRg, rInsPos, false, true ); aRedlRest.Restore(); if (bEndIsEqualEndPos) @@ -3679,7 +3679,7 @@ void DocumentContentOperationsManager::CopyWithFlyInFly( { // recreate from previous node (could be merged now) o3tl::sorted_vector<SwTextFrame*> frames; SwTextNode * pNode = aSavePos.GetNode().GetTextNode(); - SwTextNode *const pEndNode = rInsPos.GetNode().GetTextNode(); + SwTextNode *const pEndNode = rInsPos.GetTextNode(); if (pEndNode) { SwIterator<SwTextFrame, SwTextNode, sw::IteratorMode::UnwrapMulti> aIter(*pEndNode); @@ -3733,7 +3733,7 @@ void DocumentContentOperationsManager::CopyWithFlyInFly( SwNodeIndex const end(rInsPos, SwNodeOffset((!isRecreateEndNode || isAtStartOfSection) ? 0 : +1)); - ::MakeFrames(&rDest, aSavePos, end); + ::MakeFrames(&rDest, aSavePos.GetNode(), end.GetNode()); } } @@ -3769,7 +3769,7 @@ void DocumentContentOperationsManager::CopyWithFlyInFly( flags); } - SwNodeRange aCpyRange( aSavePos, rInsPos ); + SwNodeRange aCpyRange( aSavePos.GetNode(), rInsPos ); if( bDelRedlines && ( RedlineFlags::DeleteRedlines & rDest.getIDocumentRedlineAccess().GetRedlineFlags() )) lcl_DeleteRedlines( rRg, aCpyRange ); @@ -5191,12 +5191,12 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo SwNodeIndex aSaveIdx( aInsPos, -1 ); assert(pStt->nNode != pEnd->nNode); pEnd->nContent = 0; // TODO why this? - CopyWithFlyInFly(aRg, aInsPos, &tmp, /*bMakeNewFrames*/true, false, /*bCopyFlyAtFly=*/false, flags); + CopyWithFlyInFly(aRg, aInsPos.GetNode(), &tmp, /*bMakeNewFrames*/true, false, /*bCopyFlyAtFly=*/false, flags); ++aSaveIdx; pEnd->Assign(aSaveIdx); } else - CopyWithFlyInFly(aRg, aInsPos, &tmp, /*bMakeNewFrames*/true, false, /*bCopyFlyAtFly=*/false, flags); + CopyWithFlyInFly(aRg, aInsPos.GetNode(), &tmp, /*bMakeNewFrames*/true, false, /*bCopyFlyAtFly=*/false, flags); bCopyBookmarks = false; } diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx b/sw/source/core/doc/DocumentLayoutManager.cxx index 17cf60cde4aa..add587bd790c 100644 --- a/sw/source/core/doc/DocumentLayoutManager.cxx +++ b/sw/source/core/doc/DocumentLayoutManager.cxx @@ -427,7 +427,7 @@ SwFrameFormat *DocumentLayoutManager::CopyLayoutFormat( //contact object itself. They should be managed by SwUndoInsLayFormat. const ::sw::DrawUndoGuard drawUndoGuard(m_rDoc.GetIDocumentUndoRedo()); - pSrcDoc->GetDocumentContentOperationsManager().CopyWithFlyInFly(aRg, aIdx, nullptr, false, true, true); + pSrcDoc->GetDocumentContentOperationsManager().CopyWithFlyInFly(aRg, aIdx.GetNode(), nullptr, false, true, true); } else { diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index cc51a0dc9d55..4bdde1ab0a0a 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -263,7 +263,7 @@ void UpdateFramesForRemoveDeleteRedline(SwDoc & rDoc, SwPaM const& rPam) while (!pStartNode) { // note: branch only taken for redlines, not fieldmarks - SwStartNode const*const pTableOrSectionNode( + SwStartNode *const pTableOrSectionNode( currentStart.GetNode().IsTableNode() ? static_cast<SwStartNode*>(currentStart.GetNode().GetTableNode()) : static_cast<SwStartNode*>(currentStart.GetNode().GetSectionNode())); @@ -276,8 +276,7 @@ void UpdateFramesForRemoveDeleteRedline(SwDoc & rDoc, SwPaM const& rPam) { // note: this will also create frames for all currently hidden flys // because it calls AppendAllObjs - SwNodeIndex const end(*pTableOrSectionNode->EndOfSectionNode()); - ::MakeFrames(&rDoc, currentStart.nNode, end); + ::MakeFrames(&rDoc, currentStart.GetNode(), *pTableOrSectionNode->EndOfSectionNode()); isAppendObjsCalled = true; } currentStart.Assign( pTableOrSectionNode->EndOfSectionIndex() + 1 ); @@ -355,7 +354,7 @@ void UpdateFramesForRemoveDeleteRedline(SwDoc & rDoc, SwPaM const& rPam) SwNodeIndex const end(*pLast, +1); // end is exclusive // note: this will also create frames for all currently hidden flys // both on first and non-first nodes because it calls AppendAllObjs - ::MakeFrames(&rDoc, start, end); + ::MakeFrames(&rDoc, start.GetNode(), end.GetNode()); isAppendObjsCalled = true; // re-use this to move flys that are now on the wrong frame, with end // of redline as "second" node; the nodes between start and end should diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 9a2fea47067e..7cb4a640173e 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -1548,7 +1548,7 @@ void CompareData::ShowDelete( SwNodeIndex aInsPos( *pLineNd, nOffset ); SwNodeIndex aSavePos( aInsPos, -1 ); - rData.m_rDoc.GetDocumentContentOperationsManager().CopyWithFlyInFly(aRg, aInsPos); + rData.m_rDoc.GetDocumentContentOperationsManager().CopyWithFlyInFly(aRg, aInsPos.GetNode()); m_rDoc.getIDocumentState().SetModified(); ++aSavePos; diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index e89f30e9f0f4..439ea42a1173 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -264,17 +264,16 @@ void DelFlyInRange( SwNode& rMkNd, // because of unnecessary expanded redlines // From now on this class saves the redline positions of all redlines which ends exact at the // insert position (node _and_ content index) -SaveRedlEndPosForRestore::SaveRedlEndPosForRestore( const SwNodeIndex& rInsIdx, sal_Int32 nCnt ) +SaveRedlEndPosForRestore::SaveRedlEndPosForRestore( const SwNode& rInsIdx, sal_Int32 nCnt ) : mnSaveContent( nCnt ) { - SwNode& rNd = rInsIdx.GetNode(); - SwDoc& rDest = rNd.GetDoc(); + const SwDoc& rDest = rInsIdx.GetDoc(); if( rDest.getIDocumentRedlineAccess().GetRedlineTable().empty() ) return; SwRedlineTable::size_type nFndPos; const SwPosition* pEnd; - SwPosition aSrcPos( rInsIdx, rNd.GetContentNode(), nCnt ); + SwPosition aSrcPos( rInsIdx, rInsIdx.GetContentNode(), nCnt ); rDest.getIDocumentRedlineAccess().GetRedline( aSrcPos, &nFndPos ); const SwRangeRedline* pRedl; while( nFndPos-- diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index 2e9be7c67717..67bde58b3c6b 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -306,9 +306,8 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline, pDoc->SetOutlineNumRule( *mpOutlineRule ); SwNodeRange aRg( *pStartNd, SwNodeOffset(0), aEndIdx.GetNode() ); - SwNodeIndex aTmpIdx( pDoc->GetNodes().GetEndOfContent() ); GetDocumentContentOperationsManager().CopyWithFlyInFly( - aRg, aTmpIdx, nullptr, false, false); + aRg, pDoc->GetNodes().GetEndOfContent(), nullptr, false, false); // Delete the initial TextNode SwNodeIndex aIdx( pDoc->GetNodes().GetEndOfExtras(), 2 ); diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index ad84d7b58c82..05a8351c0328 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -1630,9 +1630,8 @@ void SwRangeRedline::CopyToSection() } else { - SwNodeIndex aInsPos( *pSttNd->EndOfSectionNode() ); SwNodeRange aRg( pStt->nNode, SwNodeOffset(0), pEnd->nNode, SwNodeOffset(1) ); - rDoc.GetDocumentContentOperationsManager().CopyWithFlyInFly(aRg, aInsPos); + rDoc.GetDocumentContentOperationsManager().CopyWithFlyInFly(aRg, *pSttNd->EndOfSectionNode()); } } m_oContentSect.emplace( *pSttNd ); diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx index aaab4e837bee..beea9fefd72c 100644 --- a/sw/source/core/doc/tblcpy.cxx +++ b/sw/source/core/doc/tblcpy.cxx @@ -515,7 +515,7 @@ static void lcl_CpyBox( const SwTable& rCpyTable, const SwTableBox* pCpyBox, SwNodeIndex aSavePos( aInsIdx, -1 ); if (pRg) - pCpyDoc->GetDocumentContentOperationsManager().CopyWithFlyInFly(*pRg, aInsIdx, nullptr, false); + pCpyDoc->GetDocumentContentOperationsManager().CopyWithFlyInFly(*pRg, aInsIdx.GetNode(), nullptr, false); else pDoc->GetNodes().MakeTextNode( aInsIdx.GetNode(), pDoc->GetDfltTextFormatColl() ); ++aSavePos; diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index a2032e0f3291..31d7a275e96f 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -1925,7 +1925,7 @@ static void lcl_CopyBoxToDoc(FndBox_ const& rFndBox, CpyPara *const pCpyPara) *rFndBox.GetBox()->GetSttNd()->EndOfSectionNode() ); SwNodeIndex aInsIdx( *pBox->GetSttNd(), 1 ); - pFromDoc->GetDocumentContentOperationsManager().CopyWithFlyInFly(aCpyRg, aInsIdx, nullptr, false); + pFromDoc->GetDocumentContentOperationsManager().CopyWithFlyInFly(aCpyRg, aInsIdx.GetNode(), nullptr, false); // Delete the initial TextNode pCpyPara->rDoc.GetNodes().Delete( aInsIdx ); } diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 47eef09cef10..779e286ffdbb 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -1179,11 +1179,10 @@ void SwSectionNode::MakeOwnFrames(SwNodeIndex* pIdxBehind, SwNodeIndex* pEndIdx) if( rNds.IsDocNodes() ) { - SwNodeIndex *pEnd = pEndIdx ? pEndIdx : - new SwNodeIndex( *EndOfSectionNode(), 1 ); - ::MakeFrames( &rDoc, *pIdxBehind, *pEnd ); - if( !pEndIdx ) - delete pEnd; + if( pEndIdx ) + ::MakeFrames( &rDoc, pIdxBehind->GetNode(), pEndIdx->GetNode() ); + else + ::MakeFrames( &rDoc, pIdxBehind->GetNode(), SwNodeIndex( *EndOfSectionNode(), 1 ).GetNode() ); } } diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 324dae6d22a7..34a15de0971b 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -1262,10 +1262,9 @@ static void lcl_UpdateLinksInSect( const SwBaseLink& rUpdLnk, SwSectionNode& rSe if( oCpyRg ) { - SwNodeIndex& rInsPos = pPam->GetPoint()->nNode; - bool bCreateFrame = rInsPos.GetIndex() <= - pDoc->GetNodes().GetEndOfExtras().GetIndex() || - rInsPos.GetNode().FindTableNode(); + SwNode& rInsPos = pPam->GetPoint()->GetNode(); + bool bCreateFrame = rInsPos <= pDoc->GetNodes().GetEndOfExtras() || + rInsPos.FindTableNode(); SwTableNumFormatMerge aTNFM( *pSrcDoc, *pDoc ); @@ -1273,7 +1272,7 @@ static void lcl_UpdateLinksInSect( const SwBaseLink& rUpdLnk, SwSectionNode& rSe ++aSave; if( !bCreateFrame ) - ::MakeFrames( pDoc, aSave, rInsPos ); + ::MakeFrames( pDoc, aSave.GetNode(), rInsPos ); // Delete last Node, only if it was copied successfully // (the Section contains more than one Node) diff --git a/sw/source/core/inc/DocumentContentOperationsManager.hxx b/sw/source/core/inc/DocumentContentOperationsManager.hxx index 89df4e3416bd..decc16c14648 100644 --- a/sw/source/core/inc/DocumentContentOperationsManager.hxx +++ b/sw/source/core/inc/DocumentContentOperationsManager.hxx @@ -103,7 +103,7 @@ public: void DeleteDummyChar(SwPosition const& rPos, sal_Unicode cDummy); void CopyWithFlyInFly( const SwNodeRange& rRg, - const SwNodeIndex& rInsPos, + SwNode& rInsPos, const std::pair<const SwPaM&, const SwPosition&> * pCopiedPaM = nullptr, bool bMakeNewFrames = true, bool bDelRedlines = true, diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx index 965c0b8cfbd0..a5766c793eb7 100644 --- a/sw/source/core/inc/flowfrm.hxx +++ b/sw/source/core/inc/flowfrm.hxx @@ -30,6 +30,7 @@ class SwPageFrame; class SwRect; class SwBorderAttrs; class SwDoc; +class SwNode; class SwNodeIndex; /** Base class that provides the general functionalities for frames that are @@ -69,7 +70,7 @@ class SwFlowFrame // TableSel is allowed to reset the follow-bit friend inline void UnsetFollow( SwFlowFrame *pFlow ); - friend void MakeFrames( SwDoc *, const SwNodeIndex &, const SwNodeIndex & ); + friend void MakeFrames( SwDoc *, SwNode &, SwNode & ); friend class SwNode2LayImpl; diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx index d7c8e8249b7c..0aaa4d2c05c3 100644 --- a/sw/source/core/inc/frmtool.hxx +++ b/sw/source/core/inc/frmtool.hxx @@ -145,8 +145,8 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc, SwNodeOffset nIndex, SwFrame *pPrv = nullptr, sw::FrameMode eMode = sw::FrameMode::New); // Creation of frames for a specific section (uses InsertCnt_) -void MakeFrames( SwDoc *pDoc, const SwNodeIndex &rSttIdx, - const SwNodeIndex &rEndIdx ); +void MakeFrames( SwDoc *pDoc, SwNode &rSttIdx, + SwNode &rEndIdx ); extern bool bObjsDirect; diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx index 8376252e7703..43f996816ebb 100644 --- a/sw/source/core/inc/mvsave.hxx +++ b/sw/source/core/inc/mvsave.hxx @@ -192,7 +192,7 @@ class SaveRedlEndPosForRestore sal_Int32 mnSaveContent; public: - SaveRedlEndPosForRestore( const SwNodeIndex& rInsIdx, sal_Int32 nContent ); + SaveRedlEndPosForRestore( const SwNode& rInsIdx, sal_Int32 nContent ); ~SaveRedlEndPosForRestore(); void Restore(); }; diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index c9ec9c9a2de8..5052badaffa5 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -2010,8 +2010,7 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc, pLayout->SetCallbackActionEnabled( bOldCallbackActionEnabled ); } -void MakeFrames( SwDoc *pDoc, const SwNodeIndex &rSttIdx, - const SwNodeIndex &rEndIdx ) +void MakeFrames( SwDoc *pDoc, SwNode &rSttIdx, SwNode &rEndIdx ) { bObjsDirect = false; @@ -2161,7 +2160,7 @@ void MakeFrames( SwDoc *pDoc, const SwNodeIndex &rSttIdx, bool bSplit; SwFrame* pPrv = bApres ? pFrame : pFrame->GetPrev(); // If the section frame is inserted into another one, it must be split. - if( pSct && rSttIdx.GetNode().IsSectionNode() ) + if( pSct && rSttIdx.IsSectionNode() ) { bSplit = pSct->SplitSect( pFrame, bApres ); if( !bSplit && !bApres ) diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index eff3c674d6de..20d832ac27b2 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -4539,11 +4539,9 @@ static void UnHideRedlines(SwRootFrame & rLayout, } // call MakeFrames once, because sections/tables // InsertCnt_ also checks for hidden sections - SwNodeIndex const start(rNodes, i); - SwNodeIndex const end(rNodes, j); { sw::FlyCreationSuppressor aSuppressor(false); - ::MakeFrames(rLayout.GetFormat()->GetDoc(), start, end); + ::MakeFrames(rLayout.GetFormat()->GetDoc(), *rNodes[i], *rNodes[j]); } i = j - 1; // will be incremented again } diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx index 79dd0f903605..518bca0403b3 100644 --- a/sw/source/core/txtnode/atrftn.cxx +++ b/sw/source/core/txtnode/atrftn.cxx @@ -414,7 +414,7 @@ void SwTextFootnote::CopyFootnote( SwNodeIndex aEnd( *aStart.GetNode().EndOfSectionNode() ); SwNodeOffset nDestLen = aEnd.GetIndex() - aStart.GetIndex() - 1; - m_pTextNode->GetDoc().GetDocumentContentOperationsManager().CopyWithFlyInFly(aRg, aEnd); + m_pTextNode->GetDoc().GetDocumentContentOperationsManager().CopyWithFlyInFly(aRg, aEnd.GetNode()); // in case the destination section was not empty, delete the old nodes // before: Src: SxxxE, Dst: SnE diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index 5cd7d4e335fb..99bac98e9ffc 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -1126,24 +1126,24 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext) // tdf#134252 *first* create outer section frames // note: text node m_nSttNode currently has frame with an upper; // there's a hack in InsertCnt_() to move it below new section frame - SwNodeIndex const start(rDoc.GetNodes(), m_nSttNode - m_nReplaceDummy); - SwNodeIndex const end(rDoc.GetNodes(), m_nSttNode); // exclude m_nSttNode + SwNode& start(*rDoc.GetNodes()[m_nSttNode - m_nReplaceDummy]); + SwNode& end(*rDoc.GetNodes()[m_nSttNode]); // exclude m_nSttNode ::MakeFrames(&rDoc, start, end); } // tdf#121031 if the start node is a text node, it already has a frame; // if it's a table, it does not // tdf#109376 exception: end on non-text-node -> start node was inserted assert(!m_bDelFullPara || (m_nSectDiff == SwNodeOffset(0))); - SwNodeIndex const start(rDoc.GetNodes(), m_nSttNode + + SwNode& start(*rDoc.GetNodes()[m_nSttNode + ((m_bDelFullPara || !rDoc.GetNodes()[m_nSttNode]->IsTextNode() || pInsNd) - ? 0 : 1)); + ? 0 : 1)]); // don't include end node in the range: it may have been merged already // by the start node, or it may be merged by one of the moved nodes, // but if it isn't merged, its current frame(s) should be good... - SwNodeIndex const end(rDoc.GetNodes(), m_bDelFullPara + SwNode& end(*rDoc.GetNodes()[ m_bDelFullPara ? delFullParaEndNode // tdf#147310 SwDoc::DeleteRowCol() may delete whole table - end must be node following table! - : (m_nEndNode + (rDoc.GetNodes()[m_nSttNode]->IsTableNode() && rDoc.GetNodes()[m_nEndNode]->IsEndNode() ? 1 : 0))); + : (m_nEndNode + (rDoc.GetNodes()[m_nSttNode]->IsTableNode() && rDoc.GetNodes()[m_nEndNode]->IsEndNode() ? 1 : 0))]); ::MakeFrames(&rDoc, start, end); } diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index b20ca460868f..909860f3bb46 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -790,7 +790,7 @@ void SwUndoSaveContent::MoveFromUndoNds( SwDoc& rDoc, SwNodeOffset nNodeIdx, aPaM.SetMark(); aPaM.GetPoint()->Assign(nNodeIdx, 0); - SaveRedlEndPosForRestore aRedlRest( rInsPos.nNode, rInsPos.GetContentIndex() ); + SaveRedlEndPosForRestore aRedlRest( rInsPos.GetNode(), rInsPos.GetContentIndex() ); rNds.MoveRange( aPaM, rInsPos, rDoc.GetNodes() ); diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 03b20b333f2e..049259ab0abe 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -2437,7 +2437,7 @@ void SwWrtShell::MakeOutlineContentVisible(const size_t nPos, bool bMakeVisible) { // reset the index marker and make frames aIdx.Assign(*pSttNd, +1); - MakeFrames(GetDoc(), aIdx, SwNodeIndex(*pEndNd)); + MakeFrames(GetDoc(), aIdx.GetNode(), *pEndNd); pSttNd->GetTextNode()->SetAttrOutlineContentVisible(true);