ignore xml children parsing in text node
This commit is contained in:
10
src/node.cpp
10
src/node.cpp
@@ -1365,7 +1365,7 @@ void Node::parse_attributes(kAttribute ka, const tinyxml2::XMLAttribute* attr)
|
||||
}
|
||||
}
|
||||
|
||||
void Node::load_internal(const tinyxml2::XMLElement* x_node)
|
||||
void Node::load_internal(const tinyxml2::XMLElement* x_node, bool skip_children /*= false*/)
|
||||
{
|
||||
m_name = x_node->Name();
|
||||
//LOG("load_internal node %s", m_name.c_str());
|
||||
@@ -1381,6 +1381,12 @@ void Node::load_internal(const tinyxml2::XMLElement* x_node)
|
||||
|
||||
create();
|
||||
|
||||
if (skip_children)
|
||||
{
|
||||
loaded();
|
||||
return;
|
||||
}
|
||||
|
||||
auto x_child = x_node->FirstChildElement();
|
||||
while (x_child)
|
||||
{
|
||||
@@ -1442,7 +1448,7 @@ void Node::load_internal(const tinyxml2::XMLElement* x_node)
|
||||
{
|
||||
auto n = new NodeText();
|
||||
add_child(n);
|
||||
n->load_internal(x_child);
|
||||
n->load_internal(x_child, true);
|
||||
std::string text;
|
||||
auto node = x_child->FirstChild();
|
||||
while (node)
|
||||
|
||||
@@ -209,7 +209,7 @@ public:
|
||||
void update();
|
||||
void update_internal(const glm::vec2& origin, const glm::mat4& proj, float zoom);
|
||||
virtual void parse_attributes(kAttribute ka, const tinyxml2::XMLAttribute* attr);
|
||||
void load_internal(const tinyxml2::XMLElement* x_node);
|
||||
void load_internal(const tinyxml2::XMLElement* x_node, bool skip_children = false);
|
||||
virtual void draw();
|
||||
virtual Node* clone_instantiate() const;
|
||||
virtual void clone_copy(Node* dest) const;
|
||||
|
||||
Reference in New Issue
Block a user