summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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() )