Skip to content
Snippets Groups Projects
Commit 376a40c0 authored by Martin Owens's avatar Martin Owens :coffee: Committed by Martin Owens
Browse files

DeReverse the order of attributes when duplicating nodes

Fixes #1179
parent 38d22c43
No related branches found
No related tags found
Loading
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment