sc: replace define with helper
Change-Id: I79915d5449e64c9eb46ff91ce3279ce27af12fec Reviewed-on: https://gerrit.libreoffice.org/23257 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
committed by
Noel Grandin
parent
53f645a9c9
commit
f53fc22f04
@@ -3565,8 +3565,37 @@ double applyImplicitIntersection(const sc::RangeMatrix& rMat, const ScAddress& r
|
|||||||
return fVal;
|
return fVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Test for Functions that evaluate an error code and directly set nGlobalError to 0
|
||||||
|
bool IsErrFunc(OpCode oc)
|
||||||
|
{
|
||||||
|
switch (oc)
|
||||||
|
{
|
||||||
|
case ocCount :
|
||||||
|
case ocCount2 :
|
||||||
|
case ocErrorType :
|
||||||
|
case ocIsEmpty :
|
||||||
|
case ocIsErr :
|
||||||
|
case ocIsError :
|
||||||
|
case ocIsFormula :
|
||||||
|
case ocIsLogical :
|
||||||
|
case ocIsNA :
|
||||||
|
case ocIsNonString :
|
||||||
|
case ocIsRef :
|
||||||
|
case ocIsString :
|
||||||
|
case ocIsValue :
|
||||||
|
case ocN :
|
||||||
|
case ocType :
|
||||||
|
case ocIfError :
|
||||||
|
case ocIfNA :
|
||||||
|
case ocErrorType_ODF :
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} //namespace
|
||||||
|
|
||||||
StackVar ScInterpreter::Interpret()
|
StackVar ScInterpreter::Interpret()
|
||||||
{
|
{
|
||||||
short nRetTypeExpr = css::util::NumberFormat::UNDEFINED;
|
short nRetTypeExpr = css::util::NumberFormat::UNDEFINED;
|
||||||
@@ -4132,48 +4161,17 @@ StackVar ScInterpreter::Interpret()
|
|||||||
pJumpMatrix = nullptr;
|
pJumpMatrix = nullptr;
|
||||||
} while ( bGotResult );
|
} while ( bGotResult );
|
||||||
|
|
||||||
// Functions that evaluate an error code and directly set nGlobalError to 0,
|
if( IsErrFunc(eOp) )
|
||||||
// usage: switch( OpCode ) { CASE_OCERRFUNC statements; }
|
++nErrorFunction;
|
||||||
#define CASE_OCERRFUNC \
|
|
||||||
case ocCount : \
|
|
||||||
case ocCount2 : \
|
|
||||||
case ocErrorType : \
|
|
||||||
case ocIsEmpty : \
|
|
||||||
case ocIsErr : \
|
|
||||||
case ocIsError : \
|
|
||||||
case ocIsFormula : \
|
|
||||||
case ocIsLogical : \
|
|
||||||
case ocIsNA : \
|
|
||||||
case ocIsNonString : \
|
|
||||||
case ocIsRef : \
|
|
||||||
case ocIsString : \
|
|
||||||
case ocIsValue : \
|
|
||||||
case ocN : \
|
|
||||||
case ocType : \
|
|
||||||
case ocIfError : \
|
|
||||||
case ocIfNA : \
|
|
||||||
case ocErrorType_ODF :
|
|
||||||
|
|
||||||
switch ( eOp )
|
|
||||||
{
|
|
||||||
CASE_OCERRFUNC
|
|
||||||
++ nErrorFunction;
|
|
||||||
default:
|
|
||||||
; // nothing
|
|
||||||
}
|
|
||||||
if ( nGlobalError )
|
if ( nGlobalError )
|
||||||
{
|
{
|
||||||
if ( !nErrorFunctionCount )
|
if ( !nErrorFunctionCount )
|
||||||
{ // count of errorcode functions in formula
|
{ // count of errorcode functions in formula
|
||||||
for ( FormulaToken* t = rArr.FirstRPN(); t; t = rArr.NextRPN() )
|
for ( FormulaToken* t = rArr.FirstRPN(); t; t = rArr.NextRPN() )
|
||||||
{
|
{
|
||||||
switch ( t->GetOpCode() )
|
if ( IsErrFunc(t->GetOpCode()) )
|
||||||
{
|
|
||||||
CASE_OCERRFUNC
|
|
||||||
++nErrorFunctionCount;
|
++nErrorFunctionCount;
|
||||||
default:
|
|
||||||
; // nothing
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( nErrorFunction >= nErrorFunctionCount )
|
if ( nErrorFunction >= nErrorFunctionCount )
|
||||||
|
Reference in New Issue
Block a user