summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-01-28 13:52:45 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-01-28 14:30:42 +0000
commitd31a216b1f2f1c7bfc241f43b042b289da595647 (patch)
tree9b5bb1e28435c5f8038a52867523f4fbf0d2fdd6
parent40c78e72656f5373c72bc725724071295c36fd62 (diff)
coverity#705814 Dereference before null check
Change-Id: Ib5eb5a7058098f7222b1597e60ddc84786403805
-rw-r--r--forms/source/misc/InterfaceContainer.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx
index 2acb2ef02526..f76f8a0a2c93 100644
--- a/forms/source/misc/InterfaceContainer.cxx
+++ b/forms/source/misc/InterfaceContainer.cxx
@@ -875,11 +875,11 @@ void OInterfaceContainer::implInsert(sal_Int32 _nIndex, const Reference< XProper
if ( bHandleVbaEvents )
{
Reference< XEventAttacherManager > xMgr ( pElementMetaData->xInterface, UNO_QUERY );
- if ( xMgr.is() )
+ OInterfaceContainer* pIfcMgr = xMgr.is() ? dynamic_cast<OInterfaceContainer*>(xMgr.get()) : NULL;
+ if (pIfcMgr)
{
- OInterfaceContainer* pIfcMgr = dynamic_cast< OInterfaceContainer* >( xMgr.get() );
sal_Int32 nLen = pIfcMgr->getCount();
- for ( sal_Int32 i = 0; (i < nLen) && pIfcMgr ; ++i )
+ for (sal_Int32 i = 0; i < nLen; ++i)
{
// add fake events to the control at index i
pIfcMgr->impl_addVbEvents_nolck_nothrow( i );