summaryrefslogtreecommitdiff
path: root/formula
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-02-12 22:52:05 +0100
committerEike Rathke <erack@redhat.com>2018-02-12 22:52:58 +0100
commita6c659283ab02cb59feda39b67e1837ed8c32730 (patch)
tree2cadd6c981fe252effcdcb6af552abe1f23d1fd7 /formula
parentd9fc18d5a797972ba182fbcae941535a50098dcb (diff)
Use FormulaCompiler::IsOpCodeJumpCommand() where applicable
Change-Id: I295e842da0192c21d318357caa574062085acd9d
Diffstat (limited to 'formula')
-rw-r--r--formula/source/core/api/token.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index cfd759562d59..05ca4cf5e1e9 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -86,7 +86,7 @@ bool FormulaToken::IsFunction() const
eOp != ocTableRef &&
(GetByte() != 0 // x parameters
|| (SC_OPCODE_START_NO_PAR <= eOp && eOp < SC_OPCODE_STOP_NO_PAR) // no parameter
- || (ocIf == eOp || ocIfError == eOp || ocIfNA == eOp || ocChoose == eOp ) // @ jump commands
+ || FormulaCompiler::IsOpCodeJumpCommand( eOp ) // @ jump commands
|| (SC_OPCODE_START_1_PAR <= eOp && eOp < SC_OPCODE_STOP_1_PAR) // one parameter
|| (SC_OPCODE_START_2_PAR <= eOp && eOp < SC_OPCODE_STOP_2_PAR) // x parameters (cByte==0 in
// FuncAutoPilot)
@@ -101,10 +101,10 @@ bool FormulaToken::IsFunction() const
sal_uInt8 FormulaToken::GetParamCount() const
{
if ( eOp < SC_OPCODE_STOP_DIV && eOp != ocExternal && eOp != ocMacro &&
- eOp != ocIf && eOp != ocIfError && eOp != ocIfNA && eOp != ocChoose &&
+ !FormulaCompiler::IsOpCodeJumpCommand( eOp ) &&
eOp != ocPercentSign )
return 0; // parameters and specials
- // ocIf, ocIfError, ocIfNA and ocChoose not for FAP, have cByte then
+ // ocIf... jump commands not for FAP, have cByte then
//2do: bool parameter whether FAP or not?
else if ( GetByte() )
return GetByte(); // all functions, also ocExternal and ocMacro
@@ -117,7 +117,7 @@ sal_uInt8 FormulaToken::GetParamCount() const
return 0; // no parameter
else if (SC_OPCODE_START_1_PAR <= eOp && eOp < SC_OPCODE_STOP_1_PAR)
return 1; // one parameter
- else if ( eOp == ocIf || eOp == ocIfError || eOp == ocIfNA || eOp == ocChoose )
+ else if (FormulaCompiler::IsOpCodeJumpCommand( eOp ))
return 1; // only the condition counts as parameter
else
return 0; // all the rest, no Parameter, or
@@ -893,7 +893,7 @@ bool FormulaTokenArray::HasMatrixDoubleRefOps()
}
if ( eOp == ocPush || lcl_IsReference( eOp, t->GetType() ) )
pStack[sp++] = t;
- else if ( eOp == ocIf || eOp == ocIfError || eOp == ocIfNA || eOp == ocChoose )
+ else if (FormulaCompiler::IsOpCodeJumpCommand( eOp ))
{ // ignore Jumps, pop previous Result (Condition)
if ( sp )
--sp;