diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-10-01 09:38:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-10-02 17:27:25 +0200 |
commit | ea49800fc2d545aa68fc625563ebfe9d495acc2a (patch) | |
tree | 941a9ca82a3272ac828bb448cf71904a49659da4 | |
parent | d23ca66f4dcdae9470972aed6861e84167a8571e (diff) |
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.grandin@collabora.co.uk>
-rw-r--r-- | sw/source/core/undo/rolbck.cxx | 10 |
1 files changed, 2 insertions, 8 deletions
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(); } |