From 3afb514362a2ce2701628256fa96d4a5324433d6 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 8 Sep 2021 13:33:44 +0200 Subject: simplify static_cast after dynamic_cast Change-Id: I53ae7f18519fdd878730d1d0316ebc408271c66d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121811 Tested-by: Jenkins Reviewed-by: Noel Grandin --- basic/source/classes/eventatt.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'basic') diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index 6fa48784212e..6489d88d8339 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -417,12 +417,12 @@ void RTL_Impl_CreateUnoDialog( SbxArray& rPar ) // Get dialog SbxBaseRef pObj = rPar.Get(1)->GetObject(); - if( !(pObj.is() && dynamic_cast( pObj.get() ) != nullptr) ) + SbUnoObject* pUnoObj = dynamic_cast(pObj.get()); + if( !pUnoObj ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - SbUnoObject* pUnoObj = static_cast(pObj.get()); Any aAnyISP = pUnoObj->getUnoAny(); TypeClass eType = aAnyISP.getValueType().getTypeClass(); -- cgit