diff options
author | Eike Rathke <erack@redhat.com> | 2013-12-02 18:53:32 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-12-02 19:00:12 +0100 |
commit | 027e96f462f6a3003766d3fde91b653af4bbb998 (patch) | |
tree | ecd74ec50c8055b09659144e601cd3cdcd740c46 | |
parent | 371591344d5b3a8181de440b49bad0cf2f63fe2c (diff) |
store internal CONVERT to .xlsx/.xls and distinguish from CONVERT_ADD
Change-Id: Ie9b5f6ade1c25618aa990ce17bd7b2a2b46a250a
(cherry picked from commit 8302495a219e869f194f4b585c6f2b996eee0a5c)
-rw-r--r-- | formula/source/core/resource/core_resource.src | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xlformula.cxx | 14 | ||||
-rw-r--r-- | sc/source/filter/oox/formulabase.cxx | 6 |
3 files changed, 19 insertions, 3 deletions
diff --git a/formula/source/core/resource/core_resource.src b/formula/source/core/resource/core_resource.src index 44b5fd1b2fae..ebf69ea1b3f2 100644 --- a/formula/source/core/resource/core_resource.src +++ b/formula/source/core/resource/core_resource.src @@ -733,7 +733,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML String SC_OPCODE_DDE { Text = "DDE" ; }; String SC_OPCODE_BASE { Text = "_xlfn.BASE" ; }; String SC_OPCODE_DECIMAL { Text = "_xlfn.DECIMAL" ; }; - String SC_OPCODE_CONVERT { Text = "CONVERT" ; }; + String SC_OPCODE_CONVERT { Text = "_xlfn.ORG.OPENOFFICE.CONVERT" ; }; String SC_OPCODE_ROMAN { Text = "ROMAN" ; }; String SC_OPCODE_ARABIC { Text = "_xlfn.ARABIC" ; }; String SC_OPCODE_HYPERLINK { Text = "HYPERLINK" ; }; diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx index 67d21ee0f313..a803af1264ac 100644 --- a/sc/source/filter/excel/xlformula.cxx +++ b/sc/source/filter/excel/xlformula.cxx @@ -546,6 +546,19 @@ static const XclFunctionInfo saFuncTable_Odf[] = #undef EXC_FUNCENTRY_ODF + +#define EXC_FUNCENTRY_OOO( opcode, minparam, maxparam, flags, asciiname ) \ + { opcode, NOID, minparam, maxparam, V, { VR }, EXC_FUNCFLAG_IMPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }, \ + { opcode, 255, (minparam)+1, (maxparam)+1, V, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY|(flags), EXC_FUNCNAME( asciiname ) } + +/** Functions defined by Calc, but not in OpenFormula nor supported by Excel. */ +static const XclFunctionInfo saFuncTable_OOoLO[] = +{ + EXC_FUNCENTRY_OOO( ocConvert, 3, 3, 0, "ORG.OPENOFFICE.CONVERT" ) +}; + +#undef EXC_FUNCENTRY_OOO + // ---------------------------------------------------------------------------- XclFunctionProvider::XclFunctionProvider( const XclRoot& rRoot ) @@ -571,6 +584,7 @@ XclFunctionProvider::XclFunctionProvider( const XclRoot& rRoot ) (this->*pFillFunc)( saFuncTable_2010, STATIC_ARRAY_END( saFuncTable_2010 ) ); (this->*pFillFunc)( saFuncTable_2013, STATIC_ARRAY_END( saFuncTable_2013 ) ); (this->*pFillFunc)( saFuncTable_Odf, STATIC_ARRAY_END( saFuncTable_Odf ) ); + (this->*pFillFunc)( saFuncTable_OOoLO, STATIC_ARRAY_END( saFuncTable_OOoLO ) ); } const XclFunctionInfo* XclFunctionProvider::GetFuncInfoFromXclFunc( sal_uInt16 nXclFunc ) const diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx index 26a623e4adf8..de95837c7d6d 100644 --- a/sc/source/filter/oox/formulabase.cxx +++ b/sc/source/filter/oox/formulabase.cxx @@ -198,7 +198,7 @@ const sal_uInt16 FUNCFLAG_VOLATILE = 0x0001; /// Result is volatile ( 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 stored as macro call in Excel (_xlfn. prefix). OOXML name MUST exist. -const sal_uInt16 FUNCFLAG_MACROCALLODF = 0x0010; /// ODF-only function stored as macro call in Excel (_xlfnodf. prefix). ODF name MUST exist. +const sal_uInt16 FUNCFLAG_MACROCALLODF = 0x0010; /// ODF-only function stored as macro call in BIFF Excel (_xlfnodf. prefix). ODF name MUST exist. const sal_uInt16 FUNCFLAG_EXTERNAL = 0x0020; /// Function is external in Calc. const sal_uInt16 FUNCFLAG_MACROFUNC = 0x0040; /// Function is a macro-sheet function. const sal_uInt16 FUNCFLAG_MACROCMD = 0x0080; /// Function is a macro-sheet command. @@ -885,7 +885,9 @@ static const FunctionData saFuncTableOOoLO[] = { "ORG.OPENOFFICE.DAYSINMONTH", "COM.SUN.STAR.SHEET.ADDIN.DATEFUNCTIONS.GETDAYSINMONTH", NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_IMPORTONLY | FUNCFLAG_EXTERNAL }, { "ORG.OPENOFFICE.DAYSINYEAR", "COM.SUN.STAR.SHEET.ADDIN.DATEFUNCTIONS.GETDAYSINYEAR", NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_IMPORTONLY | FUNCFLAG_EXTERNAL }, { "ORG.OPENOFFICE.WEEKSINYEAR", "COM.SUN.STAR.SHEET.ADDIN.DATEFUNCTIONS.GETWEEKSINYEAR", NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_IMPORTONLY | FUNCFLAG_EXTERNAL }, - { "ORG.OPENOFFICE.ROT13", "COM.SUN.STAR.SHEET.ADDIN.DATEFUNCTIONS.GETROT13", NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_IMPORTONLY | FUNCFLAG_EXTERNAL } + { "ORG.OPENOFFICE.ROT13", "COM.SUN.STAR.SHEET.ADDIN.DATEFUNCTIONS.GETROT13", NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_IMPORTONLY | FUNCFLAG_EXTERNAL }, + // Other functions. + { "ORG.OPENOFFICE.CONVERT", "ORG.OPENOFFICE.CONVERT", NOID, NOID, 3, 3, V, { VR }, FUNCFLAG_MACROCALL_NEW } }; // ---------------------------------------------------------------------------- |