summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-01-04 00:23:02 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-01-04 09:45:19 -0500
commit352306eee03e78ddbfe06fc107a3e4a6072ecd76 (patch)
treee082a511db45766ee947179d79e97382eb96bdfc
parent3b4f995cfd153e4d45d09f5f0fc54d1bb9c11889 (diff)
More on removing use of SC_DP_MAX_FIELDS.
This time it's in ScDPSource::CreateRes_Impl(). Change-Id: Ie2657045aeb8770c083daa34dc1a7e60c9921b65
-rw-r--r--sc/source/core/data/dptabsrc.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index 88d5fdb961a5..6b46671c8aca 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -753,8 +753,8 @@ void ScDPSource::CreateRes_Impl()
// or pointer arrays.
vector<rtl::OUString> aDataNames;
sheet::DataPilotFieldReference* pDataRefValues = NULL;
- ScSubTotalFunc eDataFunctions[SC_DP_MAX_FIELDS];
- sal_uInt16 nDataRefOrient[SC_DP_MAX_FIELDS];
+ vector<ScSubTotalFunc> aDataFunctions;
+ vector<sal_uInt16> aDataRefOrient;
if (nDataDimCount)
{
aDataNames.resize(nDataDimCount);
@@ -785,11 +785,11 @@ void ScDPSource::CreateRes_Impl()
}
// Map UNO's enum to internal enum ScSubTotalFunc.
- eDataFunctions[i] = ScDataUnoConversion::GeneralToSubTotal( eUser );
+ aDataFunctions.push_back(ScDataUnoConversion::GeneralToSubTotal(eUser));
// Get reference field/item information.
pDataRefValues[i] = pDim->GetReferenceValue();
- nDataRefOrient[i] = sheet::DataPilotFieldOrientation_HIDDEN; // default if not used
+ sal_uInt16 nDataRefOrient = sheet::DataPilotFieldOrientation_HIDDEN; // default if not used
sal_Int32 eRefType = pDataRefValues[i].ReferenceType;
if ( eRefType == sheet::DataPilotFieldReferenceType::ITEM_DIFFERENCE ||
eRefType == sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE ||
@@ -800,7 +800,7 @@ void ScDPSource::CreateRes_Impl()
GetDimensionsObject()->getElementNames() );
if ( nColumn >= 0 )
{
- nDataRefOrient[i] = GetOrientation( nColumn );
+ nDataRefOrient = GetOrientation(nColumn);
// need fully initialized results to find reference values
// (both in column or row dimensions), so updated values or
// differences to 0 can be displayed even for empty results.
@@ -808,6 +808,8 @@ void ScDPSource::CreateRes_Impl()
}
}
+ aDataRefOrient.push_back(nDataRefOrient);
+
aDataNames[i] = pDim->getName();
//! modify user visible strings as in ScDPResultData::GetMeasureString instead!
@@ -827,7 +829,7 @@ void ScDPSource::CreateRes_Impl()
}
pResData = new ScDPResultData( this );
- pResData->SetMeasureData( nDataDimCount, eDataFunctions, pDataRefValues, nDataRefOrient, aDataNames );
+ pResData->SetMeasureData(nDataDimCount, &aDataFunctions[0], pDataRefValues, &aDataRefOrient[0], aDataNames);
pResData->SetDataLayoutOrientation(nDataOrient);
pResData->SetLateInit( bLateInit );