summaryrefslogtreecommitdiff
path: root/oox/source/xls/formulabase.cxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-01-06 13:57:48 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-01-06 13:57:48 +0000
commit730272a2d67e99c0195ea42c26022ffbd489e994 (patch)
tree2268883449c5ccd3242d5c58cb0d59bc55420ecc /oox/source/xls/formulabase.cxx
parent75ab7be7fc7114e775442305bd1fb26a36975acc (diff)
CWS-TOOLING: integrate CWS odff05
2008-12-11 04:17:37 +0100 er r265237 : #i94555# AppendIntToken for GAMMADIST, Excel needs 4 parameters; also use AppendIntToken instead of AppendNumToken for POISSON 2008-12-11 04:04:27 +0100 er r265236 : #i96837# make cumulative parameter of POISSON optional; patch from <lvyue> with slight modifications 2008-12-11 03:35:03 +0100 er r265235 : #i96835# make base parameter of LOG() optional also in UI; patch from <lvyue> 2008-12-11 03:15:30 +0100 er r265234 : #i94555# patch from <regina>, ODFF: Add GAMMA, CHISQDIST, CHISQINV. Make the 'cumulative' parameter of GAMMADIST optional. Adapt the domain of CHIDIST to allow negative x. Remove the constraint "degrees of freedom < 1.0E5" from CHIDIST and CHIINV. Plus a mechanism to write the now optional parameter of GAMMADIST to PODF and ODFF if omitted, for backwards compatibility. 2008-12-10 18:14:16 +0100 er r265214 : DBG_... need semicolon 2008-12-05 00:49:55 +0100 er r264881 : WaE unxlngi6: declaration of 'pFuncInfo' shadows a previous local 2008-12-05 00:26:05 +0100 er r264879 : #i91547# BETADIST with optional density/cumulative parameter and much better precision; patch from <regina> 2008-12-04 22:51:40 +0100 er r264877 : #i91602# add expm1() and log1p() replacements; based on a patch from <regina> 2008-12-01 16:07:35 +0100 dr r264614 : #i93789# import of EUROCONVERT from XLSX/XLSB 2008-11-28 13:15:01 +0100 dr r264543 : #i93789# new sheet function EUROCONVERT + XLS import/export, patch contributed by lvyue 2008-11-26 14:54:23 +0100 er r264397 : CWS-TOOLING: rebase CWS odff05 to trunk@264325 (milestone: DEV300:m36) 2008-11-20 14:23:33 +0100 er r264053 : CWS-TOOLING: rebase CWS odff05 to trunk@263288 (milestone: DEV300:m35) 2008-11-19 18:07:43 +0100 er r264012 : merged from trunk 2008-11-19 17:51:36 +0100 er r264011 : migrate CWS odff05 to SVN
Diffstat (limited to 'oox/source/xls/formulabase.cxx')
-rw-r--r--oox/source/xls/formulabase.cxx31
1 files changed, 21 insertions, 10 deletions
diff --git a/oox/source/xls/formulabase.cxx b/oox/source/xls/formulabase.cxx
index 87c1fc67adf7..6696c211e61d 100644
--- a/oox/source/xls/formulabase.cxx
+++ b/oox/source/xls/formulabase.cxx
@@ -227,14 +227,17 @@ namespace {
const size_t FUNCINFO_CLASSCOUNT = 5; /// Number of token class entries.
-const sal_uInt8 FUNCFLAG_VOLATILE = 0x01; /// Result is volatile (e.g. NOW() function).
-const sal_uInt8 FUNCFLAG_IMPORTONLY = 0x02; /// Only used in import filter.
-const sal_uInt8 FUNCFLAG_EXPORTONLY = 0x04; /// Only used in export filter.
-const sal_uInt8 FUNCFLAG_MACROCALL = 0x08; /// Function is simulated by macro call in Excel.
-const sal_uInt8 FUNCFLAG_EXTERNAL = 0x10; /// Function is external in Calc.
-const sal_uInt8 FUNCFLAG_MACROFUNC = 0x20; /// Function is a macro sheet function.
-const sal_uInt8 FUNCFLAG_MACROCMD = 0x40; /// Function is a macro sheet command.
-const sal_uInt8 FUNCFLAG_ALWAYSVAR = 0x80; /// Function is always represented by a tFuncVar token.
+const sal_uInt16 FUNCFLAG_VOLATILE = 0x0001; /// Result is volatile (e.g. NOW() function).
+const sal_uInt16 FUNCFLAG_IMPORTONLY = 0x0002; /// Only used in import filter.
+const sal_uInt16 FUNCFLAG_EXPORTONLY = 0x0004; /// Only used in export filter.
+const sal_uInt16 FUNCFLAG_MACROCALL = 0x0008; /// Function is simulated by macro call in Excel.
+const sal_uInt16 FUNCFLAG_EXTERNAL = 0x0010; /// Function is external in Calc.
+const sal_uInt16 FUNCFLAG_MACROFUNC = 0x0020; /// Function is a macro-sheet function.
+const sal_uInt16 FUNCFLAG_MACROCMD = 0x0040; /// Function is a macro-sheet command.
+const sal_uInt16 FUNCFLAG_ALWAYSVAR = 0x0080; /// Function is always represented by a tFuncVar token.
+
+const sal_uInt16 FUNCFLAG_FUNCLIBMASK = 0xF000; /// Mask for function library bits.
+const sal_uInt16 FUNCFLAG_EUROTOOL = 0x1000; /// Function is part of the EuroTool add-in.
typedef ::boost::shared_ptr< FunctionInfo > FunctionInfoRef;
@@ -248,7 +251,7 @@ struct FunctionData
sal_uInt8 mnMaxParamCount; /// Maximum number of parameters.
sal_uInt8 mnRetClass; /// BIFF token class of the return value.
sal_uInt8 mpnParamClass[ FUNCINFO_CLASSCOUNT ]; /// Expected BIFF token classes of parameters.
- sal_uInt8 mnFlags; /// Additional flags.
+ sal_uInt16 mnFlags; /// Additional flags.
inline bool isSupported( bool bImportFilter ) const;
};
@@ -632,7 +635,6 @@ static const FunctionData saFuncTableBiff4[] =
{ "MULTINOMIAL", "MULTINOMIAL", 474, NOID, 1, MX, V, { R }, FUNCFLAG_EXTERNAL },
{ "LCM", "LCM", 475, NOID, 1, MX, V, { R }, FUNCFLAG_EXTERNAL }, // Calc: builtin and add-in
{ "FVSCHEDULE", "FVSCHEDULE", 476, NOID, 2, 2, V, { V, A }, FUNCFLAG_EXTERNAL },
-// { "EUROCONVERT", "EUROCONVERT", NOID, NOID, 3, 5, V, { V }, FUNCFLAG_EXTERNAL }, // Euro conversion add-in
// *** macro sheet commands ***
@@ -664,6 +666,10 @@ static const FunctionData saFuncTableBiff5[] =
{ 0, "NUMBERSTRING", 353, 353, 2, 2, V, { V }, FUNCFLAG_IMPORTONLY }, // not supported in Calc, missing in OOX spec
{ "ROMAN", "ROMAN", 354, 354, 1, 2, V, { V }, 0 },
+ // *** EuroTool add-in ***
+
+ { "EUROCONVERT", "EUROCONVERT", NOID, NOID, 3, 5, V, { V }, FUNCFLAG_EUROTOOL },
+
// *** macro sheet commands ***
{ 0, "ADD.CHART.AUTOFORMAT", 390, 390, 0, 2, V, { V }, FUNCFLAG_MACROCMD },
@@ -868,6 +874,11 @@ void FunctionProvider::initFunc( const FunctionData& rFuncData, sal_uInt8 nMaxPa
xFuncInfo->maOoxFuncName = OUString::createFromAscii( rFuncData.mpcOoxFuncName );
if( getFlag( rFuncData.mnFlags, FUNCFLAG_MACROCALL ) )
xFuncInfo->maBiffMacroName = CREATE_OUSTRING( "_xlfn." ) + xFuncInfo->maOoxFuncName;
+ switch( rFuncData.mnFlags & FUNCFLAG_FUNCLIBMASK )
+ {
+ case FUNCFLAG_EUROTOOL: xFuncInfo->meFuncLibType = FUNCLIB_EUROTOOL; break;
+ default: xFuncInfo->meFuncLibType = FUNCLIB_UNKNOWN;
+ }
xFuncInfo->mnApiOpCode = -1;
xFuncInfo->mnOobFuncId = rFuncData.mnOobFuncId;
xFuncInfo->mnBiffFuncId = rFuncData.mnBiffFuncId;