diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-08-29 17:18:09 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-08-29 18:24:32 -0400 |
commit | 3b856f028735d292c9b02168704d4a07e2f43cd5 (patch) | |
tree | 00cc861b7a48ca78785fb408dcca5cd859383d26 /sc/source | |
parent | bfaf4401b440b56d6e226a4dca32a18e84949d52 (diff) |
Use the source dimension name when searching for a dimension.
Otherwise we might miss the right dimension object. This fixes the bug where
the subtotal function of the second data field was not set correctly when
importing from xlsx.
Change-Id: Id6ecb07b86cf6803a3f6f7604267ce2f5f9a4067
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/unoobj/dapiuno.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index 5cc6f06a6a12..cd4e0a2b1652 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -38,6 +38,7 @@ #include "dpgroup.hxx" #include "dpdimsave.hxx" #include "hints.hxx" +#include <dputil.hxx> #include <com/sun/star/sheet/XHierarchiesSupplier.hpp> #include <com/sun/star/sheet/XLevelsSupplier.hpp> @@ -1481,13 +1482,17 @@ ScDPSaveDimension* ScDataPilotChildObjBase::GetDPDimension( ScDPObject** ppDPObj return pSaveData->GetDimensionByName( maFieldId.maFieldName ); // find dimension with specified index (search in duplicated dimensions) - const boost::ptr_vector<ScDPSaveDimension>& rDimensions = pSaveData->GetDimensions(); + const ScDPSaveData::DimsType& rDims = pSaveData->GetDimensions(); sal_Int32 nFoundIdx = 0; - boost::ptr_vector<ScDPSaveDimension>::const_iterator it; - for(it = rDimensions.begin(); it != rDimensions.end(); ++it) + ScDPSaveData::DimsType::const_iterator it; + for (it = rDims.begin(); it != rDims.end(); ++it) { - if( !it->IsDataLayout() && (it->GetName() == maFieldId.maFieldName) ) + if (it->IsDataLayout()) + continue; + + OUString aSrcName = ScDPUtil::getSourceDimensionName(it->GetName()); + if (aSrcName == maFieldId.maFieldName) { if( nFoundIdx == maFieldId.mnFieldIdx ) return const_cast<ScDPSaveDimension*>(&(*it)); |