[Libreoffice-commits] .: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Dec 15 14:35:17 PST 2012


 sc/source/filter/oox/formulabase.cxx |   19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

New commits:
commit 9a0bc6d06e30377d2ddf05bf5975dc8c850c8f97
Author: Eike Rathke <erack at redhat.com>
Date:   Sat Dec 15 23:29:35 2012 +0100

    add missing *IFS pieces to Excel filter
    
    These were omitted in ba950a50b0d0863e18ef781214eaaff9a8684790 because
    oox/source/xls/formulabase.cxx was moved to
    source/filter/oox/formulabase.cxx
    
    AVERAGEIF, AVERAGEIFS, COUNTIFS, SUMIFS
    
    Merged from Apache OO, parts of
    http://svn.apache.org/viewvc?rev=1381452&view=rev
    Original Apache OO committer: Andrew Rist <arist at apache.org>
    
    Original Author: Daniel Rentz [dr] <daniel.rentz at oracle.com>
    Original Committer: Daniel Rentz [dr] <daniel.rentz at oracle.com>
    
     # HG changeset patch
     # User Daniel Rentz [dr] <daniel.rentz at oracle.com>
     # Date 1299664669 -3600
     # Node ID 89feb2fb2947d76a15e2de8bc1def1edf20e4f88
     # Parent  1bf6d73db8a4ee709aa4d9d9d827efafc9c611d2
    
    Change-Id: I0756e1da4aa2acaefb86b5813e047b2768c192a1

diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx
index 1a946ee..e7060ce 100644
--- a/sc/source/filter/oox/formulabase.cxx
+++ b/sc/source/filter/oox/formulabase.cxx
@@ -712,10 +712,10 @@ static const FunctionData saFuncTableOox[] =
     { 0,                        "CUBESET",              478,    NOID,   2,  5,  V, { VR, RX, VR }, 0 },
     { 0,                        "CUBESETCOUNT",         479,    NOID,   1,  1,  V, { VR }, 0 },
     { 0,                        "IFERROR",              480,    NOID,   2,  2,  V, { VO, RO }, 0 },
-    { 0,                        "COUNTIFS",             481,    NOID,   2,  MX, V, { RO, VR }, FUNCFLAG_PARAMPAIRS },
-    { 0,                        "SUMIFS",               482,    NOID,   3,  MX, V, { RO, RO, VR }, FUNCFLAG_PARAMPAIRS },
-    { 0,                        "AVERAGEIF",            483,    NOID,   2,  3,  V, { RO, VR, RO }, 0 },
-    { 0,                        "AVERAGEIFS",           484,    NOID,   3,  MX, V, { RO, RO, VR }, FUNCFLAG_PARAMPAIRS }
+    { "COUNTIFS",               "COUNTIFS",             481,    NOID,   2,  MX, V, { RO, VR }, FUNCFLAG_MACROCALL | FUNCFLAG_PARAMPAIRS },
+    { "SUMIFS",                 "SUMIFS",               482,    NOID,   3,  MX, V, { RO, RO, VR }, FUNCFLAG_MACROCALL | FUNCFLAG_PARAMPAIRS },
+    { "AVERAGEIF",              "AVERAGEIF",            483,    NOID,   2,  3,  V, { RO, VR, RO }, FUNCFLAG_MACROCALL },
+    { "AVERAGEIFS",             "AVERAGEIFS",           484,    NOID,   3,  MX, V, { RO, RO, VR }, FUNCFLAG_MACROCALL | FUNCFLAG_PARAMPAIRS }
 };
 
 /** Functions defined by OpenFormula, but not supported by Calc or by Excel. */
@@ -776,8 +776,6 @@ FunctionParamInfoIterator::FunctionParamInfoIterator( const FunctionInfo& rFuncI
     mpParamInfoEnd( rFuncInfo.mpParamInfos + FUNCINFO_PARAMINFOCOUNT ),
     mbParamPairs( rFuncInfo.mbParamPairs )
 {
-    OSL_ENSURE( !mbParamPairs || (mpParamInfo + 1 < mpParamInfoEnd),
-        "FunctionParamInfoIterator::FunctionParamInfoIterator - expecting at least 2 infos for paired parameters" );
 }
 
 bool FunctionParamInfoIterator::isCalcOnlyParam() const
@@ -797,12 +795,12 @@ FunctionParamInfoIterator& FunctionParamInfoIterator::operator++()
         // move pointer to next entry, if something explicit follows
         if( (mpParamInfo + 1 < mpParamInfoEnd) && (mpParamInfo[ 1 ].meValid != FUNC_PARAM_NONE) )
             ++mpParamInfo;
-        // points to last info, but parameter pairs expected, move to previous info
-        else if( mbParamPairs )
-            --mpParamInfo;
         // if last parameter type is 'Excel-only' or 'Calc-only', do not repeat it
         else if( isExcelOnlyParam() || isCalcOnlyParam() )
             mpParamInfo = 0;
+        // points to last info, but parameter pairs expected, move to previous info
+        else if( mbParamPairs )
+            --mpParamInfo;
         // otherwise: repeat last parameter class
     }
     return *this;
@@ -867,8 +865,7 @@ FunctionProviderImpl::FunctionProviderImpl( FilterType eFilter, BiffType eBiff,
         initFuncs( saFuncTableBiff5, STATIC_ARRAY_END( saFuncTableBiff5 ), nMaxParam, bImportFilter );
     if( eBiff >= BIFF8 )
         initFuncs( saFuncTableBiff8, STATIC_ARRAY_END( saFuncTableBiff8 ), nMaxParam, bImportFilter );
-    if( eFilter == FILTER_OOXML )
-        initFuncs( saFuncTableOox, STATIC_ARRAY_END( saFuncTableOox ), nMaxParam, bImportFilter );
+    initFuncs( saFuncTableOox, STATIC_ARRAY_END( saFuncTableOox ), nMaxParam, bImportFilter );
     initFuncs( saFuncTableOdf, STATIC_ARRAY_END( saFuncTableOdf ), nMaxParam, bImportFilter );
 }
 


More information about the Libreoffice-commits mailing list