diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-08 15:01:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-08 22:17:05 +0200 |
commit | e11386053d3c404fbeab8b66402d68f813f7dd58 (patch) | |
tree | 1309275bb4cc8a1bb74372d94a4439fb99762094 /sw/source/core/edit/edtox.cxx | |
parent | 41a55bde344f924edd36dbbeead45c426ee07e4d (diff) |
convert some OSL_ENSURE -> assert
where we are just provide checking for a following static_cast.
I'd rather have an explicit assert failure than a random crash
Change-Id: Iab6c6b056341018deaa74b78b075e564f72c58d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121814
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/edit/edtox.cxx')
-rw-r--r-- | sw/source/core/edit/edtox.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index ebd201fd7efb..c10f36671cd4 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -91,14 +91,14 @@ void SwEditShell::GetCurTOXMarks(SwTOXMarks& rMarks) const bool SwEditShell::IsTOXBaseReadonly(const SwTOXBase& rTOXBase) { - OSL_ENSURE( dynamic_cast<const SwTOXBaseSection*>( &rTOXBase) != nullptr, "no TOXBaseSection!" ); + assert( dynamic_cast<const SwTOXBaseSection*>( &rTOXBase) && "no TOXBaseSection!" ); const SwTOXBaseSection& rTOXSect = static_cast<const SwTOXBaseSection&>(rTOXBase); return rTOXSect.IsProtect(); } void SwEditShell::SetTOXBaseReadonly(const SwTOXBase& rTOXBase, bool bReadonly) { - OSL_ENSURE( dynamic_cast<const SwTOXBaseSection*>( &rTOXBase) != nullptr, "no TOXBaseSection!" ); + assert( dynamic_cast<const SwTOXBaseSection*>( &rTOXBase) && "no TOXBaseSection!" ); const SwTOXBaseSection& rTOXSect = static_cast<const SwTOXBaseSection&>(rTOXBase); const_cast<SwTOXBase&>(rTOXBase).SetProtected(bReadonly); OSL_ENSURE( rTOXSect.SwSection::GetType() == SectionType::ToxContent, "not a TOXContentSection" ); @@ -237,7 +237,7 @@ const SwTOXBase* SwEditShell::GetTOX( sal_uInt16 nPos ) const pSect->GetFormat()->GetSectionNode() && nCnt++ == nPos ) { - OSL_ENSURE( dynamic_cast<const SwTOXBaseSection*>( pSect) != nullptr, "no TOXBaseSection!" ); + assert( dynamic_cast<const SwTOXBaseSection*>( pSect) && "no TOXBaseSection!" ); return static_cast<const SwTOXBaseSection*>(pSect); } } |