diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index fe29acdbd7b6..080aac6a8c24 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -3254,8 +3254,8 @@ bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal, { if ( ( bVBAEnabled || CodeCompleteOptions::IsExtendedTypeDeclaration() ) && pObj->IsA( TYPE(SbUnoObject) ) ) { - SbUnoObject* pUnoObj = dynamic_cast( pObj ); - bOk = checkUnoObjectType( pUnoObj, aClass ); + SbUnoObject& rUnoObj = dynamic_cast(*pObj); + bOk = checkUnoObjectType(&rUnoObj, aClass); } else bOk = false; @@ -3723,10 +3723,9 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 ) else if( bVBAEnabled && p->GetType() == SbxOBJECT && (0 == dynamic_cast( p) || !p->IsBroadcaster()) ) { // Check for default method with named parameters - SbxBaseRef pObj = p->GetObject(); - if( pObj && 0 != dynamic_cast( &pObj) ) + SbxBaseRef xObj = p->GetObject(); + if (SbUnoObject* pUnoObj = dynamic_cast(&xObj)) { - SbUnoObject* pUnoObj = static_cast(static_cast(pObj)); Any aAny = pUnoObj->getUnoAny(); if( aAny.getValueType().getTypeClass() == TypeClass_INTERFACE )