From fb9b208ae9b22e8ced331f4d4e20392c9bc1357b Mon Sep 17 00:00:00 2001 From: Thomas Holder Date: Wed, 16 Oct 2019 13:07:35 +0200 Subject: Inkscape::XML::Node::addChildAtPos --- src/xml/simple-node.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/xml/simple-node.cpp') diff --git a/src/xml/simple-node.cpp b/src/xml/simple-node.cpp index b628d678a..47f66ff85 100644 --- a/src/xml/simple-node.cpp +++ b/src/xml/simple-node.cpp @@ -773,21 +773,17 @@ void SimpleNode::mergeFrom(Node const *src, gchar const *key, bool extension, bo Node *rch=sp_repr_lookup_child(this, key, id); if (rch && (!extension || rch->equal(child, false))) { rch->mergeFrom(child, key, extension); + continue; } else { if(rch) { removeChild(rch); } - guint pos = child->position(); - rch = child->duplicate(_document); - appendChild(rch); - rch->setPosition(pos); - rch->release(); } - } else { + } + { guint pos = child->position(); Node *rch=child->duplicate(_document); - appendChild(rch); - rch->setPosition(pos); + addChildAtPos(rch, pos); rch->release(); } } -- cgit v1.2.3