diff options
author | Eike Rathke <erack@redhat.com> | 2015-09-21 15:26:50 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-09-21 15:38:20 +0200 |
commit | f09a91630c767370871389c28b81280807513431 (patch) | |
tree | bce099898b46583f6ac03a43a16c6e2bce89ecd1 /sc | |
parent | 41139b2261fb93886a8ba28d081b2d12a2f7835a (diff) |
Resolves: rhbz#1264585 check data pilot field name availability
Change-Id: Iaadf7044acb7299ee878de2fbc08992447587d62
Diffstat (limited to 'sc')
-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 aa8c7de34ca1..224c4d04b85b 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -1031,13 +1031,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 ); } } |