coverity#1325255 Unchecked dynamic_cast
Change-Id: Ie1a6b231e0313d1c00ffb9ab0137af2beeb05e02
This commit is contained in:
@@ -3254,8 +3254,8 @@ bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal,
|
|||||||
{
|
{
|
||||||
if ( ( bVBAEnabled || CodeCompleteOptions::IsExtendedTypeDeclaration() ) && pObj->IsA( TYPE(SbUnoObject) ) )
|
if ( ( bVBAEnabled || CodeCompleteOptions::IsExtendedTypeDeclaration() ) && pObj->IsA( TYPE(SbUnoObject) ) )
|
||||||
{
|
{
|
||||||
SbUnoObject* pUnoObj = dynamic_cast<SbUnoObject*>( pObj );
|
SbUnoObject& rUnoObj = dynamic_cast<SbUnoObject&>(*pObj);
|
||||||
bOk = checkUnoObjectType( pUnoObj, aClass );
|
bOk = checkUnoObjectType(&rUnoObj, aClass);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
bOk = false;
|
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()) )
|
else if( bVBAEnabled && p->GetType() == SbxOBJECT && (0 == dynamic_cast<const SbxMethod*>( p) || !p->IsBroadcaster()) )
|
||||||
{
|
{
|
||||||
// Check for default method with named parameters
|
// Check for default method with named parameters
|
||||||
SbxBaseRef pObj = p->GetObject();
|
SbxBaseRef xObj = p->GetObject();
|
||||||
if( pObj && 0 != dynamic_cast<const SbUnoObject*>( &pObj) )
|
if (SbUnoObject* pUnoObj = dynamic_cast<SbUnoObject*>(&xObj))
|
||||||
{
|
{
|
||||||
SbUnoObject* pUnoObj = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pObj));
|
|
||||||
Any aAny = pUnoObj->getUnoAny();
|
Any aAny = pUnoObj->getUnoAny();
|
||||||
|
|
||||||
if( aAny.getValueType().getTypeClass() == TypeClass_INTERFACE )
|
if( aAny.getValueType().getTypeClass() == TypeClass_INTERFACE )
|
||||||
|
Reference in New Issue
Block a user