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 +++++++++++----------- indra/newview/llfloaterinventory.cpp | 9 +++ indra/newview/llfloaterinventory.h | 1 + .../skins/default/xui/en/floater_my_inventory.xml | 2 +- .../default/xui/en/floater_voice_controls.xml | 2 + 5 files changed, 57 insertions(+), 46 deletions(-) (limited to 'indra') 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 diff --git a/indra/newview/llfloaterinventory.cpp b/indra/newview/llfloaterinventory.cpp index df769bdd88..9b9b90e521 100644 --- a/indra/newview/llfloaterinventory.cpp +++ b/indra/newview/llfloaterinventory.cpp @@ -98,3 +98,12 @@ void LLFloaterInventory::onOpen(const LLSD& key) { //LLFirstUse::useInventory(); } + +void LLFloaterInventory::onClose(bool app_quitting) +{ + LLFloater::onClose(app_quitting); + if (mKey.asInteger() > 1) + { + destroy(); + } +} diff --git a/indra/newview/llfloaterinventory.h b/indra/newview/llfloaterinventory.h index f59a015b07..823c4903b4 100644 --- a/indra/newview/llfloaterinventory.h +++ b/indra/newview/llfloaterinventory.h @@ -58,6 +58,7 @@ public: // Inherited functionality /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onClose(bool app_quitting); LLInventoryPanel* getPanel(); LLPanelMainInventory* getMainInventoryPanel() { return mPanelMainInventory;} diff --git a/indra/newview/skins/default/xui/en/floater_my_inventory.xml b/indra/newview/skins/default/xui/en/floater_my_inventory.xml index 80718584e3..cd0b59dc51 100644 --- a/indra/newview/skins/default/xui/en/floater_my_inventory.xml +++ b/indra/newview/skins/default/xui/en/floater_my_inventory.xml @@ -10,7 +10,7 @@ name="floater_my_inventory" save_rect="true" save_visibility="true" - reuse_instance="false" + reuse_instance="true" title="INVENTORY" width="333" >