diff options
author | Eike Rathke <erack@redhat.com> | 2016-05-27 21:49:00 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-05-27 20:25:56 +0000 |
commit | 88630f20d1f26d74980e81721cd621b6f309a9ec (patch) | |
tree | d85743dedbb06cd18319e3f88e2b30433d5a487f | |
parent | acb0f28e97874b22bd899e5cf04f2a8363a42e7a (diff) |
strip 0 argument only if not part of an expression, tdf#70806
Change-Id: Ia1f986a594194a1c564d815bbe2faa987eea971a
(cherry picked from commit 3129b75fca1ec38fc79cbc5397b28923fc273ff9)
Reviewed-on: https://gerrit.libreoffice.org/25568
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | formula/source/core/api/token.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx index b1a1f00ed4a8..14a671b7c553 100644 --- a/formula/source/core/api/token.cxx +++ b/formula/source/core/api/token.cxx @@ -1437,7 +1437,16 @@ FormulaTokenArray * FormulaTokenArray::RewriteMissing( const MissingConvention & { // Omit only a literal 0 value, nothing else. if (pOcds[ i ] == nFn && pCur->GetOpCode() == ocPush && pCur->GetDouble() == 0.0) - bAdd = false; + { + // No other expression, between separators. + FormulaToken* p = PeekPrevNoSpaces(); + if (p && p->GetOpCode() == ocSep) + { + p = PeekNextNoSpaces(); + if (p && p->GetOpCode() == ocSep) + bAdd = false; + } + } } } switch ( pCur->GetOpCode() ) |