summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-04-14 15:58:21 -0400
committerKohei Yoshida <kyoshida@novell.com>2011-04-14 16:04:16 -0400
commitb45254a0d973e1da278d5e8d269b688628f2603f (patch)
treedd2dd68179923adc7891b0c82fba610ecd16d4c5
parent14ecbe7ce709c5c96a7954aeb611807be25cea9f (diff)
fdo#34306: Append fake parameter in case of un-even parameter count.
GETPIVOTDATA requires an even number of parameters. But in Excel you can leave the last parameter blank, which, when imported to Calc, gets stripped off by the import filter. Rather than supporting an empty parameter like Excel does, which requires a bit more effort both in the import filter and the formula interpreter, let's have the GETPIVOTDATA function compensate for the missing parameter in-situ by adding an imaginary empty string as the extra parameter.
-rw-r--r--sc/source/core/tool/interpr2.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index aa06d915c..39ab253c8 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -2943,7 +2943,11 @@ void ScInterpreter::ScGetPivotData()
// there must be an even number of args
// target, ref, then field/item pairs
if( (nParamCount % 2) == 1)
- goto failed;
+ {
+ // if not, append an extra fake parameter to compensate for it.
+ PushString(ScGlobal::GetEmptyString());
+ ++nParamCount;
+ }
bool bOldSyntax = false;
if ( nParamCount == 2 )