mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Simplify aa3c7eb
This commit is contained in:
parent
aa3c7eb8ce
commit
8c184a3dbb
@ -758,6 +758,10 @@ void CMeasure::DoChangeAction(bool execute)
|
||||
{
|
||||
double newValue = GetValue();
|
||||
const WCHAR* newStringValue = GetStringValue();
|
||||
if (!newStringValue)
|
||||
{
|
||||
newStringValue = L"";
|
||||
}
|
||||
|
||||
if (!m_OldValue)
|
||||
{
|
||||
|
@ -40,34 +40,9 @@ enum AUTOSCALE
|
||||
class CMeasureValueSet
|
||||
{
|
||||
public:
|
||||
CMeasureValueSet(double val, const WCHAR* str) : m_Value(val), m_StringValue(str ? str : L"") {}
|
||||
|
||||
void Set(double val, const WCHAR* str)
|
||||
{
|
||||
m_Value = val;
|
||||
if (str)
|
||||
{
|
||||
m_StringValue = str;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_StringValue.clear();
|
||||
}
|
||||
}
|
||||
|
||||
bool IsChanged(double val, const WCHAR* str)
|
||||
{
|
||||
if (m_Value != val ||
|
||||
(!str && !m_StringValue.empty()) ||
|
||||
(str && wcscmp(m_StringValue.c_str(), str) != 0))
|
||||
{
|
||||
Set(val, str);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
CMeasureValueSet(double val, const WCHAR* str) : m_Value(val), m_StringValue(str) {}
|
||||
void Set(double val, const WCHAR* str) { m_Value = val; m_StringValue = str; }
|
||||
bool IsChanged(double val, const WCHAR* str) { if (m_Value != val || wcscmp(m_StringValue.c_str(), str) != 0) { Set(val, str); return true; } return false; }
|
||||
private:
|
||||
double m_Value;
|
||||
std::wstring m_StringValue;
|
||||
|
Loading…
Reference in New Issue
Block a user