diff options
author | Richard Nelson <richard@lindenlab.com> | 2011-10-10 16:55:36 -0700 |
---|---|---|
committer | Richard Nelson <richard@lindenlab.com> | 2011-10-10 16:55:36 -0700 |
commit | 2d1431b2f0bb903be9259cbcae630f605d9c208c (patch) | |
tree | 353b2b820412cce9422983284fe1a90981be15e6 /indra/llxuixml | |
parent | a07c3559b6d22ef62e8deab56780d74ac72501e1 (diff) | |
parent | 2d34dab6a3d3f4b8ad78aee941800fe8f5f27bd1 (diff) |
Automated merge with ssh://hg.lindenlab.com/richard/viewer-experience-fui
Diffstat (limited to 'indra/llxuixml')
-rw-r--r-- | indra/llxuixml/llxuiparser.cpp | 26 | ||||
-rw-r--r-- | indra/llxuixml/llxuiparser.h | 2 |
2 files changed, 9 insertions, 19 deletions
diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp index 1bb550d98f..aee8fa8d8f 100644 --- a/indra/llxuixml/llxuiparser.cpp +++ b/indra/llxuixml/llxuiparser.cpp @@ -729,22 +729,11 @@ void LLXUIParser::writeXUI(LLXMLNodePtr node, const LLInitParam::BaseBlock &bloc // go from a stack of names to a specific XML node LLXMLNodePtr LLXUIParser::getNode(name_stack_t& stack) { - name_stack_t name_stack; - for (name_stack_t::const_iterator it = stack.begin(); - it != stack.end(); - ++it) - { - if (!it->first.empty()) - { - name_stack.push_back(*it); - } - } - LLXMLNodePtr out_node = mWriteRootNode; - name_stack_t::const_iterator next_it = name_stack.begin(); - for (name_stack_t::const_iterator it = name_stack.begin(); - it != name_stack.end(); + name_stack_t::iterator next_it = stack.begin(); + for (name_stack_t::iterator it = stack.begin(); + it != stack.end(); it = next_it) { ++next_it; @@ -753,17 +742,18 @@ LLXMLNodePtr LLXUIParser::getNode(name_stack_t& stack) continue; } - out_nodes_t::iterator found_it = mOutNodes.lower_bound(it->second); + out_nodes_t::iterator found_it = mOutNodes.find(it->first); // node with this name not yet written - if (found_it == mOutNodes.end() || mOutNodes.key_comp()(found_it->first, it->second)) + if (found_it == mOutNodes.end() || it->second) { // make an attribute if we are the last element on the name stack - bool is_attribute = next_it == name_stack.end(); + bool is_attribute = next_it == stack.end(); LLXMLNodePtr new_node = new LLXMLNode(it->first.c_str(), is_attribute); out_node->addChild(new_node); - mOutNodes.insert(found_it, std::make_pair(it->second, new_node)); + mOutNodes[it->first] = new_node; out_node = new_node; + it->second = false; } else { diff --git a/indra/llxuixml/llxuiparser.h b/indra/llxuixml/llxuiparser.h index e0402523da..d7cd256967 100644 --- a/indra/llxuixml/llxuiparser.h +++ b/indra/llxuixml/llxuiparser.h @@ -157,7 +157,7 @@ private: // Root of the widget XML sub-tree, for example, "line_editor" LLXMLNodePtr mWriteRootNode; - typedef std::map<S32, LLXMLNodePtr> out_nodes_t; + typedef std::map<std::string, LLXMLNodePtr> out_nodes_t; out_nodes_t mOutNodes; LLXMLNodePtr mLastWrittenChild; S32 mCurReadDepth; |