Commit 376a40c0 authored by Martin Owens's avatar Martin Owens 🤖 Committed by Martin Owens

DeReverse the order of attributes when duplicating nodes

Fixes #1179
parent 38d22c43
......@@ -213,8 +213,18 @@ SimpleNode::SimpleNode(SimpleNode const &node, Document *document)
child_copy->release(); // release to avoid a leak
}
// We need to keep the order of the attributes that we duplicate
// and for now, we do that by duplicating the list twice.
List<AttributeRecord const> _temp;
for ( List<AttributeRecord const> iter = node._attributes ;
iter ; ++iter )
{
_temp = cons(*iter, _temp);
}
// At this point temp is an up-sidedown list of attributes, put them
// back in the right way now.
for ( List<AttributeRecord const> iter = _temp ;
iter ; ++iter )
{
_attributes = cons(*iter, _attributes);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment