summaryrefslogtreecommitdiff
path: root/indra/llxml/llxmlnode.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-01-23 17:50:15 -0800
committerRichard Linden <none@none>2012-01-23 17:50:15 -0800
commitff5fe4ffc06fa9220043d82a2d7d7dbc0b7ffd77 (patch)
treef6b31777ceb1a66c81aa7322687a9068fbd6a3b9 /indra/llxml/llxmlnode.cpp
parentea6cbc7b6b1de051a9bb1c311c4399a2b4d42cb3 (diff)
parente09661f6ec467ea98715a2a04db40fc4e6b7ce02 (diff)
Automated merge with ssh://hg.lindenlab.com/richard/viewer-experience-merge
Diffstat (limited to 'indra/llxml/llxmlnode.cpp')
-rw-r--r--indra/llxml/llxmlnode.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp
index 2b4a0fc2a1..3d4e6f9a0b 100644
--- a/indra/llxml/llxmlnode.cpp
+++ b/indra/llxml/llxmlnode.cpp
@@ -631,13 +631,14 @@ bool LLXMLNode::updateNode(
}
//update all of node's children with updateNodes children that match name
- LLXMLNodePtr child;
+ LLXMLNodePtr child = node->getFirstChild();
+ LLXMLNodePtr last_child = child;
LLXMLNodePtr updateChild;
for (updateChild = update_node->getFirstChild(); updateChild.notNull();
updateChild = updateChild->getNextSibling())
{
- for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling())
+ while(child.notNull())
{
std::string nodeName;
std::string updateName;
@@ -656,6 +657,22 @@ bool LLXMLNode::updateNode(
if ((nodeName != "") && (updateName == nodeName))
{
updateNode(child, updateChild);
+ last_child = child;
+ child = child->getNextSibling();
+ if (child.isNull())
+ {
+ child = node->getFirstChild();
+ }
+ break;
+ }
+
+ child = child->getNextSibling();
+ if (child.isNull())
+ {
+ child = node->getFirstChild();
+ }
+ if (child == last_child)
+ {
break;
}
}
@@ -882,11 +899,8 @@ bool LLXMLNode::getLayeredXMLNode(LLXMLNodePtr& root,
for (itor = paths.begin(), ++itor; itor != paths.end(); ++itor)
{
- std::string nodeName;
- std::string updateName;
-
std::string layer_filename = *itor;
- if(layer_filename.empty())
+ if(layer_filename.empty() || layer_filename == filename)
{
// no localized version of this file, that's ok, keep looking
continue;
@@ -898,6 +912,9 @@ bool LLXMLNode::getLayeredXMLNode(LLXMLNodePtr& root,
return false;
}
+ std::string nodeName;
+ std::string updateName;
+
updateRoot->getAttributeString("name", updateName);
root->getAttributeString("name", nodeName);