summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2013-06-26 01:44:00 -0500
committerCaolán McNamara <caolanm@redhat.com>2013-06-27 19:15:47 +0000
commit9edbfa59a8793b7878c47af4f0467d9b585ce993 (patch)
tree3761891d9f3e1719d904ab4acc6b74f010425f44
parent73077b16a78e7245d22a0c7c92b24eda39243189 (diff)
coverity#1027641 Dereference after null check
Change-Id: I63ea1016e8946ca6b269f56f591a3a5cc7a99e6d Reviewed-on: https://gerrit.libreoffice.org/4527 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/filter/xcl97/xcl97esc.cxx43
1 files changed, 23 insertions, 20 deletions
diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx
index bcdec460cc66..8e380d4e3098 100644
--- a/sc/source/filter/xcl97/xcl97esc.cxx
+++ b/sc/source/filter/xcl97/xcl97esc.cxx
@@ -319,28 +319,31 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape
}
}
}
- //add for exporting OCX control
- //for OCX control import from MS office file,we need keep the id value as MS office file.
- //GetOldRoot().pObjRecs->Add( pCurrXclObj ) statement has generated the id value as obj id rule;
- //but we trick it here.
- sal_uInt16 nObjType = pObj->GetObjIdentifier();
- if( nObjType == OBJ_UNO && pCurrXclObj )
+ if(pObj)
{
- Reference< XPropertySet > xPropSet( rxShape, UNO_QUERY );
- Any aAny;
- try
- {
- aAny = xPropSet->getPropertyValue(rtl::OUString::createFromAscii("ObjIDinMSO"));
- }
- catch(const Exception&)
- {
- OSL_TRACE("XclEscherEx::StartShape, this control can't get the property ObjIDinMSO!");
- }
- sal_uInt16 nObjIDinMSO = 0xFFFF;
- aAny >>= nObjIDinMSO;
- if( nObjIDinMSO != 0xFFFF && nMsCtlType == 2) //OCX
+ //add for exporting OCX control
+ //for OCX control import from MS office file,we need keep the id value as MS office file.
+ //GetOldRoot().pObjRecs->Add( pCurrXclObj ) statement has generated the id value as obj id rule;
+ //but we trick it here.
+ sal_uInt16 nObjType = pObj->GetObjIdentifier();
+ if( nObjType == OBJ_UNO && pCurrXclObj )
{
- pCurrXclObj->SetId(nObjIDinMSO);
+ Reference< XPropertySet > xPropSet( rxShape, UNO_QUERY );
+ Any aAny;
+ try
+ {
+ aAny = xPropSet->getPropertyValue(rtl::OUString::createFromAscii("ObjIDinMSO"));
+ }
+ catch(const Exception&)
+ {
+ OSL_TRACE("XclEscherEx::StartShape, this control can't get the property ObjIDinMSO!");
+ }
+ sal_uInt16 nObjIDinMSO = 0xFFFF;
+ aAny >>= nObjIDinMSO;
+ if( nObjIDinMSO != 0xFFFF && nMsCtlType == 2) //OCX
+ {
+ pCurrXclObj->SetId(nObjIDinMSO);
+ }
}
}
if ( !pCurrXclObj )