summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-05-27 21:49:00 +0200
committerEike Rathke <erack@redhat.com>2016-05-27 21:58:48 +0200
commit3129b75fca1ec38fc79cbc5397b28923fc273ff9 (patch)
tree0631cc1560916e446d87bc08237e7b4f90b78611
parent483b4d6bfdb4800811e87a07f25b24e3f6019e38 (diff)
strip 0 argument only if not part of an expression, tdf#70806
Change-Id: Ia1f986a594194a1c564d815bbe2faa987eea971a
-rw-r--r--formula/source/core/api/token.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index e79b526b4554..beec15318cd7 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1386,7 +1386,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() )