summaryrefslogtreecommitdiff
path: root/formula
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2021-07-28 02:00:53 +0200
committerEike Rathke <erack@redhat.com>2021-07-28 11:42:30 +0200
commit6eb9fde88af245a00247fca8a592ed08ee4b8bbe (patch)
treee3eb65c40216666df5dfaff8907227c6d9aa9578 /formula
parent5a9d7625d215d9f9417a2207327a741618d3de82 (diff)
ODFF: eliminate spaces between function name and initial opening parenthesis
Same as for OOXML, they are disallowed in ODFF as well. Change-Id: Iff78a901838092a3ee32221fdaadd28ee50f7646 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119577 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'formula')
-rw-r--r--formula/source/core/api/FormulaCompiler.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index 3907c1ac8314..be5ce09d132f 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -2290,11 +2290,18 @@ const FormulaToken* FormulaCompiler::CreateStringFromToken( OUStringBuffer& rBuf
bWriteSpaces = false;
}
}
- else if (mxSymbols->isOOXML())
+ if (bWriteSpaces)
{
+ // ODF v1.3 OpenFormula 5.14 Whitespace states "whitespace shall
+ // not separate a function name from its initial opening
+ // parenthesis".
+ //
// ECMA-376-1:2016 18.17.2 Syntax states "that no space characters
// shall separate a function-name from the left parenthesis (()
// that follows it." and Excel even chokes on it.
+ //
+ // Suppress/remove it in any case also in UI, it will not be
+ // preserved.
const FormulaToken* p = maArrIterator.PeekPrevNoSpaces();
if (p && p->IsFunction())
{