[Uml-devel] KDE/kdesdk/umbrello/umbrello/clipboard

Ralf Habacker ralf.habacker at gmail.com
Mon Jan 16 10:18:34 UTC 2012


SVN commit 1273895 by habacker:

Fixed copy & pasting of elements in activity and state diagrams.

CCBUG: 291557

 M  +6 -1      umlclipboard.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/clipboard/umlclipboard.cpp #1273894:1273895
@@ -568,17 +568,22 @@
 
         Uml::IDType oldId = widget->id();
         Uml::IDType newId = idchanges->findNewID(oldId);
+        // how should findWidget find ::None id, which is returned for the first entry ?
         if (currentView->findWidget(newId)) {
             uError() << "widget (oldID=" << ID2STR(oldId) << ", newID="
                 << ID2STR(newId) << ") already exists in target view.";
             widgets.removeAll(widget);
             delete widget;
             objectAlreadyExists = true;
-        } else if (! currentView->addWidget(widget, true)) {
+        } else {
+            if (currentView->type() == Uml::DiagramType::Activity || currentView->type() == Uml::DiagramType::State)
+                widget->setID(doc->assignNewID(widget->id()));
+            if (! currentView->addWidget(widget, true)) {
             currentView->endPartialWidgetPaste();
             return false;
         }
     }
+    }
 
     //now paste the associations
     foreach ( AssociationWidget* assoc, assocs ) {




More information about the umbrello-devel mailing list