diff options
author | Rider Linden <rider@lindenlab.com> | 2018-08-21 15:59:18 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-08-21 15:59:18 -0700 |
commit | 4859db1adabcf84b959ff0603f1bb8401232164c (patch) | |
tree | 94772976ee3b8bae51eeb6510711da9e74b2a013 /indra/llinventory/llsettingsbase.cpp | |
parent | 477c66c890d5d87318705415315aaf9464bec2ff (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.cpp | 14 |
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) { |