diff options
Diffstat (limited to 'sc/source/filter/excel/xipivot.cxx')
-rw-r--r-- | sc/source/filter/excel/xipivot.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index 2b48bcb116b0..fbf5995c8fe1 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -1026,13 +1026,19 @@ void XclImpPTField::ConvertDataField( ScDPSaveData& rSaveData ) const XclPTDataFieldInfoList::const_iterator aIt = maDataInfoList.begin(), aEnd = maDataInfoList.end(); - ScDPSaveDimension& rSaveDim = *rSaveData.GetNewDimensionByName(aFieldName); - ConvertDataField( rSaveDim, *aIt ); + ScDPSaveDimension* pSaveDim = rSaveData.GetNewDimensionByName(aFieldName); + if (!pSaveDim) + { + SAL_WARN("sc.filter","XclImpPTField::ConvertDataField - field name not found: " << aFieldName); + return; + } + + ConvertDataField( *pSaveDim, *aIt ); // multiple data fields -> clone dimension for( ++aIt; aIt != aEnd; ++aIt ) { - ScDPSaveDimension& rDupDim = rSaveData.DuplicateDimension( rSaveDim ); + ScDPSaveDimension& rDupDim = rSaveData.DuplicateDimension( *pSaveDim ); ConvertDataFieldInfo( rDupDim, *aIt ); } } |