diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-04-14 15:58:21 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-04-14 16:04:16 -0400 |
commit | b45254a0d973e1da278d5e8d269b688628f2603f (patch) | |
tree | dd2dd68179923adc7891b0c82fba610ecd16d4c5 | |
parent | 14ecbe7ce709c5c96a7954aeb611807be25cea9f (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.cxx | 6 |
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 ) |