From 69a7e7440cdafbaeddd344f61cc5dfe54750d509 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 14 May 2014 11:17:13 -0400 Subject: Use "stop on error" concept rather than "ignore error if true". Just to keep the pattern of "true" -> "action", "false" -> "no action". Change-Id: I6303bc779cd7048eef2fdc3c2abba8be8f15da6d --- formula/source/core/api/FormulaCompiler.cxx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'formula') diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index 02c7a5eb9424..59839b4cc2b7 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -537,9 +537,9 @@ FormulaCompiler::FormulaCompiler( FormulaTokenArray& rArr ) meGrammar( formula::FormulaGrammar::GRAM_UNSPECIFIED ), bAutoCorrect( false ), bCorrected( false ), - bIgnoreErrors( false ), glSubTotal( false ), - mbJumpCommandReorder(true) + mbJumpCommandReorder(true), + mbStopOnError(true) { } @@ -555,9 +555,9 @@ FormulaCompiler::FormulaCompiler() meGrammar( formula::FormulaGrammar::GRAM_UNSPECIFIED ), bAutoCorrect( false ), bCorrected( false ), - bIgnoreErrors( false ), glSubTotal( false ), - mbJumpCommandReorder(true) + mbJumpCommandReorder(true), + mbStopOnError(true) { } @@ -983,7 +983,7 @@ sal_uInt16 FormulaCompiler::GetErrorConstant( const OUString& rName ) const void FormulaCompiler::SetCompileForFAP( bool bVal ) { mbJumpCommandReorder = !bVal; - bIgnoreErrors = bVal; + mbStopOnError = !bVal; } @@ -1041,7 +1041,7 @@ bool FormulaCompiler::GetToken() aCorrectedSymbol = ""; } bool bStop = false; - if( pArr->GetCodeError() && !bIgnoreErrors ) + if (pArr->GetCodeError() && mbStopOnError) bStop = true; else { @@ -1119,7 +1119,7 @@ bool FormulaCompiler::GetToken() // RPN creation by recursion void FormulaCompiler::Factor() { - if ( pArr->GetCodeError() && !bIgnoreErrors ) + if (pArr->GetCodeError() && mbStopOnError) return; CurrentFactor pFacToken( this ); @@ -1157,7 +1157,7 @@ void FormulaCompiler::Factor() { NextToken(); eOp = Expression(); - while ((eOp == ocSep) && (!pArr->GetCodeError() || bIgnoreErrors)) + while ((eOp == ocSep) && (!pArr->GetCodeError() || !mbStopOnError)) { // range list (A1;A2) converted to (A1~A2) pFacToken = mpToken; NextToken(); @@ -1292,7 +1292,7 @@ void FormulaCompiler::Factor() if( !bNoParam ) { nSepCount++; - while ( (eOp == ocSep) && (!pArr->GetCodeError() || bIgnoreErrors) ) + while ((eOp == ocSep) && (!pArr->GetCodeError() || !mbStopOnError)) { nSepCount++; NextToken(); @@ -1364,7 +1364,7 @@ void FormulaCompiler::Factor() } short nJumpCount = 0; while ( (nJumpCount < (FORMULA_MAXJUMPCOUNT - 1)) && (eOp == ocSep) - && (!pArr->GetCodeError() || bIgnoreErrors) ) + && (!pArr->GetCodeError() || !mbStopOnError)) { if ( ++nJumpCount <= nJumpMax ) pFacToken->GetJump()[nJumpCount] = pc-1; @@ -1641,7 +1641,7 @@ bool FormulaCompiler::CompileTokenArray() { glSubTotal = false; bCorrected = false; - if( !pArr->GetCodeError() || bIgnoreErrors ) + if (!pArr->GetCodeError() || !mbStopOnError) { if ( bAutoCorrect ) { @@ -1684,7 +1684,7 @@ bool FormulaCompiler::CompileTokenArray() if( !pArr->GetCodeError() && nErrorBeforePop ) pArr->SetCodeError( nErrorBeforePop); - if( pArr->GetCodeError() && !bIgnoreErrors ) + if (pArr->GetCodeError() && mbStopOnError) { pArr->DelRPN(); pArr->SetHyperLink( false); -- cgit