[Libreoffice-commits] .: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Aug 31 09:50:09 PDT 2012


 sc/source/filter/excel/xipivot.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit b4f913b5f5c48335dc80a5322b078e1d6ac2e3fe
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Fri Aug 31 12:46:54 2012 -0400

    fdo#54303: Prevent crash on load.
    
    Another simple null pointer check, to save the day.
    
    This unfortunately prevents the properties of the skipped field from
    being loaded properly, but it's still better than a immediate crash.
    
    Change-Id: I49398d80eb3bf0834b7e9830ac8be3ac776cb354

diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx
index 2d30efb..8f9596a 100644
--- a/sc/source/filter/excel/xipivot.cxx
+++ b/sc/source/filter/excel/xipivot.cxx
@@ -1091,7 +1091,11 @@ ScDPSaveDimension* XclImpPTField::ConvertRCPField( ScDPSaveData& rSaveData ) con
     if( !pCacheField || !pCacheField->IsSupportedField() )
         return 0;
 
-    ScDPSaveDimension& rSaveDim = *rSaveData.GetNewDimensionByName( rFieldName );
+    ScDPSaveDimension* pTest = rSaveData.GetNewDimensionByName(rFieldName);
+    if (!pTest)
+        return NULL;
+
+    ScDPSaveDimension& rSaveDim = *pTest;
 
     // orientation
     rSaveDim.SetOrientation( static_cast< sal_uInt16 >( maFieldInfo.GetApiOrient( EXC_SXVD_AXIS_ROWCOLPAGE ) ) );


More information about the Libreoffice-commits mailing list