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 /forms | |
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 'forms')
-rw-r--r-- | forms/source/richtext/rtattributehandler.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/forms/source/richtext/rtattributehandler.cxx b/forms/source/richtext/rtattributehandler.cxx index 804d6bb2d42d..653d42e46a5f 100644 --- a/forms/source/richtext/rtattributehandler.cxx +++ b/forms/source/richtext/rtattributehandler.cxx @@ -183,7 +183,7 @@ namespace frm AttributeCheckState ParaAlignmentHandler::implGetCheckState( const SfxPoolItem& _rItem ) const { - OSL_ENSURE( dynamic_cast<const SvxAdjustItem*>( &_rItem) != nullptr, "ParaAlignmentHandler::implGetCheckState: invalid pool item!" ); + assert( dynamic_cast<const SvxAdjustItem*>( &_rItem) && "ParaAlignmentHandler::implGetCheckState: invalid pool item!" ); SvxAdjust eAdjust = static_cast< const SvxAdjustItem& >( _rItem ).GetAdjust(); return ( eAdjust == m_eAdjust ) ? eChecked : eUnchecked; } @@ -213,7 +213,7 @@ namespace frm AttributeCheckState LineSpacingHandler::implGetCheckState( const SfxPoolItem& _rItem ) const { - OSL_ENSURE( dynamic_cast<const SvxLineSpacingItem*>( &_rItem) != nullptr, "LineSpacingHandler::implGetCheckState: invalid pool item!" ); + assert( dynamic_cast<const SvxLineSpacingItem*>( &_rItem) && "LineSpacingHandler::implGetCheckState: invalid pool item!" ); sal_uInt16 nLineSpace = static_cast< const SvxLineSpacingItem& >( _rItem ).GetPropLineSpace(); return ( nLineSpace == m_nLineSpace ) ? eChecked : eUnchecked; } @@ -250,7 +250,7 @@ namespace frm AttributeCheckState EscapementHandler::implGetCheckState( const SfxPoolItem& _rItem ) const { - OSL_ENSURE( dynamic_cast<const SvxEscapementItem*>( &_rItem) != nullptr, "EscapementHandler::getState: invalid pool item!" ); + assert( dynamic_cast<const SvxEscapementItem*>( &_rItem) && "EscapementHandler::getState: invalid pool item!" ); SvxEscapement eEscapement = static_cast< const SvxEscapementItem& >( _rItem ).GetEscapement(); return ( eEscapement == m_eEscapement ) ? eChecked : eUnchecked; } @@ -389,7 +389,7 @@ namespace frm AttributeCheckState ParagraphDirectionHandler::implGetCheckState( const SfxPoolItem& _rItem ) const { - OSL_ENSURE( dynamic_cast<const SvxFrameDirectionItem*>( &_rItem) != nullptr, "ParagraphDirectionHandler::implGetCheckState: invalid pool item!" ); + assert( dynamic_cast<const SvxFrameDirectionItem*>( &_rItem) && "ParagraphDirectionHandler::implGetCheckState: invalid pool item!" ); SvxFrameDirection eDirection = static_cast< const SvxFrameDirectionItem& >( _rItem ).GetValue(); return ( eDirection == m_eParagraphDirection ) ? eChecked : eUnchecked; } |