diff options
author | Winfried Donkers <winfrieddonkers@libreoffice.org> | 2014-11-11 17:33:48 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-04-29 23:39:09 +0000 |
commit | 010b2d2d9be846fb6b10848204e29e1bc00ef1ea (patch) | |
tree | 7ac115c5bd37be8b9e4cf295a84385d63f212d8e /sc/source/core/tool/compiler.cxx | |
parent | 3a6866c2953c17a55536fa434b9fceda670d0685 (diff) |
fdo#69552 [part 1] make calc functions CEILING comply with ODF1.2
Also, add support for CEILING.MATH and fix small
deficiencies with CEILING functions, as most are interwoven.
Change-Id: I0d9a46fb17e982ccf1e9d9e403b58926172c1a7a
Reviewed-on: https://gerrit.libreoffice.org/7088
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/core/tool/compiler.cxx')
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 05e9f9c15705..f2a54d46cfa1 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -2507,12 +2507,21 @@ bool ScCompiler::IsOpCode( const OUString& rName, bool bInArray ) if (bFound) { OpCode eOp = iLook->second; - if (bInArray) + if ( eOp != ocOpen && eOp != ocClose ) { - if (rName.equals(mxSymbols->getSymbol(ocArrayColSep))) - eOp = ocArrayColSep; - else if (rName.equals(mxSymbols->getSymbol(ocArrayRowSep))) - eOp = ocArrayRowSep; + if (bInArray) + { + if (rName.equals(mxSymbols->getSymbol(ocArrayColSep))) + eOp = ocArrayColSep; + else if (rName.equals(mxSymbols->getSymbol(ocArrayRowSep))) + eOp = ocArrayRowSep; + } + else if (mxSymbols->isOOXML()) + { + // OOXML names that need to treated differently on import. + if ( rName.equalsIgnoreAsciiCaseAscii( "_XLFN.CEILING.MATH" ) ) + eOp = ocCeil_Math; + } } maRawToken.SetOpCode(eOp); } @@ -4082,12 +4091,10 @@ ScTokenArray* ScCompiler::CompileString( const OUString& rFormula ) } if (bOOXML) { - // Append a parameter for CEILING, FLOOR and WEEKNUM, all 1.0 + // Append a parameter for FLOOR and WEEKNUM, all 1.0 // Function is already closed, parameter count is nSep+1 size_t nFunc = nFunction + 1; if (eOp == ocClose && ( - (pFunctionStack[ nFunc ].eOp == ocCeil && // 3rd Excel mode - pFunctionStack[ nFunc ].nSep == 1) || (pFunctionStack[ nFunc ].eOp == ocFloor && // 3rd Excel mode pFunctionStack[ nFunc ].nSep == 1) || (pFunctionStack[ nFunc ].eOp == ocWeek && // 2nd week start |