// ...
if (valid)
{
// Now copy the source branch to the destination branch.
if (move_dont_copy)
{
GeListNode* node = branch_src.head->GetFirst();
if (node)
{
if (doc_src) doc_src->AddUndo(UNDOTYPE_DELETE, node);
if (doc_dst) doc_dst->AddUndo(UNDOTYPE_NEW, node);
node->Remove(); // <--------------------- HERE
branch_dst.head->InsertLast(node);
}
}
else
{
if (doc_dst)
doc_dst->AddUndo(UNDOTYPE_CHANGE, branch_dst.head);
branch_src.head->CopyTo(branch_dst.head, flags, at);
}
break;
}
This is due to a bug in
CopyBranchesTo()
: