From 4a625d0c2f4fd45ce9f62ea3a6281d97717c9646 Mon Sep 17 00:00:00 2001 From: spx Date: Mon, 17 Jun 2013 20:24:33 +0900 Subject: [PATCH] Fixed issue that ImageName is ignored if MeasureName is set http://rainmeter.net/forum/viewtopic.php?p=88820 Reverted this part: https://github.com/rainmeter/rainmeter/commit/136689bcfb1f3497f1d3f2503f793c6008447e66#L4L167 --- Library/MeterImage.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Library/MeterImage.cpp b/Library/MeterImage.cpp index 2d35e090..00057806 100644 --- a/Library/MeterImage.cpp +++ b/Library/MeterImage.cpp @@ -159,27 +159,29 @@ bool MeterImage::Update() { 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 - std::wstring oldResult = m_ImageName; + std::wstring oldResult = s_ImageNameResult; if (!m_Measures.empty()) // read from the measures { 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 { - m_ImageName = m_ImageName; - if (!ReplaceMeasures(m_ImageName, AUTOSCALE_OFF)) + s_ImageNameResult = m_ImageName; + if (!ReplaceMeasures(s_ImageNameResult, AUTOSCALE_OFF)) { // 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; } else if (m_NeedsRedraw)