summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-04-06 21:15:27 +0200
committerBartosz Kosiorek <gang65@poczta.onet.pl>2017-04-07 07:49:53 +0000
commit8da7b298272d04b19150d303292270f85b99858b (patch)
tree6137b5c6674e1c182c953a38ccee6125316ff4a7
parentc759d327f46770e40e6fa0b7c5740adb4102e683 (diff)
Resolves: tdf#100011 (re-)add ocCeil and ocFloor .xls(x) export mappings
This is a combination of 2 commits. Resolves: tdf#100011 (re-)add ocCeil and ocFloor .xls(x) export mappings ... for CEILING and FLOOR that were lost when introducing CEILING.MATH and FLOOR.MATH which are semantically identical, but the export needs a distinct known mapping otherwise the function is stored as a macro call, which Excel dislikes. (cherry picked from commit ea01a08763e56a7de66f0c24655a627669c8a7f7) these FUNCFLAG_EXPORTONLY need also FUNCFLAG_MACROCALL_NEW, tdf#100011 related Maybe one day we'll actually use these tables also for export capabilities ... (cherry picked from commit 4dd95cadcd330aee49b3c84d3e336b808217af46) f3d55ec008e321d95b21e0d284c7d58d13a2399b Change-Id: Id371c1732984a8e5567f74fd265b9aee88fb1898 Reviewed-on: https://gerrit.libreoffice.org/36234 Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl> Tested-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
-rw-r--r--sc/source/filter/excel/xlformula.cxx5
-rw-r--r--sc/source/filter/oox/formulabase.cxx4
2 files changed, 7 insertions, 2 deletions
diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx
index 76ff512c7de7..f5be4a7b78d9 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -408,6 +408,9 @@ static const XclFunctionInfo saFuncTable_Oox[] =
#define EXC_FUNCENTRY_V_VR_IMPORT( opcode, minparam, maxparam, flags, asciiname ) \
{ opcode, NOID, minparam, maxparam, V, { VR }, EXC_FUNCFLAG_IMPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }
+#define EXC_FUNCENTRY_V_RO_EXPORT( opcode, minparam, maxparam, flags, asciiname ) \
+ { opcode, 255, (minparam)+1, (maxparam)+1, V, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }
+
#define EXC_FUNCENTRY_A_VR( opcode, minparam, maxparam, flags, asciiname ) \
{ opcode, NOID, minparam, maxparam, A, { VR }, EXC_FUNCFLAG_IMPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }, \
{ opcode, 255, (minparam)+1, (maxparam)+1, A, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }
@@ -524,6 +527,7 @@ static const XclFunctionInfo saFuncTable_2013[] =
EXC_FUNCENTRY_V_VR( ocBitRshift, 2, 2, 0, "BITRSHIFT" ),
EXC_FUNCENTRY_V_VR( ocBitXor, 2, 2, 0, "BITXOR" ),
EXC_FUNCENTRY_V_VR( ocCeil_Math, 1, 3, 0, "CEILING.MATH" ),
+ EXC_FUNCENTRY_V_RO_EXPORT( ocCeil, 1, 3, 0, "CEILING.MATH" ),
EXC_FUNCENTRY_V_VR( ocCombinA, 2, 2, 0, "COMBINA" ),
EXC_FUNCENTRY_V_VR_IMPORT( ocCot, 1, 1, 0, "COT" ),
EXC_FUNCENTRY_V_VR_IMPORT( ocCotHyp, 1, 1, 0, "COTH" ),
@@ -538,6 +542,7 @@ static const XclFunctionInfo saFuncTable_2013[] =
EXC_FUNCENTRY_V_VR( ocNoName, 3, 3, 0, "FINV" ),
EXC_FUNCENTRY_V_VR( ocFilterXML, 2, 2, 0, "FILTERXML" ),
EXC_FUNCENTRY_V_VR( ocFloor_Math, 1, 3, 0, "FLOOR.MATH" ),
+ EXC_FUNCENTRY_V_RO_EXPORT( ocFloor, 1, 3, 0, "FLOOR.MATH" ),
EXC_FUNCENTRY_V_RO( ocFormula, 1, 1, 0, "FORMULATEXT" ),
EXC_FUNCENTRY_V_VR( ocGamma, 1, 1, 0, "GAMMA" ),
EXC_FUNCENTRY_V_VR( ocGauss, 1, 1, 0, "GAUSS" ),
diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx
index 3ac2dfcdbf83..c51264f5e2c8 100644
--- a/sc/source/filter/oox/formulabase.cxx
+++ b/sc/source/filter/oox/formulabase.cxx
@@ -848,7 +848,7 @@ static const FunctionData saFuncTable2013[] =
{ "BITRSHIFT", "BITRSHIFT", NOID, NOID, 2, 2, V, { VR }, FUNCFLAG_MACROCALL_NEW },
{ "BITXOR", "BITXOR", NOID, NOID, 2, 2, V, { VR }, FUNCFLAG_MACROCALL_NEW },
{ "COM.MICROSOFT.CEILING.MATH", "CEILING.MATH", NOID, NOID, 1, 3, V, { VR }, FUNCFLAG_MACROCALL_NEW },
- { "CEILING", "CEILING.MATH", NOID, NOID, 1, 3, V, { VR }, FUNCFLAG_EXPORTONLY },
+ { "CEILING", "CEILING.MATH", NOID, NOID, 1, 3, V, { VR }, FUNCFLAG_EXPORTONLY | FUNCFLAG_MACROCALL_NEW },
{ "COMBINA", "COMBINA", NOID, NOID, 2, 2, V, { VR }, FUNCFLAG_MACROCALL_NEW },
{ "COT", "COT", NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALL_NEW },
{ "COTH", "COTH", NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALL_NEW },
@@ -859,7 +859,7 @@ static const FunctionData saFuncTable2013[] =
{ "COM.MICROSOFT.ENCODEURL","ENCODEURL", NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALL_NEW },
{ "COM.MICROSOFT.FILTERXML","FILTERXML", NOID, NOID, 2, 2, V, { VR }, FUNCFLAG_MACROCALL_NEW },
{ "COM.MICROSOFT.FLOOR.MATH", "FLOOR.MATH", NOID, NOID, 1, 3, V, { VR }, FUNCFLAG_MACROCALL_NEW },
- { "FLOOR", "FLOOR.MATH", NOID, NOID, 1, 3, V, { VR }, FUNCFLAG_EXPORTONLY },
+ { "FLOOR", "FLOOR.MATH", NOID, NOID, 1, 3, V, { VR }, FUNCFLAG_EXPORTONLY | FUNCFLAG_MACROCALL_NEW },
// NOTE: this FDIST is not our LEGACY.FDIST
{ nullptr/*"FDIST"*/, "FDIST", NOID, NOID, 3, 4, V, { VR }, FUNCFLAG_MACROCALL_NEW },
// NOTE: this FINV is not our LEGACY.FINV