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:
		@@ -758,6 +758,10 @@ void CMeasure::DoChangeAction(bool execute)
 | 
				
			|||||||
	{
 | 
						{
 | 
				
			||||||
		double newValue = GetValue();
 | 
							double newValue = GetValue();
 | 
				
			||||||
		const WCHAR* newStringValue = GetStringValue();
 | 
							const WCHAR* newStringValue = GetStringValue();
 | 
				
			||||||
 | 
							if (!newStringValue)
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								newStringValue = L"";
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (!m_OldValue)
 | 
							if (!m_OldValue)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -40,34 +40,9 @@ enum AUTOSCALE
 | 
				
			|||||||
class CMeasureValueSet
 | 
					class CMeasureValueSet
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
	CMeasureValueSet(double val, const WCHAR* str) : m_Value(val), m_StringValue(str ? str : L"") {}
 | 
						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; }
 | 
				
			||||||
	void Set(double val, const WCHAR* 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; }
 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		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;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
	double m_Value;
 | 
						double m_Value;
 | 
				
			||||||
	std::wstring m_StringValue;
 | 
						std::wstring m_StringValue;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user