summaryrefslogtreecommitdiff
path: root/sc/source/filter/oox/formulabase.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-12-15 23:29:35 +0100
committerEike Rathke <erack@redhat.com>2012-12-15 23:34:57 +0100
commit9a0bc6d06e30377d2ddf05bf5975dc8c850c8f97 (patch)
treec9e39c40a9e19fbfbee93d95dc9762dedc45c799 /sc/source/filter/oox/formulabase.cxx
parente37eb6345dcc09620889a9b8622ea0b7b57da0e0 (diff)
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@apache.org> Original Author: Daniel Rentz [dr] <daniel.rentz@oracle.com> Original Committer: Daniel Rentz [dr] <daniel.rentz@oracle.com> # HG changeset patch # User Daniel Rentz [dr] <daniel.rentz@oracle.com> # Date 1299664669 -3600 # Node ID 89feb2fb2947d76a15e2de8bc1def1edf20e4f88 # Parent 1bf6d73db8a4ee709aa4d9d9d827efafc9c611d2 Change-Id: I0756e1da4aa2acaefb86b5813e047b2768c192a1
Diffstat (limited to 'sc/source/filter/oox/formulabase.cxx')
-rw-r--r--sc/source/filter/oox/formulabase.cxx19
1 files changed, 8 insertions, 11 deletions
diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx
index 1a946eee5804..e7060ce5a337 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 );
}