[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Thu Apr 14 13:05:43 PDT 2011


 sc/source/core/tool/interpr2.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit b45254a0d973e1da278d5e8d269b688628f2603f
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Thu Apr 14 15:58:21 2011 -0400

    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.

diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index aa06d91..39ab253 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 )


More information about the Libreoffice-commits mailing list