incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhan...@apache.org
Subject svn commit: r1378570 - /incubator/ooo/trunk/main/sc/source/filter/excel/xiescher.cxx
Date Wed, 29 Aug 2012 14:16:54 GMT
Author: zhangjf
Date: Wed Aug 29 14:16:53 2012
New Revision: 1378570

URL: http://svn.apache.org/viewvc?rev=1378570&view=rev
Log:
#i119686#, refix, add SdrModel pointer check to avoid crashes in some cases

Found by: zhangjf, debin.lei
Patch by: zhangjf 
Review by: Oliver-Rainer Wittmann

Modified:
    incubator/ooo/trunk/main/sc/source/filter/excel/xiescher.cxx

Modified: incubator/ooo/trunk/main/sc/source/filter/excel/xiescher.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/filter/excel/xiescher.cxx?rev=1378570&r1=1378569&r2=1378570&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/filter/excel/xiescher.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/filter/excel/xiescher.cxx Wed Aug 29 14:16:53 2012
@@ -455,11 +455,15 @@ void XclImpDrawObjBase::PreProcessSdrObj
 {
     // default: front layer, derived classes may have to set other layer in DoPreProcessSdrObj()
     rSdrObj.NbcSetLayer( SC_LAYER_FRONT );
-    const bool bEnableUndo = rSdrObj.GetModel()->IsUndoEnabled();
-    rSdrObj.GetModel()->EnableUndo(false);
-    // set object name (GetObjName() will always return a non-empty name)
-    rSdrObj.SetName( GetObjName() );
-    rSdrObj.GetModel()->EnableUndo(bEnableUndo);
+    SdrModel * pModel = rSdrObj.GetModel();
+    if ( pModel ) {
+        const bool bEnableUndo = pModel->IsUndoEnabled();
+        pModel->EnableUndo(false);
+        // set object name (GetObjName() will always return a non-empty name)
+        rSdrObj.SetName( GetObjName() );
+        pModel->EnableUndo(bEnableUndo);
+    } else
+        rSdrObj.SetName( GetObjName() );
     // #i39167# full width for all objects regardless of horizontal alignment
     rSdrObj.SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_BLOCK ) );
 



Mime
View raw message