From 1ca743729263ca85fde00574a8b5fc2af285333c Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 31 Mar 2016 21:52:47 +0200 Subject: [PATCH] Transplant settings improvements to sanity check types --- indra/llxml/llcontrol.cpp | 21 +++++++++++---------- indra/llxml/llcontrol.h | 6 +++--- indra/newview/sanitycheck.cpp | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 46446d6706..56e5b9f97d 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -419,19 +419,20 @@ const std::string LLControlGroup::mTypeString[TYPE_COUNT] = { "U32" ,"LLSD" }; +const std::string LLControlGroup::mSanityTypeString[SANITY_TYPE_COUNT] = { "None" + ,"Equals" + ,"NotEquals" + ,"LessThan" + ,"GreaterThan" + ,"LessThanEquals" + ,"GreaterThanEquals" + ,"Between" + ,"NotBetween" + }; + LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker(name) { - - mSanityTypeString[SANITY_TYPE_NONE] = "None"; - mSanityTypeString[SANITY_TYPE_EQUALS] = "Equals"; - mSanityTypeString[SANITY_TYPE_NOT_EQUALS] = "NotEquals"; - mSanityTypeString[SANITY_TYPE_LESS_THAN] = "LessThan"; - mSanityTypeString[SANITY_TYPE_GREATER_THAN] = "GreaterThan"; - mSanityTypeString[SANITY_TYPE_LESS_THAN_EQUALS] = "LessThanEquals"; - mSanityTypeString[SANITY_TYPE_GREATER_THAN_EQUALS] = "GreaterThanEquals"; - mSanityTypeString[SANITY_TYPE_BETWEEN] = "Between"; - mSanityTypeString[SANITY_TYPE_NOT_BETWEEN] = "NotBetween"; } LLControlGroup::~LLControlGroup() diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h index 2e0e118d76..a2df874a63 100644 --- a/indra/llxml/llcontrol.h +++ b/indra/llxml/llcontrol.h @@ -226,13 +226,13 @@ protected: typedef std::map ctrl_name_table_t; ctrl_name_table_t mNameTable; static const std::string mTypeString[TYPE_COUNT]; - std::string mSanityTypeString[SANITY_TYPE_COUNT]; + static const std::string mSanityTypeString[SANITY_TYPE_COUNT]; public: static eControlType typeStringToEnum(const std::string& typestr); - eSanityType sanityTypeStringToEnum(const std::string& sanitystr); + static eSanityType sanityTypeStringToEnum(const std::string& sanitystr); static std::string typeEnumToString(eControlType typeenum); - std::string sanityTypeEnumToString(eSanityType sanitytypeenum); + static std::string sanityTypeEnumToString(eSanityType sanitytypeenum); LLControlGroup(const std::string& name); ~LLControlGroup(); diff --git a/indra/newview/sanitycheck.cpp b/indra/newview/sanitycheck.cpp index e3b21269b2..b089f4f848 100644 --- a/indra/newview/sanitycheck.cpp +++ b/indra/newview/sanitycheck.cpp @@ -69,7 +69,7 @@ void SanityCheck::onSanity(LLControlVariable* controlp) lastControl = controlp; - std::string checkType = "SanityCheck" + gSavedSettings.sanityTypeEnumToString(controlp->getSanityType()); + std::string checkType = "SanityCheck" + LLControlGroup::sanityTypeEnumToString(controlp->getSanityType()); std::vector sanityValues = controlp->getSanityValues(); LLSD args;