sw/source/core/doc/DocumentContentOperationsManager.cxx | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
New commits: commit b3e07612eb6536aa14f2108484705068fc8e30d8 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Sep 29 13:39:36 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Sep 29 17:46:31 2022 +0200 use more SwPosition::SetContent part of the process of hiding the internals of SwPosition. In thi case we just need to point aDelPam somewhere else, so that is doesn't point into a node that is about to be deleted. Change-Id: I7b2ae167af30cebd896565e5e597bcbf79505e80 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140734 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 2221a5ec49d9..ec52d3ec1221 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -4610,9 +4610,8 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt OUString(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK, ::sw::mark::InsertMode::New); - SwContentIndex& rIdx = aDelPam.GetPoint()->nContent; - rIdx.Assign( nullptr, 0 ); - aDelPam.GetMark()->nContent = rIdx; + aDelPam.GetPoint()->Assign( SwNodeOffset(0) ); + aDelPam.GetMark()->Assign( SwNodeOffset(0) ); rPam.GetPoint()->Assign( SwNodeOffset(0) ); *rPam.GetMark() = *rPam.GetPoint(); m_rDoc.getIDocumentRedlineAccess().SetRedlineFlags( eOld ); commit 22535b5a6591e1f9f1ebd6c95bc6173f570f0082 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Sep 29 13:15:09 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Sep 29 17:46:20 2022 +0200 use more SwPosition::SetContent part of the process of hiding the internals of SwPosition Change-Id: I7e4055250f68fd8d463f5cf205a91801ae7c2f1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140733 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 22c84d9bfb3c..2221a5ec49d9 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -1812,7 +1812,7 @@ namespace //local functions originally from docfmt.cxx SwNodeIndex aSt( rDoc.GetNodes() ); SwNodeIndex aEnd( rDoc.GetNodes() ); - SwContentIndex aCntEnd( pEnd->nContent ); + SwContentIndex aCntEnd( pEnd->GetContentNode(), pEnd->GetContentIndex() ); if( pNode ) { @@ -1847,7 +1847,7 @@ namespace //local functions originally from docfmt.cxx } else aSt = pStt->GetNode(); - aCntEnd = pEnd->nContent; // aEnd was changed! + aCntEnd.Assign(pEnd->GetContentNode(), pEnd->GetContentIndex()); // aEnd was changed! } else aSt.Assign( pStt->GetNode(), +1 ); @@ -3968,10 +3968,6 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl( : newPos.GetContentIndex(); newPos.SetContent(nContent); } - else - { - newPos.nContent.Assign( nullptr, 0 ); - } aAnchor.SetAnchor( &newPos ); // Check recursion: if copying content inside the same frame, then don't copy the format. @@ -4980,7 +4976,7 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo // Don't copy the beginning completely? if( !bCopyCollFormat || bColumnSel || pStt->GetContentIndex() ) { - SwContentIndex aDestIdx( rPos.nContent ); + SwContentIndex aDestIdx( rPos.GetContentNode(), rPos.GetContentIndex() ); bool bCopyOk = false; if( !pDestTextNd ) {