summaryrefslogtreecommitdiff
path: root/indra/llxuixml/llxuiparser.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2011-10-10 18:22:56 -0700
committerMerov Linden <merov@lindenlab.com>2011-10-10 18:22:56 -0700
commit8b5a905bdbabf1d81bebdff8925098137fd653ab (patch)
treed76206c5b9f9996e7498cfdacd44a87961920765 /indra/llxuixml/llxuiparser.cpp
parent1478f22857c24f4f3ecfcf7a08fdd4d5392ee3e6 (diff)
parent7e13856df2c60a7e011df01459a3a085a3a4a82a (diff)
pull from richard/viewer-experience-fui
Diffstat (limited to 'indra/llxuixml/llxuiparser.cpp')
-rw-r--r--indra/llxuixml/llxuiparser.cpp26
1 files changed, 8 insertions, 18 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
{