diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-07-26 10:58:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-07-26 18:54:47 +0200 |
commit | 96844af26402e4ab26ff7ba02e52989c3b294095 (patch) | |
tree | d33bb8f30c8bbb304a50ccbfe95600f39e07f252 /sw/source/core | |
parent | 4e6327c673075ab4a44f497a06a8dbf759c1a72a (diff) |
elide some temporaries when constructing SwPosition
because the resulting pointer manipulation is not free, the temporary
has to be attached to a linked list and then immediately de-linked
Also add some asserts to catch SwPosition being created with
mis-matching nodes in the SwNodeIndex and SwContentIndex.
Which flushes out some bugs in
SwHTMLParser::NewDivision
SwIntrnlSectRefLink::DataChanged
where it was creating a SwPosition
with the SwNodeIndex and the SwContentIndex pointing at
different nodes.
Change-Id: Iea69f5ffc5860eb654435e161bc544b412d4c245
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137411
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core')
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/crsr/pam.cxx | 17 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentContentOperationsManager.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/doc/docedt.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/doc/docnew.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docredln.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/doc/doctxm.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/docnode/section.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/edit/edglss.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/frmedt/fecopy.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/layout/ftnfrm.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/trvlfrm.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/undo/unattr.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/undo/unmove.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/undo/unsect.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/undo/untbl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/undo/untblk.cxx | 4 |
18 files changed, 53 insertions, 44 deletions
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 15f6484e5dac..9c46b041c047 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1543,7 +1543,7 @@ static void lcl_CheckHiddenPara( SwPosition& rPos ) } if ( pTextNd ) - rPos = SwPosition( aTmp, SwContentIndex( pTextNd, 0 ) ); + rPos = SwPosition( *pTextNd, 0 ); } #if !ENABLE_WASM_STRIP_ACCESSIBILITY @@ -2998,7 +2998,7 @@ SwCursorShell::SwCursorShell( SwDoc& rDoc, vcl::Window *pInitWin, SwNodeIndex aNodeIdx( *rNds.GetEndOfContent().StartOfSectionNode() ); SwContentNode* pCNd = rNds.GoNext( &aNodeIdx ); // go to the first ContentNode - m_pCurrentCursor = new SwShellCursor( *this, SwPosition( aNodeIdx, SwContentIndex( pCNd, 0 ))); + m_pCurrentCursor = new SwShellCursor( *this, SwPosition( aNodeIdx, pCNd, 0 ) ); // Register shell as dependent at current node. As a result all attribute // changes can be forwarded via the Link. diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index 157a859f1d0a..74aec4248cab 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -62,6 +62,18 @@ SwPosition::SwPosition( const SwNodeIndex & rNodeIndex, const SwContentIndex & r { } +SwPosition::SwPosition( const SwNodeIndex & rNodeIndex, const SwContentNode* pContentNode, sal_Int32 nContentOffset ) + : nNode( rNodeIndex ), nContent( pContentNode, nContentOffset ) +{ + assert(!pContentNode || pContentNode == &rNodeIndex.GetNode()); +} + +SwPosition::SwPosition( const SwNodeIndex & rNodeIndex, SwNodeOffset nDiff, const SwContentNode* pContentNode, sal_Int32 nContentOffset ) + : nNode( rNodeIndex, nDiff ), nContent( pContentNode, nContentOffset ) +{ + assert(!pContentNode || pContentNode == &rNodeIndex.GetNode()); +} + SwPosition::SwPosition( const SwNodeIndex & rNodeIndex, SwNodeOffset nDiff ) : nNode( rNodeIndex, nDiff ), nContent( nNode.GetNode().GetContentNode() ) { @@ -82,6 +94,11 @@ SwPosition::SwPosition( const SwContentNode & rNode, const sal_Int32 nContentOff { } +SwPosition::SwPosition( const SwContentIndex & rContentIndex, short nDiff ) + : nNode( *rContentIndex.GetContentNode() ), nContent( rContentIndex, nDiff ) +{ +} + bool SwPosition::operator<(const SwPosition &rPos) const { // cheaper to check for == first diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 41ef175cd301..9be8e4b417c1 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -2725,8 +2725,9 @@ void DocumentContentOperationsManager::MoveAndJoin( SwPaM& rPaM, SwPosition& rPo if( pTextNd && pTextNd->CanJoinNext( &aNxtIdx ) ) { { // Block so SwContentIndex into node is deleted before Join - m_rDoc.CorrRel( aNxtIdx, SwPosition( aIdx, SwContentIndex(pTextNd, - pTextNd->GetText().getLength()) ), 0, true ); + m_rDoc.CorrRel( aNxtIdx, + SwPosition( *pTextNd, pTextNd->GetText().getLength() ), + 0, true ); } pTextNd->JoinNext(); } @@ -5206,8 +5207,7 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo } { - SwPosition startPos(SwNodeIndex(pCopyPam->GetPoint()->nNode, +1), - SwContentIndex(SwNodeIndex(pCopyPam->GetPoint()->nNode, +1).GetNode().GetContentNode())); + SwPosition startPos(pCopyPam->GetPoint()->nNode, SwNodeOffset(+1)); if (bCanMoveBack) { // pCopyPam is actually 1 before the copy range so move it fwd SwPaM temp(*pCopyPam->GetPoint()); @@ -5239,8 +5239,7 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo if (pFlysAtInsPos) { // init *again* - because CopyWithFlyInFly moved startPos - SwPosition startPos(SwNodeIndex(pCopyPam->GetPoint()->nNode, +1), - SwContentIndex(SwNodeIndex(pCopyPam->GetPoint()->nNode, +1).GetNode().GetContentNode())); + SwPosition startPos(pCopyPam->GetPoint()->nNode, SwNodeOffset(+1)); if (bCanMoveBack) { // pCopyPam is actually 1 before the copy range so move it fwd SwPaM temp(*pCopyPam->GetPoint()); diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 6923cb9ab555..4f16b6042a8c 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -277,7 +277,7 @@ SaveRedlEndPosForRestore::SaveRedlEndPosForRestore( const SwNodeIndex& rInsIdx, SwRedlineTable::size_type nFndPos; const SwPosition* pEnd; - SwPosition aSrcPos( rInsIdx, SwContentIndex( rNd.GetContentNode(), nCnt )); + SwPosition aSrcPos( rInsIdx, rNd.GetContentNode(), nCnt ); rDest.getIDocumentRedlineAccess().GetRedline( aSrcPos, &nFndPos ); const SwRangeRedline* pRedl; while( nFndPos-- @@ -307,7 +307,7 @@ void SaveRedlEndPosForRestore::Restore() // This may happen if a table (or section?) will be inserted. if( pNode ) { - SwPosition aPos( *mpSaveIndex, SwContentIndex( pNode, mnSaveContent )); + SwPosition aPos( *mpSaveIndex, pNode, mnSaveContent ); for( auto n = mvSavArr.size(); n; ) *mvSavArr[ --n ] = aPos; } @@ -479,11 +479,11 @@ bool sw_JoinText( SwPaM& rPam, bool bJoinPrev ) // #i100466# adjust given <rPam>, if it does not belong to the cursors if ( pDelNd == rPam.GetBound().nContent.GetContentNode() ) { - rPam.GetBound() = SwPosition( SwNodeIndex( *pTextNd ), SwContentIndex( pTextNd ) ); + rPam.GetBound() = SwPosition( *pTextNd ); } if( pDelNd == rPam.GetBound( false ).nContent.GetContentNode() ) { - rPam.GetBound( false ) = SwPosition( SwNodeIndex( *pTextNd ), SwContentIndex( pTextNd ) ); + rPam.GetBound( false ) = SwPosition( *pTextNd ); } pTextNd->JoinNext(); } diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 462fba9d9979..a2230985d2f6 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -684,7 +684,7 @@ void SwDoc::ClearDoc() // set the layout to the dummy pagedesc pFirstNd->SetAttr( SwFormatPageDesc( pDummyPgDsc )); - SwPosition aPos( *pFirstNd, SwContentIndex( pFirstNd )); + SwPosition aPos( *pFirstNd ); SwPaM const tmpPaM(aSttIdx, SwNodeIndex(GetNodes().GetEndOfContent())); ::PaMCorrAbs(tmpPaM, aPos); } diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index e460c0ce3a68..acf28394c840 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -1532,7 +1532,7 @@ void SwRangeRedline::MoveToSection() SwTextNode* pTextNd = rNds[ pSttNd->GetIndex() + 1 ]->GetTextNode(); SwNodeIndex aNdIdx( *pTextNd ); - SwPosition aPos( aNdIdx, SwContentIndex( pTextNd )); + SwPosition aPos( *pTextNd ); if( pCSttNd && pCEndNd ) { // tdf#140982 keep annotation ranges in deletions in margin mode @@ -1599,9 +1599,7 @@ void SwRangeRedline::CopyToSection() pSttNd = rNds.MakeTextSection( SwNodeIndex( rNds.GetEndOfRedlines() ), SwNormalStartNode, pColl ); - SwNodeIndex aNdIdx( *pSttNd, 1 ); - SwTextNode* pTextNd = aNdIdx.GetNode().GetTextNode(); - SwPosition aPos( aNdIdx, SwContentIndex( pTextNd )); + SwPosition aPos( *pSttNd, SwNodeOffset(1) ); // tdf#115815 keep original start position of collapsed annotation ranges // as temporary bookmarks (removed after file saving and file loading) diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index c34bdea2233a..96107a634571 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -175,7 +175,7 @@ void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark ) { // save attributes for Undo SwUndoResetAttr* pUndo = new SwUndoResetAttr( - SwPosition( rTextNd, SwContentIndex( &rTextNd, pTextTOXMark->GetStart() ) ), + SwPosition( rTextNd, pTextTOXMark->GetStart() ), RES_TXTATR_TOXMARK ); GetIDocumentUndoRedo().AppendUndo( std::unique_ptr<SwUndo>(pUndo) ); @@ -1024,7 +1024,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr, else { --aEndIdx; - SwPosition aPos( aEndIdx, SwContentIndex( pFirstEmptyNd, 0 )); + SwPosition aPos( aEndIdx, pFirstEmptyNd, 0 ); SwDoc::CorrAbs( aSttIdx, aEndIdx, aPos, true ); // delete flys in whole range including start node which requires diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index ebb7f41daf09..635476cf3f9a 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -1061,7 +1061,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh, rTable.GetTabLines().insert(rTable.GetTabLines().begin() + nLines, pLine); SwStartNode* pSttNd; - SwPosition aCntPos( aSttIdx, SwContentIndex( pTextNd )); + SwPosition aCntPos( aSttIdx, pTextNd, 0); const std::shared_ptr< sw::mark::ContentIdxStore> pContentStore(sw::mark::ContentIdxStore::Create()); pContentStore->Save(rDoc, aSttIdx.GetIndex(), SAL_MAX_INT32); diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 0ed682c5f91d..6306b1c33684 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -1123,7 +1123,7 @@ static void lcl_UpdateLinksInSect( const SwBaseLink& rUpdLnk, SwSectionNode& rSe // Insert an empty TextNode at the Section's start SwNodeIndex aIdx( *pSectNd, +1 ); SwNodeIndex aEndIdx( *pSectNd->EndOfSectionNode() ); - SwTextNode* pNewNd = pDoc->GetNodes().MakeTextNode( aIdx, + pDoc->GetNodes().MakeTextNode( aIdx, pDoc->getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_TEXT ) ); if( pESh ) @@ -1131,8 +1131,7 @@ static void lcl_UpdateLinksInSect( const SwBaseLink& rUpdLnk, SwSectionNode& rSe else if( pVSh ) pVSh->StartAction(); - SwPosition aPos( aIdx, SwContentIndex( pNewNd, 0 )); - --aPos.nNode; + SwPosition aPos( aIdx, SwNodeOffset(-1) ); SwDoc::CorrAbs( aIdx, aEndIdx, aPos, true ); pPam = new SwPaM( aPos ); diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx index 752c7e17365a..9e6e96da8435 100644 --- a/sw/source/core/edit/edglss.cxx +++ b/sw/source/core/edit/edglss.cxx @@ -140,7 +140,7 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock, aStt = pGDoc->GetNodes().GetEndOfExtras(); pContentNd = pGDoc->GetNodes().GoNext( &aStt ); - SwPosition aInsPos( aStt, SwContentIndex( pContentNd )); + SwPosition aInsPos( aStt ); pMyDoc->getIDocumentContentOperations().CopyRange(aCpyPam, aInsPos, SwCopyFlags::CheckPosInFly); nRet = rBlock.PutDoc(); @@ -157,8 +157,7 @@ bool SwEditShell::CopySelToDoc( SwDoc& rInsDoc ) SwNodeIndex aIdx( rNds.GetEndOfContent(), -1 ); SwContentNode *const pContentNode = aIdx.GetNode().GetContentNode(); - SwPosition aPos( aIdx, - SwContentIndex(pContentNode, pContentNode ? pContentNode->Len() : 0)); + SwPosition aPos( aIdx, pContentNode, pContentNode ? pContentNode->Len() : 0); bool bRet = false; CurrShell aCurr( this ); diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index 895f5812d15a..6bd3a044b0de 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -173,7 +173,7 @@ void SwFEShell::Copy( SwDoc& rClpDoc, const OUString* pNewClpText ) } else if ( IsObjSelected() ) { - SwPosition aPos( aSttIdx, SwContentIndex( pTextNd, 0 )); + SwPosition aPos( aSttIdx, pTextNd, 0 ); const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { @@ -1011,7 +1011,7 @@ bool SwFEShell::Paste(SwDoc& rClpDoc, bool bNestedTable) // exit first the complete table // ???? what about only table in a frame ????? SwContentNode* pCNd = GetDoc()->GetNodes().GoNext( &aNdIdx ); - SwPosition aPos( aNdIdx, SwContentIndex( pCNd, 0 )); + SwPosition aPos( aNdIdx, pCNd, 0 ); // #i59539: Don't remove all redline SwPaM const tmpPaM(*pDestNd, *pDestNd->EndOfSectionNode()); ::PaMCorrAbs(tmpPaM, aPos); @@ -1026,7 +1026,7 @@ bool SwFEShell::Paste(SwDoc& rClpDoc, bool bNestedTable) // return to the box aNdIdx = *pSttNd; SwContentNode* pCNd = GetDoc()->GetNodes().GoNext( &aNdIdx ); - SwPosition aPos( aNdIdx, SwContentIndex( pCNd, 0 )); + SwPosition aPos( aNdIdx, pCNd, 0 ); // #i59539: Don't remove all redline SwNode & rNode(rPaM.GetPoint()->nNode.GetNode()); SwContentNode *const pContentNode( rNode.GetContentNode() ); diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 55b0beab6794..a6204e4008fe 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -2934,7 +2934,7 @@ SwContentFrame* SwFootnoteFrame::GetRefFromAttr() { assert(mpAttribute && "invalid Attribute"); SwTextNode& rTNd = const_cast<SwTextNode&>(mpAttribute->GetTextNode()); - SwPosition aPos( rTNd, SwContentIndex( &rTNd, mpAttribute->GetStart() )); + SwPosition aPos( rTNd, mpAttribute->GetStart() ); SwContentFrame* pCFrame = rTNd.getLayoutFrame(getRootFrame(), &aPos); return pCFrame; } diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 4f060f005f16..2a424739a1b7 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -304,8 +304,7 @@ bool SwPageFrame::GetModelPositionForViewPoint( SwPosition *pPos, Point &rPoint, // previous character; to get a better measure from // lcl_getDistance, extend that to a rectangle over // the entire character. - SwPosition const nextTextPos(prevTextPos.nNode, - SwContentIndex(prevTextPos.nContent, +1)); + SwPosition const nextTextPos(prevTextPos.nContent, +1); SwRect nextTextRect; pTextFrame->GetCharRect(nextTextRect, nextTextPos); SwRectFnSet aRectFnSet(pTextFrame); diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index 69a83488eaa1..99ddf6bbfbdf 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -600,8 +600,7 @@ void SwUndoResetAttr::RedoImpl(::sw::UndoRedoContext & rContext) { SwTOXMarks aArr; SwNodeIndex aIdx( rDoc.GetNodes(), m_nSttNode ); - SwPosition aPos( aIdx, SwContentIndex( aIdx.GetNode().GetContentNode(), - m_nSttContent )); + SwPosition aPos( aIdx, aIdx.GetNode().GetContentNode(), m_nSttContent ); sal_uInt16 nCnt = SwDoc::GetCurTOXMark( aPos, aArr ); if( nCnt ) { diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx index 055b56932331..90dff3098d5f 100644 --- a/sw/source/core/undo/unmove.cxx +++ b/sw/source/core/undo/unmove.cxx @@ -211,8 +211,8 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext) if( m_bJoinNext ) { { - RemoveIdxRel( aIdx.GetIndex() + 1, SwPosition( aIdx, - SwContentIndex(pTextNd, pTextNd->GetText().getLength()))); + RemoveIdxRel( aIdx.GetIndex() + 1, + SwPosition( aIdx, pTextNd, pTextNd->GetText().getLength()) ); } // Are there any Pams in the next TextNode? pTextNd->JoinNext(); @@ -255,8 +255,7 @@ void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext) { SwPaM aPam(*rPam.GetPoint()); SetPaM( aPam ); - SwPosition aMvPos( aIdx, SwContentIndex( aIdx.GetNode().GetContentNode(), - m_nMoveDestContent )); + SwPosition aMvPos( aIdx, aIdx.GetNode().GetContentNode(), m_nMoveDestContent ); DelFootnote( aPam ); RemoveIdxFromRange( aPam, false ); @@ -275,8 +274,8 @@ void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext) if( pTextNd && pTextNd->CanJoinNext() ) { { - RemoveIdxRel( aIdx.GetIndex() + 1, SwPosition( aIdx, - SwContentIndex(pTextNd, pTextNd->GetText().getLength()))); + RemoveIdxRel( aIdx.GetIndex() + 1, + SwPosition( *pTextNd, pTextNd->GetText().getLength()) ); } pTextNd->JoinNext(); } diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx index 168a18a50c03..fcfda18576d4 100644 --- a/sw/source/core/undo/unsect.cxx +++ b/sw/source/core/undo/unsect.cxx @@ -283,7 +283,7 @@ void SwUndoInsSection::Join( SwDoc& rDoc, SwNodeOffset nNode ) { RemoveIdxRel( nNode + 1, - SwPosition( aIdx, SwContentIndex( pTextNd, pTextNd->GetText().getLength() ) ) ); + SwPosition( aIdx, pTextNd, pTextNd->GetText().getLength() ) ); } pTextNd->JoinNext(); diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index dce56d05f3df..0be28a79d970 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -1971,7 +1971,7 @@ void SwUndoTableMerge::UndoImpl(::sw::UndoRedoContext & rContext) SwNodeIndex aTmpIdx( *pBox->GetSttNd() ); SwDoc::CorrAbs( SwNodeIndex( aTmpIdx, 1 ), SwNodeIndex( *aTmpIdx.GetNode().EndOfSectionNode() ), - SwPosition( aTmpIdx, SwContentIndex( nullptr, 0 )), true ); + SwPosition( aTmpIdx, nullptr, 0 ), true ); } delete pBox; diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx index 3898b6bf7652..138e7224bd09 100644 --- a/sw/source/core/undo/untblk.cxx +++ b/sw/source/core/undo/untblk.cxx @@ -349,8 +349,8 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext) if( bJoinNext && pTextNode->CanJoinNext()) { { - RemoveIdxRel( rIdx.GetIndex()+1, SwPosition( rIdx, - SwContentIndex( pTextNode, pTextNode->GetText().getLength() ))); + RemoveIdxRel( rIdx.GetIndex()+1, + SwPosition( rIdx, pTextNode, pTextNode->GetText().getLength() ) ); } pTextNode->JoinNext(); } |