[gxml/gsoc2013] Document.vala: add depth parametre to copy_node, to facilitate GXmlNode cloning



commit 4969ddbdb9d732e5de73460214e720fc64711603
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 e05a5e0..df16623 100644
--- a/gxml/Document.vala
+++ b/gxml/Document.vala
@@ -739,9 +739,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]