Reapply accidentally reverted changes in 3b1dfba

This commit is contained in:
Birunthan Mohanathas 2013-12-08 13:44:03 +02:00
parent 1eb46ae448
commit ec9c2ef598

View File

@ -103,12 +103,11 @@ void MeasureCalc::ReadOptions(ConfigParser& parser, const WCHAR* section)
oldUpdateRandom != m_UpdateRandom ||
oldUniqueRandom != m_UniqueRandom)
{
// Reset bounds if |m_LowBound| is greater than |m_HighBound|
if (m_LowBound > m_HighBound)
// Reset bounds if |m_LowBound| is greater than |m_HighBound|.
if (m_LowBound > m_HighBound &&
(oldLowBound != m_LowBound || oldHighBound != m_HighBound))
{
LogErrorF(this, L"\"LowBound\" (%i) must be less then or equal to \"HighBound\" (%i)", m_LowBound, m_HighBound);
m_HighBound = m_LowBound;
}
// Reset the list if the bounds are changed
@ -199,7 +198,7 @@ bool MeasureCalc::GetMeasureValue(const WCHAR* str, int len, double* value, void
int MeasureCalc::GetRandom()
{
if (m_LowBound == m_HighBound)
if (m_LowBound == m_HighBound || m_LowBound > m_HighBound)
{
return m_LowBound;
}