From 9560fb7cb2b0b542e7dbf028d40bda2cd9da05c5 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 20 Oct 2011 12:12:15 -0700 Subject: fix for Multiple not working with non block types --- indra/llxuixml/llinitparam.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llxuixml') diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index 1e295ada2d..183472450d 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -982,7 +982,7 @@ namespace LLInitParam if (parser.readValue(name)) { // try to parse a per type named value - if (name_value_lookup_t::getValueFromName(name, typed_param.mValues)) + if (name_value_lookup_t::getValueFromName(name, value)) { typed_param.add(value); typed_param.mValues.back().setValueName(name); @@ -1013,7 +1013,7 @@ namespace LLInitParam bool value_written = parser.writeValue(*it, name_stack); if (!value_written) { - std::string calculated_key = typed_param.calcValueName(typed_param.getValue()); + std::string calculated_key = it->calcValueName(key); if (!parser.writeValue(calculated_key, name_stack)) { break; -- cgit v1.2.3 From 2cc4321166bfb6515a08fe1dd8053dae6d6840e3 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 20 Oct 2011 15:53:43 -0700 Subject: EXP-1423 FIX FUI resets floater contents after closing them (Inventory Panel), this is inconsistant for previous sidebar users and introduces extra difficulty in productivity of the viewer. EXP-1430 FIX Minimizing voice settings floater corrupts layout throughout rest of session --- indra/llxuixml/llxuiparser.cpp | 89 +++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 45 deletions(-) (limited to 'indra/llxuixml') diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp index d4556113ea..878f992178 100644 --- a/indra/llxuixml/llxuiparser.cpp +++ b/indra/llxuixml/llxuiparser.cpp @@ -51,6 +51,14 @@ static LLInitParam::Parser::parser_read_func_map_t sXSDReadFuncs; static LLInitParam::Parser::parser_write_func_map_t sXSDWriteFuncs; static LLInitParam::Parser::parser_inspect_func_map_t sXSDInspectFuncs; +static LLInitParam::Parser::parser_read_func_map_t sSimpleXUIReadFuncs; +static LLInitParam::Parser::parser_write_func_map_t sSimpleXUIWriteFuncs; +static LLInitParam::Parser::parser_inspect_func_map_t sSimpleXUIInspectFuncs; + +const char* NO_VALUE_MARKER = "no_value"; + +const S32 LINE_NUMBER_HERE = 0; + struct MaxOccur : public LLInitParam::ChoiceBlock { Alternative count; @@ -1190,12 +1198,6 @@ struct ScopedFile LLFILE* mFile; }; -static LLInitParam::Parser::parser_read_func_map_t sSimpleXUIReadFuncs; -static LLInitParam::Parser::parser_write_func_map_t sSimpleXUIWriteFuncs; -static LLInitParam::Parser::parser_inspect_func_map_t sSimpleXUIInspectFuncs; - -const char* NO_VALUE_MARKER = "no_value"; - LLSimpleXUIParser::LLSimpleXUIParser(LLSimpleXUIParser::element_start_callback_t element_cb) : Parser(sSimpleXUIReadFuncs, sSimpleXUIWriteFuncs, sSimpleXUIInspectFuncs), mCurReadDepth(0), @@ -1300,6 +1302,11 @@ void LLSimpleXUIParser::characterDataHandler(void *userData, const char *s, int self->characterData(s, len); } +void LLSimpleXUIParser::characterData(const char *s, int len) +{ + mTextContents += std::string(s, len); +} + void LLSimpleXUIParser::startElement(const char *name, const char **atts) { processText(); @@ -1372,6 +1379,37 @@ void LLSimpleXUIParser::startElement(const char *name, const char **atts) } +void LLSimpleXUIParser::endElement(const char *name) +{ + bool has_text = processText(); + + // no text, attributes, or children + if (!has_text && mEmptyLeafNode.back()) + { + // submit this as a valueless name (even though there might be text contents we haven't seen yet) + mCurAttributeValueBegin = NO_VALUE_MARKER; + mOutputStack.back().first->submitValue(mNameStack, *this, mParseSilently); + } + + if (--mOutputStack.back().second == 0) + { + if (mOutputStack.empty()) + { + LL_ERRS("ReadXUI") << "Parameter block output stack popped while empty." << LL_ENDL; + } + mOutputStack.pop_back(); + } + + S32 num_tokens_to_pop = mTokenSizeStack.back(); + mTokenSizeStack.pop_back(); + while(num_tokens_to_pop-- > 0) + { + mNameStack.pop_back(); + } + mScope.pop_back(); + mEmptyLeafNode.pop_back(); +} + bool LLSimpleXUIParser::readAttributes(const char **atts) { typedef boost::tokenizer > tokenizer; @@ -1421,43 +1459,6 @@ bool LLSimpleXUIParser::processText() return false; } -void LLSimpleXUIParser::endElement(const char *name) -{ - bool has_text = processText(); - - // no text, attributes, or children - if (!has_text && mEmptyLeafNode.back()) - { - // submit this as a valueless name (even though there might be text contents we haven't seen yet) - mCurAttributeValueBegin = NO_VALUE_MARKER; - mOutputStack.back().first->submitValue(mNameStack, *this, mParseSilently); - } - - if (--mOutputStack.back().second == 0) - { - if (mOutputStack.empty()) - { - LL_ERRS("ReadXUI") << "Parameter block output stack popped while empty." << LL_ENDL; - } - mOutputStack.pop_back(); - } - - S32 num_tokens_to_pop = mTokenSizeStack.back(); - mTokenSizeStack.pop_back(); - while(num_tokens_to_pop-- > 0) - { - mNameStack.pop_back(); - } - mScope.pop_back(); - mEmptyLeafNode.pop_back(); -} - -void LLSimpleXUIParser::characterData(const char *s, int len) -{ - mTextContents += std::string(s, len); -} - - /*virtual*/ std::string LLSimpleXUIParser::getCurrentElementName() { std::string full_name; @@ -1471,8 +1472,6 @@ void LLSimpleXUIParser::characterData(const char *s, int len) return full_name; } -const S32 LINE_NUMBER_HERE = 0; - void LLSimpleXUIParser::parserWarning(const std::string& message) { #ifdef LL_WINDOWS -- cgit v1.2.3