This commit is contained in:
Birunthan Mohanathas 2013-04-10 19:04:28 +03:00
parent aa3c7eb8ce
commit 8c184a3dbb
2 changed files with 7 additions and 28 deletions

View File

@ -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)
{ {

View File

@ -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;