Remove "useMils" variable from numeric evaluator

This commit is contained in:
Mikolaj Wielgus 2020-10-03 00:46:12 +02:00 committed by Ian McInerney
parent d14761bee6
commit d9fd6e549b
3 changed files with 8 additions and 15 deletions

View File

@ -43,7 +43,7 @@ namespace numEval
} /* namespace numEval */
NUMERIC_EVALUATOR::NUMERIC_EVALUATOR( EDA_UNITS aUnits, bool aUseMils )
NUMERIC_EVALUATOR::NUMERIC_EVALUATOR( EDA_UNITS aUnits )
{
struct lconv* lc = localeconv();
m_localeDecimalSeparator = *lc->decimal_point;
@ -55,17 +55,10 @@ NUMERIC_EVALUATOR::NUMERIC_EVALUATOR( EDA_UNITS aUnits, bool aUseMils )
switch( aUnits )
{
case EDA_UNITS::INCHES:
if( aUseMils )
m_defaultUnits = Unit::Mil;
else
m_defaultUnits = Unit::Inch;
break;
case EDA_UNITS::MILLIMETRES:
m_defaultUnits = Unit::MM;
break;
default:m_defaultUnits = Unit::MM;
break;
case EDA_UNITS::MILLIMETRES: m_defaultUnits = Unit::MM; break;
case EDA_UNITS::MILS: m_defaultUnits = Unit::Mil; break;
case EDA_UNITS::INCHES: m_defaultUnits = Unit::Inch; break;
default: m_defaultUnits = Unit::MM; break;
}
}

View File

@ -96,7 +96,7 @@ class NUMERIC_EVALUATOR
enum class Unit { Invalid, MM, CM, Inch, Mil };
public:
NUMERIC_EVALUATOR( EDA_UNITS aUnits, bool aUseMils = false );
NUMERIC_EVALUATOR( EDA_UNITS aUnits );
~NUMERIC_EVALUATOR();
/* clear() should be invoked by the client if a new input string is to be processed. It

View File

@ -32,7 +32,7 @@
struct NUM_EVAL_FIXTURE
{
NUM_EVAL_FIXTURE() : m_eval( EDA_UNITS::MILLIMETRES, false )
NUM_EVAL_FIXTURE() : m_eval( EDA_UNITS::MILLIMETRES )
{
}
@ -232,4 +232,4 @@ BOOST_AUTO_TEST_CASE( ResultsInvalid )
}
}
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_SUITE_END()