sw/source/core/undo/rolbck.cxx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
New commits: commit ea49800fc2d545aa68fc625563ebfe9d495acc2a Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Sat Oct 1 09:38:45 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sun Oct 2 17:27:25 2022 +0200 use more SetPosition::SetContent part of the process of hiding the internals of SwPosition. Also, remove code that checks if pCnd is nullptr, because we have already dereferenced it at that point. Change-Id: I5362c2540af88bdd35db95472ceed420b90cf1bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140827 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index ae537a16926f..6413ce4329d8 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -945,17 +945,11 @@ void SwHistoryChangeFlyAnchor::SetInDoc( SwDoc* pDoc, bool ) SwContentNode* pCNd = pNd->GetContentNode(); SwPosition aPos( *pNd ); if ( COMPLETE_STRING != m_nOldContentIndex ) - { - OSL_ENSURE(pCNd, "SwHistoryChangeFlyAnchor: no ContentNode"); - if (pCNd) - { - aPos.nContent.Assign( pCNd, m_nOldContentIndex ); - } - } + aPos.SetContent( m_nOldContentIndex ); aTmp.SetAnchor( &aPos ); // so the Layout does not get confused - if (!pCNd || !pCNd->getLayoutFrame(pDoc->getIDocumentLayoutAccess().GetCurrentLayout(), nullptr, nullptr)) + if (!pCNd->getLayoutFrame(pDoc->getIDocumentLayoutAccess().GetCurrentLayout(), nullptr, nullptr)) { m_rFormat.DelFrames(); }