diff options
Diffstat (limited to 'linden/indra/llxml')
-rw-r--r-- | linden/indra/llxml/llcontrol.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/linden/indra/llxml/llcontrol.cpp b/linden/indra/llxml/llcontrol.cpp index b97498d..b9fa8ff 100644 --- a/linden/indra/llxml/llcontrol.cpp +++ b/linden/indra/llxml/llcontrol.cpp | |||
@@ -1235,12 +1235,25 @@ void LLControlGroup::resetToDefaults() | |||
1235 | } | 1235 | } |
1236 | 1236 | ||
1237 | //============================================================================ | 1237 | //============================================================================ |
1238 | // FIrst-use | 1238 | // First-use |
1239 | 1239 | ||
1240 | static LLString get_warn_name(const LLString& name) | ||
1241 | { | ||
1242 | LLString warnname = "Warn" + name; | ||
1243 | for (LLString::iterator iter = warnname.begin(); iter != warnname.end(); ++iter) | ||
1244 | { | ||
1245 | char c = *iter; | ||
1246 | if (!isalnum(c)) | ||
1247 | { | ||
1248 | *iter = '_'; | ||
1249 | } | ||
1250 | } | ||
1251 | return warnname; | ||
1252 | } | ||
1240 | 1253 | ||
1241 | void LLControlGroup::addWarning(const LLString& name) | 1254 | void LLControlGroup::addWarning(const LLString& name) |
1242 | { | 1255 | { |
1243 | LLString warnname = "Warn" + name; | 1256 | LLString warnname = get_warn_name(name); |
1244 | if(!mNameTable[warnname]) | 1257 | if(!mNameTable[warnname]) |
1245 | { | 1258 | { |
1246 | LLString comment = LLString("Enables ") + name + LLString(" warning dialog"); | 1259 | LLString comment = LLString("Enables ") + name + LLString(" warning dialog"); |
@@ -1251,13 +1264,13 @@ void LLControlGroup::addWarning(const LLString& name) | |||
1251 | 1264 | ||
1252 | BOOL LLControlGroup::getWarning(const LLString& name) | 1265 | BOOL LLControlGroup::getWarning(const LLString& name) |
1253 | { | 1266 | { |
1254 | LLString warnname = "Warn" + name; | 1267 | LLString warnname = get_warn_name(name); |
1255 | return getBOOL(warnname); | 1268 | return getBOOL(warnname); |
1256 | } | 1269 | } |
1257 | 1270 | ||
1258 | void LLControlGroup::setWarning(const LLString& name, BOOL val) | 1271 | void LLControlGroup::setWarning(const LLString& name, BOOL val) |
1259 | { | 1272 | { |
1260 | LLString warnname = "Warn" + name; | 1273 | LLString warnname = get_warn_name(name); |
1261 | setBOOL(warnname, val); | 1274 | setBOOL(warnname, val); |
1262 | } | 1275 | } |
1263 | 1276 | ||