summaryrefslogtreecommitdiff
path: root/indra/llinventory/llsettingsbase.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-08-21 15:59:18 -0700
committerRider Linden <rider@lindenlab.com>2018-08-21 15:59:18 -0700
commit4859db1adabcf84b959ff0603f1bb8401232164c (patch)
tree94772976ee3b8bae51eeb6510711da9e74b2a013 /indra/llinventory/llsettingsbase.cpp
parent477c66c890d5d87318705415315aaf9464bec2ff (diff)
MAINT-9026: Adding scale for sun and moon. Also don't allow the user to directly set the radio buttons for inventory and custom.
Diffstat (limited to 'indra/llinventory/llsettingsbase.cpp')
-rw-r--r--indra/llinventory/llsettingsbase.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp
index e00dd2199c..938f614fc9 100644
--- a/indra/llinventory/llsettingsbase.cpp
+++ b/indra/llinventory/llsettingsbase.cpp
@@ -306,7 +306,7 @@ bool LLSettingsBase::validate()
LLSD LLSettingsBase::settingValidation(LLSD &settings, validation_list_t &validations)
{
- static Validator validateName(SETTING_NAME, false, LLSD::TypeString);
+ static Validator validateName(SETTING_NAME, false, LLSD::TypeString, boost::bind(&Validator::verifyStringLength, _1, 32));
static Validator validateId(SETTING_ID, false, LLSD::TypeUUID);
static Validator validateHash(SETTING_HASH, false, LLSD::TypeInteger);
static Validator validateType(SETTING_TYPE, false, LLSD::TypeString);
@@ -564,6 +564,18 @@ bool LLSettingsBase::Validator::verifyIntegerRange(LLSD &value, LLSD range)
return true;
}
+bool LLSettingsBase::Validator::verifyStringLength(LLSD &value, S32 length)
+{
+ std::string sval = value.asString();
+
+ if (!sval.empty())
+ {
+ sval = sval.substr(0, length);
+ value = LLSD::String(sval);
+ }
+ return true;
+}
+
//=========================================================================
void LLSettingsBlender::update(const LLSettingsBase::BlendFactor& blendf)
{