This commit is contained in:
Birunthan Mohanathas 2012-01-23 09:35:32 +00:00
parent 33d447a907
commit e99403ce1e
3 changed files with 6 additions and 5 deletions

View File

@ -71,7 +71,7 @@ extern CRainmeter* Rainmeter;
** The constructor ** The constructor
** **
*/ */
CMeasure::CMeasure(CMeterWindow* meterWindow, const WCHAR* name) : m_MeterWindow(meterWindow), m_Name(name), m_AsciiName(ConvertToAscii(name)), CMeasure::CMeasure(CMeterWindow* meterWindow, const WCHAR* name) : m_MeterWindow(meterWindow), m_Name(name),
m_DynamicVariables(false), m_DynamicVariables(false),
m_Invert(false), m_Invert(false),
m_LogMaxValue(false), m_LogMaxValue(false),

View File

@ -54,7 +54,6 @@ public:
const WCHAR* GetName() { return m_Name.c_str(); } const WCHAR* GetName() { return m_Name.c_str(); }
const std::wstring& GetOriginalName() { return m_Name; } const std::wstring& GetOriginalName() { return m_Name; }
const char* GetAsciiName() { return m_AsciiName.c_str(); }
void Disable() { m_Disabled = true; } void Disable() { m_Disabled = true; }
void Enable() { m_Disabled = false; } void Enable() { m_Disabled = false; }
@ -101,7 +100,6 @@ protected:
double m_MaxValue; // The maximum value (so far) double m_MaxValue; // The maximum value (so far)
double m_Value; // The current value double m_Value; // The current value
const std::wstring m_Name; // Name of this Measure const std::wstring m_Name; // Name of this Measure
const std::string m_AsciiName; // Name of this Measure in ANSI
std::vector<std::wstring> m_Substitute; // Vec of substitute strings std::vector<std::wstring> m_Substitute; // Vec of substitute strings
bool m_RegExpSubstitute; bool m_RegExpSubstitute;

View File

@ -122,6 +122,7 @@ void CMeasureCalc::ReadConfig(CConfigParser& parser, const WCHAR* section)
} }
} }
} }
/* /*
** FormulaReplace ** FormulaReplace
** **
@ -157,6 +158,7 @@ void CMeasureCalc::FormulaReplace()
} }
while (pos != std::wstring::npos); while (pos != std::wstring::npos);
} }
bool CMeasureCalc::GetMeasureValue(const WCHAR* str, int len, double* value) bool CMeasureCalc::GetMeasureValue(const WCHAR* str, int len, double* value)
{ {
const std::list<CMeasure*>& measures = m_MeterWindow->GetMeasures(); const std::list<CMeasure*>& measures = m_MeterWindow->GetMeasures();
@ -164,7 +166,8 @@ bool CMeasureCalc::GetMeasureValue(const WCHAR* str, int len, double* value)
std::list<CMeasure*>::const_iterator iter = measures.begin(); std::list<CMeasure*>::const_iterator iter = measures.begin();
for ( ; iter != measures.end(); ++iter) for ( ; iter != measures.end(); ++iter)
{ {
if (_wcsnicmp(str, (*iter)->GetName(), len) == 0) if ((*iter)->GetOriginalName().length() == len &&
_wcsnicmp(str, (*iter)->GetName(), len) == 0)
{ {
*value = (*iter)->GetValue(); *value = (*iter)->GetValue();
return true; return true;