From 118e3b33bd417331397f89770d46b1b3eeeffc8e Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 3 Aug 2012 17:43:48 -0700 Subject: CHUI-270 FIX Progress spinner not visible in merchant outbox --- indra/llcommon/llinitparam.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/llcommon/llinitparam.h') diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index 2f767c234e..14ba8e0b43 100644 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -2194,7 +2194,7 @@ namespace LLInitParam resetToDefault(); } return mValue.deserializeBlock(p, name_stack_range, new_name); - } + } void serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const self_t* diff_block = NULL) const { @@ -2211,12 +2211,16 @@ namespace LLInitParam bool mergeBlockParam(bool source_provided, bool dst_provided, BlockDescriptor& block_data, const self_t& source, bool overwrite) { - if (overwrite) + if ((overwrite && source_provided) // new values coming in on top or... + || (!overwrite && !dst_provided)) // values being pushed under with nothing already there { + // clear away what is there and take the new stuff as a whole resetToDefault(); return mValue.mergeBlock(block_data, source.getValue(), overwrite); } - return false; + + + return mValue.mergeBlock(block_data, source.getValue(), overwrite); } bool validateBlock(bool emit_errors = true) const -- cgit v1.2.3 From c7cac7896ee4ccdd71dad432f1314b85987e78cf Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Wed, 13 Feb 2013 20:44:38 +0200 Subject: CHUI-739 Fixed! FUI toolbars not displayed when switching between CHUI and release viewer : parsing declare values of Enums --- indra/llcommon/llinitparam.h | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'indra/llcommon/llinitparam.h') diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index 75c87c4bdb..695403e3f4 100644 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -439,7 +439,7 @@ namespace LLInitParam {} void operator ()(const std::string& name) - { + { *this = name; } @@ -516,14 +516,30 @@ namespace LLInitParam { static bool read(T& param, Parser* parser) { - // read all enums as ints + std::string value_string; + //TypeValues::value_t v; + + // trying to get the declare value + parser_read_func_map_t::iterator string_func = parser->mParserReadFuncs->find(&typeid(std::string)); + if (string_func != parser->mParserReadFuncs->end()) + { + if (string_func->second(*parser, (void*)&value_string)) + { + if (TypeValues::getValueFromName(value_string, param)) + { + return true; + } + } + } + + // read enums as ints if it not declared as string parser_read_func_map_t::iterator found_it = parser->mParserReadFuncs->find(&typeid(S32)); if (found_it != parser->mParserReadFuncs->end()) { - S32 value; - if (found_it->second(*parser, (void*)&value)) + S32 value_S32; + if (found_it->second(*parser, (void*)&value_S32)) { - param = (T)value; + param = (T)value_S32; return true; } } -- cgit v1.2.3 From 638d94eef75799d47f8b913e0909b4079e55c03b Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Thu, 14 Feb 2013 18:51:13 +0200 Subject: CHUI-739 : Clean up : FUI toolbars not displayed when switching between CHUI and release viewer --- indra/llcommon/llinitparam.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llcommon/llinitparam.h') diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index 695403e3f4..eb4d84d835 100644 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -517,7 +517,6 @@ namespace LLInitParam static bool read(T& param, Parser* parser) { std::string value_string; - //TypeValues::value_t v; // trying to get the declare value parser_read_func_map_t::iterator string_func = parser->mParserReadFuncs->find(&typeid(std::string)); -- cgit v1.2.3 From 45849294cefd33c4875b5fe5b3fc8f04745452cf Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 18 Feb 2013 20:30:22 -0800 Subject: CHUI-739 FIX FUI toolbars not displayed when switching between CHUI and release viewer param blocks no longer write enums as ints --- indra/llcommon/llinitparam.h | 94 +++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 59 deletions(-) (limited to 'indra/llcommon/llinitparam.h') diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index 75c87c4bdb..66aac4f549 100644 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -485,62 +485,6 @@ namespace LLInitParam typedef std::map parser_write_func_map_t; typedef std::map parser_inspect_func_map_t; - private: - template::value> - struct ReaderWriter - { - static bool read(T& param, Parser* parser) - { - parser_read_func_map_t::iterator found_it = parser->mParserReadFuncs->find(&typeid(T)); - if (found_it != parser->mParserReadFuncs->end()) - { - return found_it->second(*parser, (void*)¶m); - } - return false; - } - - static bool write(const T& param, Parser* parser, name_stack_t& name_stack) - { - parser_write_func_map_t::iterator found_it = parser->mParserWriteFuncs->find(&typeid(T)); - if (found_it != parser->mParserWriteFuncs->end()) - { - return found_it->second(*parser, (const void*)¶m, name_stack); - } - return false; - } - }; - - // read enums as ints - template - struct ReaderWriter - { - static bool read(T& param, Parser* parser) - { - // read all enums as ints - parser_read_func_map_t::iterator found_it = parser->mParserReadFuncs->find(&typeid(S32)); - if (found_it != parser->mParserReadFuncs->end()) - { - S32 value; - if (found_it->second(*parser, (void*)&value)) - { - param = (T)value; - return true; - } - } - return false; - } - - static bool write(const T& param, Parser* parser, name_stack_t& name_stack) - { - parser_write_func_map_t::iterator found_it = parser->mParserWriteFuncs->find(&typeid(S32)); - if (found_it != parser->mParserWriteFuncs->end()) - { - return found_it->second(*parser, (const void*)¶m, name_stack); - } - return false; - } - }; - public: Parser(parser_read_func_map_t& read_map, parser_write_func_map_t& write_map, parser_inspect_func_map_t& inspect_map) @@ -552,14 +496,46 @@ namespace LLInitParam virtual ~Parser(); - template bool readValue(T& param) + template bool readValue(T& param, typename boost::disable_if >::type* dummy = 0) { - return ReaderWriter::read(param, this); + parser_read_func_map_t::iterator found_it = mParserReadFuncs->find(&typeid(T)); + if (found_it != mParserReadFuncs->end()) + { + return found_it->second(*this, (void*)¶m); + } + + return false; } + template bool readValue(T& param, typename boost::enable_if >::type* dummy = 0) + { + parser_read_func_map_t::iterator found_it = mParserReadFuncs->find(&typeid(T)); + if (found_it != mParserReadFuncs->end()) + { + return found_it->second(*this, (void*)¶m); + } + else + { + found_it = mParserReadFuncs->find(&typeid(S32)); + if (found_it != mParserReadFuncs->end()) + { + S32 int_value; + bool parsed = found_it->second(*this, (void*)&int_value); + param = (T)int_value; + return parsed; + } + } + return false; + } + template bool writeValue(const T& param, name_stack_t& name_stack) { - return ReaderWriter::write(param, this, name_stack); + parser_write_func_map_t::iterator found_it = mParserWriteFuncs->find(&typeid(T)); + if (found_it != mParserWriteFuncs->end()) + { + return found_it->second(*this, (const void*)¶m, name_stack); + } + return false; } // dispatch inspection to registered inspection functions, for each parameter in a param block -- cgit v1.2.3