[gxml] Document.vala: add depth parametre to copy_node, to facilitate GXmlNode cloning
- From: Richard Hans Schwarting <rschwart src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] Document.vala: add depth parametre to copy_node, to facilitate GXmlNode cloning
- Date: Thu, 22 Aug 2013 17:17:08 +0000 (UTC)
commit 53d52520e1416f489787b63871315499290528ac
Author: Richard Schwarting <aquarichy gmail com>
Date: Wed Aug 21 15:23:48 2013 -0400
Document.vala: add depth parametre to copy_node, to facilitate GXmlNode cloning
gxml/Document.vala | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gxml/Document.vala b/gxml/Document.vala
index 62f8cc1..c6809bb 100644
--- a/gxml/Document.vala
+++ b/gxml/Document.vala
@@ -610,9 +610,10 @@ namespace GXml {
return null;
}
- internal Node copy_node (Node foreign_node) {
+ internal Node copy_node (Node foreign_node, bool deep = true) {
foreign_node.owner_document.sync_dirty_elements ();
- Xml.Node *our_copy_xml = ((BackedNode)foreign_node).node->doc_copy (this.xmldoc, 1);
+ Xml.Node *our_copy_xml = ((BackedNode)foreign_node).node->doc_copy (this.xmldoc, deep
? 1 : 0);
+ // TODO: do we need to append this to this.new_nodes? Do we need to append the
result to this.nodes_to_free? Test memory implications
return this.lookup_node (our_copy_xml); // inducing a GXmlNode
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]