diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-01 14:03:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-01 14:05:27 +0100 |
commit | 62b39a7c48dcd74f5e14ffd78b3ab917a84d7622 (patch) | |
tree | f5630fb02405e6b8a1db9967f63dae57d17e2b63 /basic | |
parent | 2cea241cb55f8c8714744fab4c4e83a07ad66ffa (diff) |
coverity#1325255 Unchecked dynamic_cast
Change-Id: Ie1a6b231e0313d1c00ffb9ab0137af2beeb05e02
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/runtime/runtime.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
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<SbUnoObject*>( pObj ); - bOk = checkUnoObjectType( pUnoObj, aClass ); + SbUnoObject& rUnoObj = dynamic_cast<SbUnoObject&>(*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<const SbxMethod*>( p) || !p->IsBroadcaster()) ) { // Check for default method with named parameters - SbxBaseRef pObj = p->GetObject(); - if( pObj && 0 != dynamic_cast<const SbUnoObject*>( &pObj) ) + SbxBaseRef xObj = p->GetObject(); + if (SbUnoObject* pUnoObj = dynamic_cast<SbUnoObject*>(&xObj)) { - SbUnoObject* pUnoObj = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pObj)); Any aAny = pUnoObj->getUnoAny(); if( aAny.getValueType().getTypeClass() == TypeClass_INTERFACE ) |