From 8c321049d9587e7a5aa62a4ec84f977bee79c0fb Mon Sep 17 00:00:00 2001 From: blacksun Date: Wed, 26 Nov 2014 22:44:33 +0000 Subject: [PATCH] Bug fix git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3521 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/diagramcommands.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sources/diagramcommands.cpp b/sources/diagramcommands.cpp index ce9a62f25..6af19b773 100644 --- a/sources/diagramcommands.cpp +++ b/sources/diagramcommands.cpp @@ -80,9 +80,13 @@ void DeleteElementsCommand::undo() { foreach(Element *e, removed_content.elements) { diagram -> addItem(e); - //Relink this element with other - foreach (Element *elmt, m_link_hash[e]) - e -> linkToElement(elmt); + } + + //We relink element after every element was added to diagram + foreach(Element *e, removed_content.elements) { + foreach (Element *elmt, m_link_hash[e]) { + e -> linkToElement(elmt); + } } foreach(Conductor *c, removed_content.conductors(DiagramContent::AnyConductor)) {