diff options
author | Adam Moss <moss@lindenlab.com> | 2009-05-22 09:58:47 +0000 |
---|---|---|
committer | Adam Moss <moss@lindenlab.com> | 2009-05-22 09:58:47 +0000 |
commit | 9dfe0ca9a0228c4fa75c8a3e51840696cc6b4960 (patch) | |
tree | 3136e0a32cdcb1d55a4c3a5a67791ca128d947a5 /indra/llxml | |
parent | 93cf3d89e51835dd2f61c32b16191ab724528055 (diff) |
svn merge -r121194:121210
svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-1.23.onetwo-merge-1
QAR-1531 viewer 1.23rc1+1.23rc2 merge to trunk
Diffstat (limited to 'indra/llxml')
-rw-r--r-- | indra/llxml/llcontrol.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index d9ed45ab9d..8bd04d727c 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -309,10 +309,13 @@ BOOL LLControlGroup::declareControl(const std::string& name, eControlType type, { if (persist && existing_control->isType(type)) { - // Sometimes we need to declare a control *after* it has been loaded from a settings file. - LLSD cur_value = existing_control->getValue(); // get the current value - existing_control->setDefaultValue(initial_val); // set the default to the declared value - existing_control->setValue(cur_value); // now set to the loaded value + if (!existing_control->llsd_compare(existing_control->getDefault(), initial_val)) + { + // Sometimes we need to declare a control *after* it has been loaded from a settings file. + LLSD cur_value = existing_control->getValue(); // get the current value + existing_control->setDefaultValue(initial_val); // set the default to the declared value + existing_control->setValue(cur_value); // now set to the loaded value + } } else { @@ -1059,10 +1062,10 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v } U32 validitems = 0; - bool persist = true; bool hidefromsettingseditor = false; for(LLSD::map_const_iterator itr = settings.beginMap(); itr != settings.endMap(); ++itr) { + bool persist = true; name = (*itr).first; control_map = (*itr).second; @@ -1171,13 +1174,13 @@ static std::string get_warn_name(const std::string& name) void LLControlGroup::addWarning(const std::string& name) { + // Note: may get called more than once per warning + // (e.g. if allready loaded from a settings file), + // but that is OK, declareBOOL will handle it std::string warnname = get_warn_name(name); - if(mNameTable.find(warnname) == mNameTable.end()) - { - std::string comment = std::string("Enables ") + name + std::string(" warning dialog"); - declareBOOL(warnname, TRUE, comment); - mWarnings.insert(warnname); - } + std::string comment = std::string("Enables ") + name + std::string(" warning dialog"); + declareBOOL(warnname, TRUE, comment); + mWarnings.insert(warnname); } BOOL LLControlGroup::getWarning(const std::string& name) |