summaryrefslogtreecommitdiff
path: root/indra/llxml
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-05-02 15:59:15 -0700
committerMerov Linden <merov@lindenlab.com>2012-05-02 15:59:15 -0700
commit56af97063aaa35c1a70f5edaf47f4a015600860d (patch)
tree299b113fab1ff7176c86342aa3e881491cd3b883 /indra/llxml
parentb679975d8fdc22d33d0f62288934be8f0209157e (diff)
parent681c5de92bd09622de360818682240b0a17403f7 (diff)
Pull from vir/drano
Diffstat (limited to 'indra/llxml')
-rw-r--r--indra/llxml/llcontrol.h4
-rw-r--r--indra/llxml/llxmlnode.cpp31
2 files changed, 28 insertions, 7 deletions
diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h
index bf38a8b062..597031ec70 100644
--- a/indra/llxml/llcontrol.h
+++ b/indra/llxml/llcontrol.h
@@ -92,6 +92,8 @@ typedef enum e_control_type
class LLControlVariable : public LLRefCount
{
+ LOG_CLASS(LLControlVariable);
+
friend class LLControlGroup;
public:
@@ -180,6 +182,8 @@ T convert_from_llsd(const LLSD& sd, eControlType type, const std::string& contro
//const U32 STRING_CACHE_SIZE = 10000;
class LLControlGroup : public LLInstanceTracker<LLControlGroup, std::string>
{
+ LOG_CLASS(LLControlGroup);
+
protected:
typedef std::map<std::string, LLControlVariablePtr > ctrl_name_table_t;
ctrl_name_table_t mNameTable;
diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp
index 2b4a0fc2a1..2ffb0d8503 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;
}
}
@@ -784,7 +801,7 @@ bool LLXMLNode::parseStream(
while(str.good())
{
str.read((char*)buffer, BUFSIZE);
- int count = str.gcount();
+ int count = (int)str.gcount();
if (XML_Parse(my_parser, (const char *)buffer, count, !str.good()) != XML_STATUS_OK)
{
@@ -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);