diff options
-rw-r--r-- | formula/source/core/api/FormulaCompiler.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index da5f7428e196..e6a224fa93a7 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -305,7 +305,7 @@ bool isRangeResultOpCode( OpCode eOp ) @param bRight If bRPN==false, bRight==false means opcodes for left side are checked, bRight==true means opcodes for right side. If bRPN==true - it doesn't matter. + it doesn't matter except for the ocSep converted to ocUnion case. */ bool isPotentialRangeType( FormulaToken const * pToken, bool bRPN, bool bRight ) { @@ -326,6 +326,10 @@ bool isPotentialRangeType( FormulaToken const * pToken, bool bRPN, bool bRight ) case svExternalDoubleRef: case svExternalName: // could be range return true; + case svSep: + // A special case if a previous ocSep was converted to ocUnion it + // stays svSep instead of svByte. + return bRPN && !bRight && pToken->GetOpCode() == ocUnion; default: // Separators are not part of RPN and right opcodes need to be // other StackVar types or functions and thus svByte. @@ -1407,6 +1411,7 @@ void FormulaCompiler::Factor() if (p && isPotentialRangeType( p, true, true)) { pFacToken->NewOpCode( ocUnion, FormulaToken::PrivateAccess()); + // XXX NOTE: the token's eType is still svSep here! PutCode( pFacToken); } } |