[Libreoffice-commits] core.git: sc/source

Norbert Thiebaud nthiebaud at gmail.com
Thu Jun 27 12:16:08 PDT 2013


 sc/source/filter/xcl97/xcl97esc.cxx |   43 +++++++++++++++++++-----------------
 1 file changed, 23 insertions(+), 20 deletions(-)

New commits:
commit 9edbfa59a8793b7878c47af4f0467d9b585ce993
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Wed Jun 26 01:44:00 2013 -0500

    coverity#1027641 Dereference after null check
    
    Change-Id: I63ea1016e8946ca6b269f56f591a3a5cc7a99e6d
    Reviewed-on: https://gerrit.libreoffice.org/4527
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx
index bcdec46..8e380d4 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 )


More information about the Libreoffice-commits mailing list