Fixed issue that ImageName is ignored if MeasureName is set

http://rainmeter.net/forum/viewtopic.php?p=88820

Reverted this part: 136689bcfb (L4L167)
This commit is contained in:
spx 2013-06-17 20:24:33 +09:00
parent 7c76cf8b2d
commit 4a625d0c2f

View File

@ -159,27 +159,29 @@ bool MeterImage::Update()
{ {
if (!m_Measures.empty() || m_DynamicVariables) if (!m_Measures.empty() || m_DynamicVariables)
{ {
static std::wstring s_ImageNameResult;
// Store the current values so we know if the image needs to be updated // Store the current values so we know if the image needs to be updated
std::wstring oldResult = m_ImageName; std::wstring oldResult = s_ImageNameResult;
if (!m_Measures.empty()) // read from the measures if (!m_Measures.empty()) // read from the measures
{ {
if (m_ImageName.empty()) if (m_ImageName.empty())
{ {
m_ImageName = m_Measures[0]->GetStringOrFormattedValue(AUTOSCALE_OFF, 1, 0, false); s_ImageNameResult = m_Measures[0]->GetStringOrFormattedValue(AUTOSCALE_OFF, 1, 0, false);
} }
else else
{ {
m_ImageName = m_ImageName; s_ImageNameResult = m_ImageName;
if (!ReplaceMeasures(m_ImageName, AUTOSCALE_OFF)) if (!ReplaceMeasures(s_ImageNameResult, AUTOSCALE_OFF))
{ {
// ImageName doesn't contain any measures, so use the result of MeasureName. // ImageName doesn't contain any measures, so use the result of MeasureName.
m_ImageName = m_Measures[0]->GetStringOrFormattedValue(AUTOSCALE_OFF, 1, 0, false); s_ImageNameResult = m_Measures[0]->GetStringOrFormattedValue(AUTOSCALE_OFF, 1, 0, false);
} }
} }
} }
LoadImage(m_ImageName, (wcscmp(oldResult.c_str(), m_ImageName.c_str()) != 0)); LoadImage(s_ImageNameResult, (wcscmp(oldResult.c_str(), s_ImageNameResult.c_str()) != 0));
return true; return true;
} }
else if (m_NeedsRedraw) else if (m_NeedsRedraw)