remove unused formula ErrorCode enumerators

Change-Id: I0d81b43ba4e0a8734074651228743acaeae7aa97
This commit is contained in:
Noel Grandin
2017-02-17 09:06:53 +02:00
parent be021ba04d
commit 1400cec164
6 changed files with 5 additions and 25 deletions

View File

@@ -34,8 +34,6 @@ enum class FormulaError : sal_uInt16
IllegalArgument = 502,
IllegalFPOperation = 503, // #NUM!
IllegalParameter = 504,
IllegalJump = 505,
Separator = 506,
Pair = 507,
PairExpected = 508,
OperatorExpected = 509,
@@ -55,10 +53,6 @@ enum class FormulaError : sal_uInt16
NoConvergence = 523,
NoRef = 524, // #REF!
NoName = 525, // #NAME?
DoubleRef = 526,
// Not displayed, temporary for TrackFormulas,
// Cell depends on another cell that has FormulaError::CircularReference
TrackFromCircRef = 528,
// ScInterpreter internal: no numeric value but numeric queried. If this is
// set as mnStringNoValueError no error is generated but 0 returned.
CellNoValue = 529,
@@ -137,8 +131,6 @@ inline bool isPublishedFormulaError( FormulaError nErr )
case FormulaError::IllegalArgument:
case FormulaError::IllegalFPOperation:
case FormulaError::IllegalParameter:
case FormulaError::IllegalJump:
case FormulaError::Separator:
case FormulaError::Pair:
case FormulaError::PairExpected:
case FormulaError::OperatorExpected:
@@ -158,10 +150,8 @@ inline bool isPublishedFormulaError( FormulaError nErr )
case FormulaError::NoConvergence:
case FormulaError::NoRef:
case FormulaError::NoName:
case FormulaError::DoubleRef:
return true;
case FormulaError::TrackFromCircRef:
case FormulaError::CellNoValue:
return false;

View File

@@ -195,7 +195,7 @@
#define STR_LONG_ERR_ILL_PAR 134
#define STR_LONG_ERR_ILL_FPO 135
#define STR_LONG_ERR_ILL_CHAR 136
#define STR_LONG_ERR_ILL_SEP 137
// empty
#define STR_LONG_ERR_PAIR 138
#define STR_LONG_ERR_OP_EXP 139
#define STR_LONG_ERR_VAR_EXP 140

View File

@@ -2608,7 +2608,7 @@ bool ScFormulaCell::IsValueNoError() const
double ScFormulaCell::GetValue()
{
MaybeInterpret();
if ((pCode->GetCodeError() == FormulaError::NONE || pCode->GetCodeError() == FormulaError::DoubleRef) &&
if ((pCode->GetCodeError() == FormulaError::NONE) &&
aResult.GetResultError() == FormulaError::NONE)
return aResult.GetDouble();
return 0.0;
@@ -2617,7 +2617,7 @@ double ScFormulaCell::GetValue()
svl::SharedString ScFormulaCell::GetString()
{
MaybeInterpret();
if ((pCode->GetCodeError() == FormulaError::NONE || pCode->GetCodeError() == FormulaError::DoubleRef) &&
if ((pCode->GetCodeError() == FormulaError::NONE) &&
aResult.GetResultError() == FormulaError::NONE)
return aResult.GetString();

View File

@@ -361,7 +361,6 @@ OUString ScGlobal::GetErrorString(FormulaError nErr)
case FormulaError::NoName : nErrNumber = STR_NO_NAME_REF; break;
case FormulaError::NoAddin : nErrNumber = STR_NO_ADDIN; break;
case FormulaError::NoMacro : nErrNumber = STR_NO_MACRO; break;
case FormulaError::DoubleRef :
case FormulaError::NoValue : nErrNumber = STR_NO_VALUE; break;
case FormulaError::NoCode : nErrNumber = STR_NULL_ERROR; break;
case FormulaError::DivisionByZero : nErrNumber = STR_DIV_ZERO; break;
@@ -392,9 +391,6 @@ OUString ScGlobal::GetLongErrorString(FormulaError nErr)
case FormulaError::IllegalParameter:
nErrNumber = STR_LONG_ERR_ILL_PAR;
break;
case FormulaError::Separator:
nErrNumber = STR_LONG_ERR_ILL_SEP;
break;
case FormulaError::Pair:
case FormulaError::PairExpected:
nErrNumber = STR_LONG_ERR_PAIR;
@@ -418,14 +414,12 @@ OUString ScGlobal::GetLongErrorString(FormulaError nErr)
case FormulaError::MatrixSize:
nErrNumber = STR_LONG_ERR_MATRIX_SIZE;
break;
case FormulaError::IllegalJump:
case FormulaError::UnknownState:
case FormulaError::UnknownVariable:
case FormulaError::UnknownOpCode:
case FormulaError::UnknownStackVariable:
case FormulaError::UnknownToken:
case FormulaError::NoCode:
case FormulaError::DoubleRef:
nErrNumber = STR_LONG_ERR_SYNTAX;
break;
case FormulaError::CircularReference:

View File

@@ -113,7 +113,7 @@ double ScSimpleFormulaCalculator::GetValue()
{
Calculate();
if ((mpCode->GetCodeError() == FormulaError::NONE || mpCode->GetCodeError() == FormulaError::DoubleRef) &&
if ((mpCode->GetCodeError() == FormulaError::NONE) &&
maResult.GetResultError() == FormulaError::NONE)
return maResult.GetDouble();
@@ -127,7 +127,7 @@ svl::SharedString ScSimpleFormulaCalculator::GetString()
if (mbMatrixResult)
return svl::SharedString( maMatrixFormulaResult); // string not interned
if ((mpCode->GetCodeError() == FormulaError::NONE || mpCode->GetCodeError() == FormulaError::DoubleRef) &&
if ((mpCode->GetCodeError() == FormulaError::NONE) &&
maResult.GetResultError() == FormulaError::NONE)
return maResult.GetString();

View File

@@ -836,10 +836,6 @@ String STR_LONG_ERR_ILL_CHAR+RID_GLOBSTR_OFFSET
{
Text [ en-US ] = "Error: Invalid character" ;
};
String STR_LONG_ERR_ILL_SEP+RID_GLOBSTR_OFFSET
{
Text [ en-US ] = "Error: Invalid semicolon" ;
};
String STR_LONG_ERR_PAIR+RID_GLOBSTR_OFFSET
{
Text [ en-US ] = "Error: in bracketing" ;