Code

plumb XML::Document parameter into duplication, courtesy of bryce
[inkscape.git] / src / xml / simple-node.cpp
index f439243cdb2ccb49761abc03d9cc00144ef3ebc4..c8b0828c45d1e5c2a64fe2e48ce2d387cce8d3e8 100644 (file)
@@ -174,7 +174,6 @@ SimpleNode::SimpleNode(SimpleNode const &node)
   _child_count(node._child_count),
   _cached_positions_valid(node._cached_positions_valid)
 {
-    _document = NULL;
     _document = NULL;
     _parent = _next = NULL;
     _first_child = _last_child = NULL;
@@ -182,7 +181,7 @@ SimpleNode::SimpleNode(SimpleNode const &node)
     for ( Node *child = node._first_child ;
           child != NULL ; child = child->next() )
     {
-        Node *child_copy=child->duplicate();
+        Node *child_copy=child->duplicate(NULL); // FIXME
 
         child_copy->_setParent(this);
         if (_last_child) {
@@ -591,12 +590,12 @@ void SimpleNode::mergeFrom(Node const *src, gchar const *key) {
             if (rch) {
                 rch->mergeFrom(child, key);
             } else {
-                rch = child->duplicate();
+                rch = child->duplicate(_document);
                 appendChild(rch);
                 rch->release();
             }
         } else {
-            Node *rch=child->duplicate();
+            Node *rch=child->duplicate(_document);
             appendChild(rch);
             rch->release();
         }