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

Handle the old syntax for GETPIVOTDATA.

The old syntax is Calc only (not Excel), and is specified in ODF 1.2.

Change-Id: I9551d408ae136d3567375e905b1273103a8f616a
üst 2bc52ff7
......@@ -3097,42 +3097,64 @@ void ScInterpreter::ScGetPivotData()
bOldSyntax = true;
}
std::vector<sheet::DataPilotFieldFilter> aFilters;
OUString aDataFieldName;
ScRange aBlock;
if (bOldSyntax)
{
// TODO: I'll handle this later.
PushError(errNoRef);
return;
}
aDataFieldName = GetString();
// Standard syntax: separate name/value pairs
switch (GetStackType())
{
case svDoubleRef :
PopDoubleRef(aBlock);
break;
case svSingleRef :
{
ScAddress aAddr;
PopSingleRef(aAddr);
aBlock = aAddr;
}
break;
default:
PushError(errNoRef);
return;
}
}
else
{
// Standard syntax: separate name/value pairs
sal_uInt16 nFilterCount = nParamCount / 2 - 1;
std::vector<sheet::DataPilotFieldFilter> aFilters(nFilterCount);
sal_uInt16 nFilterCount = nParamCount / 2 - 1;
aFilters.resize(nFilterCount);
sal_uInt16 i = nFilterCount;
while (i-- > 0)
{
//! should allow numeric constraint values
aFilters[i].MatchValue = GetString();
aFilters[i].FieldName = GetString();
}
sal_uInt16 i = nFilterCount;
while (i-- > 0)
{
//! should allow numeric constraint values
aFilters[i].MatchValue = GetString();
aFilters[i].FieldName = GetString();
}
ScRange aBlock;
switch (GetStackType())
{
case svDoubleRef :
PopDoubleRef(aBlock);
break;
case svSingleRef :
switch (GetStackType())
{
ScAddress aAddr;
PopSingleRef(aAddr);
aBlock = aAddr;
case svDoubleRef :
PopDoubleRef(aBlock);
break;
case svSingleRef :
{
ScAddress aAddr;
PopSingleRef(aAddr);
aBlock = aAddr;
}
break;
default:
PushError(errNoRef);
return;
}
break;
default:
PushError(errNoRef);
return;
aDataFieldName = GetString(); // First parameter is data field name.
}
// NOTE : MS Excel docs claim to use the 'most recent' which is not
......@@ -3145,8 +3167,6 @@ void ScInterpreter::ScGetPivotData()
return;
}
OUString aDataFieldName = GetString(); // First parameter is data field name.
double fVal = pDPObj->GetPivotData(aDataFieldName, aFilters);
if (rtl::math::isNan(fVal))
{
......
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