From e31cd8f3ae7c1edc97369291266c75e8a3a4db8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 1 Oct 2015 14:12:06 +0100 Subject: [PATCH] coverity#1325250 Unchecked dynamic_cast Change-Id: Id52cad11d2ca4ef42a31c0905ee123ccd53e0677 --- basic/source/classes/sbunoobj.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 299ea38d8a9f..216210f17985 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -135,15 +135,14 @@ SbxVariable* getDefaultProp( SbxVariable* pRef ) SbxVariable* pDefaultProp = NULL; if ( pRef->GetType() == SbxOBJECT ) { - SbxObject* pObj = dynamic_cast( pRef ); - if ( !pObj ) + SbxObject* pObj = dynamic_cast(pRef); + if (!pObj) { SbxBase* pObjVarObj = pRef->GetObject(); pObj = dynamic_cast( pObjVarObj ); } - if ( pObj && 0 != dynamic_cast( pObj) ) + if (SbUnoObject* pUnoObj = dynamic_cast(pObj)) { - SbUnoObject* pUnoObj = dynamic_cast( pObj ); pDefaultProp = pUnoObj->GetDfltProperty(); } }