From a6c659283ab02cb59feda39b67e1837ed8c32730 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Mon, 12 Feb 2018 22:52:05 +0100 Subject: Use FormulaCompiler::IsOpCodeJumpCommand() where applicable Change-Id: I295e842da0192c21d318357caa574062085acd9d --- formula/source/core/api/token.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'formula') 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; -- cgit v1.2.3