Kaydet (Commit) d2668a91 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Fix subsequentcheck. We need to have at least one measure data at all times.

Change-Id: I9ffe6a1cedc91fb0829b074097aa774f8eae8d88
üst 5e4b9d96
...@@ -732,10 +732,39 @@ void ScDPResultData::SetMeasureData( ...@@ -732,10 +732,39 @@ void ScDPResultData::SetMeasureData(
std::vector<ScSubTotalFunc>& rFunctions, std::vector<sheet::DataPilotFieldReference>& rRefs, std::vector<ScSubTotalFunc>& rFunctions, std::vector<sheet::DataPilotFieldReference>& rRefs,
std::vector<sal_uInt16>& rRefOrient, std::vector<OUString>& rNames ) std::vector<sal_uInt16>& rRefOrient, std::vector<OUString>& rNames )
{ {
maMeasureFuncs.swap(rFunctions); // We need to have at least one measure data at all times.
maMeasureRefs.swap(rRefs);
maMeasureRefOrients.swap(rRefOrient); if (rFunctions.empty())
maMeasureNames.swap(rNames); {
std::vector<ScSubTotalFunc> aDummy(1, SUBTOTAL_FUNC_NONE);
maMeasureFuncs.swap(aDummy);
}
else
maMeasureFuncs.swap(rFunctions);
if (rRefs.empty())
{
std::vector<sheet::DataPilotFieldReference> aDummy(1); // default ctor is ok.
maMeasureRefs.swap(aDummy);
}
else
maMeasureRefs.swap(rRefs);
if (rRefOrient.empty())
{
std::vector<sal_uInt16> aDummy(1, sheet::DataPilotFieldOrientation_HIDDEN);
maMeasureRefOrients.swap(aDummy);
}
else
maMeasureRefOrients.swap(rRefOrient);
if (rNames.empty())
{
std::vector<OUString> aDummy(1, ScGlobal::GetRscString(STR_EMPTYDATA));
maMeasureNames.swap(aDummy);
}
else
maMeasureNames.swap(rNames);
} }
void ScDPResultData::SetDataLayoutOrientation( sal_uInt16 nOrient ) void ScDPResultData::SetDataLayoutOrientation( sal_uInt16 nOrient )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment