summaryrefslogtreecommitdiff
path: root/indra/llxml/llcontrol.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llxml/llcontrol.cpp')
-rw-r--r--indra/llxml/llcontrol.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp
index 11f3c132bb..78b2181e86 100644
--- a/indra/llxml/llcontrol.cpp
+++ b/indra/llxml/llcontrol.cpp
@@ -1235,12 +1235,25 @@ void LLControlGroup::resetToDefaults()
}
//============================================================================
-// FIrst-use
+// First-use
+static LLString get_warn_name(const LLString& name)
+{
+ LLString warnname = "Warn" + name;
+ for (LLString::iterator iter = warnname.begin(); iter != warnname.end(); ++iter)
+ {
+ char c = *iter;
+ if (!isalnum(c))
+ {
+ *iter = '_';
+ }
+ }
+ return warnname;
+}
void LLControlGroup::addWarning(const LLString& name)
{
- LLString warnname = "Warn" + name;
+ LLString warnname = get_warn_name(name);
if(!mNameTable[warnname])
{
LLString comment = LLString("Enables ") + name + LLString(" warning dialog");
@@ -1251,13 +1264,13 @@ void LLControlGroup::addWarning(const LLString& name)
BOOL LLControlGroup::getWarning(const LLString& name)
{
- LLString warnname = "Warn" + name;
+ LLString warnname = get_warn_name(name);
return getBOOL(warnname);
}
void LLControlGroup::setWarning(const LLString& name, BOOL val)
{
- LLString warnname = "Warn" + name;
+ LLString warnname = get_warn_name(name);
setBOOL(warnname, val);
}