mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Tweaks.
This commit is contained in:
parent
33d447a907
commit
e99403ce1e
@ -71,7 +71,7 @@ extern CRainmeter* Rainmeter;
|
||||
** 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_Invert(false),
|
||||
m_LogMaxValue(false),
|
||||
|
@ -54,7 +54,6 @@ public:
|
||||
|
||||
const WCHAR* GetName() { return m_Name.c_str(); }
|
||||
const std::wstring& GetOriginalName() { return m_Name; }
|
||||
const char* GetAsciiName() { return m_AsciiName.c_str(); }
|
||||
|
||||
void Disable() { m_Disabled = true; }
|
||||
void Enable() { m_Disabled = false; }
|
||||
@ -101,7 +100,6 @@ protected:
|
||||
double m_MaxValue; // The maximum value (so far)
|
||||
double m_Value; // The current value
|
||||
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
|
||||
bool m_RegExpSubstitute;
|
||||
|
@ -122,6 +122,7 @@ void CMeasureCalc::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** FormulaReplace
|
||||
**
|
||||
@ -157,6 +158,7 @@ void CMeasureCalc::FormulaReplace()
|
||||
}
|
||||
while (pos != std::wstring::npos);
|
||||
}
|
||||
|
||||
bool CMeasureCalc::GetMeasureValue(const WCHAR* str, int len, double* value)
|
||||
{
|
||||
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();
|
||||
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();
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user