Make a separate method to detemine if an opcode is a jump command.
Jump to make it a bit more pleasant to follow the code... Change-Id: Ie9bef122e8bb63a2d8cc54acc9c8ddc9ac9a2e8a
This commit is contained in:
@@ -805,6 +805,21 @@ bool FormulaCompiler::IsOpCodeVolatile( OpCode eOp )
|
|||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FormulaCompiler::IsOpCodeJumpCommand( OpCode eOp )
|
||||||
|
{
|
||||||
|
switch (eOp)
|
||||||
|
{
|
||||||
|
case ocIf:
|
||||||
|
case ocIfError:
|
||||||
|
case ocIfNA:
|
||||||
|
case ocChose:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Remove quotes, escaped quotes are unescaped.
|
// Remove quotes, escaped quotes are unescaped.
|
||||||
bool FormulaCompiler::DeQuote( OUString& rStr )
|
bool FormulaCompiler::DeQuote( OUString& rStr )
|
||||||
{
|
{
|
||||||
@@ -1241,9 +1256,7 @@ void FormulaCompiler::Factor()
|
|||||||
|| eOp == ocOr
|
|| eOp == ocOr
|
||||||
|| eOp == ocBad
|
|| eOp == ocBad
|
||||||
|| ( eOp >= ocInternalBegin && eOp <= ocInternalEnd )
|
|| ( eOp >= ocInternalBegin && eOp <= ocInternalEnd )
|
||||||
|| ( bCompileForFAP
|
|| (bCompileForFAP && IsOpCodeJumpCommand(eOp)))
|
||||||
&& ( eOp == ocIf || eOp == ocIfError || eOp == ocIfNA || eOp == ocChose ) )
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
pFacToken = mpToken;
|
pFacToken = mpToken;
|
||||||
OpCode eMyLastOp = eOp;
|
OpCode eMyLastOp = eOp;
|
||||||
@@ -1291,7 +1304,7 @@ void FormulaCompiler::Factor()
|
|||||||
pFacToken->SetByte( nSepCount );
|
pFacToken->SetByte( nSepCount );
|
||||||
PutCode( pFacToken );
|
PutCode( pFacToken );
|
||||||
}
|
}
|
||||||
else if (eOp == ocIf || eOp == ocIfError || eOp == ocIfNA || eOp == ocChose)
|
else if (IsOpCodeJumpCommand(eOp))
|
||||||
{
|
{
|
||||||
// the PC counters are -1
|
// the PC counters are -1
|
||||||
pFacToken = mpToken;
|
pFacToken = mpToken;
|
||||||
|
@@ -231,6 +231,7 @@ public:
|
|||||||
{ bCompileForFAP = bVal; bIgnoreErrors = bVal; }
|
{ bCompileForFAP = bVal; bIgnoreErrors = bVal; }
|
||||||
|
|
||||||
static bool IsOpCodeVolatile( OpCode eOp );
|
static bool IsOpCodeVolatile( OpCode eOp );
|
||||||
|
static bool IsOpCodeJumpCommand( OpCode eOp );
|
||||||
|
|
||||||
static bool DeQuote( OUString& rStr );
|
static bool DeQuote( OUString& rStr );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user