diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-01-19 09:03:01 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-01-19 10:33:16 +0000 |
commit | c6668bf7f87bb50ee5d795f17a67666018931b9a (patch) | |
tree | 7042d9dd16b88792ae0647884f0d4d4d26dfe796 /forms/source | |
parent | 579d144290c1617fdb38d09b30900a6bbe390b8d (diff) |
cid#1520418 Unchecked dynamic_cast
and
cid#1520419 Unchecked dynamic_cast
cid#1520420 Unchecked dynamic_cast
Change-Id: Ia5ef238677bd5eadcdb7fc3fcf982d8a1507133c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145768
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'forms/source')
-rw-r--r-- | forms/source/xforms/model.cxx | 2 | ||||
-rw-r--r-- | forms/source/xforms/model_helper.hxx | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/forms/source/xforms/model.cxx b/forms/source/xforms/model.cxx index 0bab14a61cc8..0cab2350385e 100644 --- a/forms/source/xforms/model.cxx +++ b/forms/source/xforms/model.cxx @@ -428,7 +428,7 @@ void SAL_CALL Model::submitWithInteraction( { Submission* pSubmission = dynamic_cast<Submission*>( mxSubmissions->getItem( sID ).get() ); - OSL_ENSURE( pSubmission != nullptr, "no submission?" ); + assert(pSubmission && "no submission?"); OSL_ENSURE( pSubmission->getModelImpl() == this, "wrong model" ); diff --git a/forms/source/xforms/model_helper.hxx b/forms/source/xforms/model_helper.hxx index 0ec03591bc0a..ae8d78da7c0d 100644 --- a/forms/source/xforms/model_helper.hxx +++ b/forms/source/xforms/model_helper.hxx @@ -91,14 +91,14 @@ protected: virtual void _insert( const T& t ) override { auto pSubmission = dynamic_cast<Submission*>( t.get() ); - OSL_ENSURE( pSubmission != nullptr, "invalid item?" ); + assert(pSubmission && "invalid item?"); pSubmission->setModel( mpModel ); } virtual void _remove( const T& t ) override { auto pSubmission = dynamic_cast<Submission*>( t.get() ); - OSL_ENSURE( pSubmission != nullptr, "invalid item?" ); + assert(pSubmission && "invalid item?"); pSubmission->setModel( nullptr ); } }; |