From 477610f83246b609a58951a44a568cf2f57f6c23 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Mon, 26 Sep 2011 14:05:07 +0000 Subject: [PATCH] DynamicVariables are now supported with plugins on settings that are common to all measures (e.g. MaxValue). --- Library/MeasurePlugin.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Library/MeasurePlugin.cpp b/Library/MeasurePlugin.cpp index 18fdeb6d..bc2c69ed 100644 --- a/Library/MeasurePlugin.cpp +++ b/Library/MeasurePlugin.cpp @@ -97,9 +97,11 @@ void CMeasurePlugin::ReadConfig(CConfigParser& parser, const WCHAR* section) CMeasure::ReadConfig(parser, section); - // DynamicVariables is now disabled in MeasurePlugin due to a limitation of the re-initialization. - // Do not set m_DynamicVariables to "true". - m_DynamicVariables = false; + if (m_Initialized) + { + // DynamicVariables doesn't work with plugins, so stop here. + return; + } m_PluginName = parser.ReadString(section, L"Plugin", L""); @@ -183,8 +185,8 @@ void CMeasurePlugin::ReadConfig(CConfigParser& parser, const WCHAR* section) SetDllDirectory(L""); CSystem::ResetWorkingDirectory(); - std::wstring szMaxValue = parser.ReadString(section, L"MaxValue", L"NotSet"); - if (szMaxValue == L"NotSet") + const std::wstring& szMaxValue = parser.ReadString(section, L"MaxValue", L""); + if (szMaxValue.empty()) { m_MaxValue = maxValue; }