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

Oliver Kellogg okellogg at users.sourceforge.net
Sat Apr 14 13:43:17 UTC 2007


SVN commit 653883 by okellogg:

pasteClip4(): Don't UMLView::addWidget(widget) if widget already exists there.

 M  +9 -4      umlclipboard.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/clipboard/umlclipboard.cpp #653882:653883
@@ -503,11 +503,16 @@
     while ( (widget=widget_it.current()) != 0 ) {
         ++widget_it;
 
-        if (currentView->findWidget(idchanges->findNewID(widget->getID()))) {
+        Uml::IDType oldId = widget->getID();
+        Uml::IDType newId = idchanges->findNewID(oldId);
+        if (currentView->findWidget(newId)) {
+            kError() << "UMLClipboard::pasteClip4: widget (oldID=" << ID2STR(oldId)
+                << ", newID=" << ID2STR(newId) << ") already exists in target view."
+                << endl;
+            widgets.remove(widget);
+            delete widget;
             objectAlreadyExists = true;
-        }
-
-        if ( !currentView->addWidget(widget, true) ) {
+        } else if (! currentView->addWidget(widget, true)) {
             currentView->endPartialWidgetPaste();
             return false;
         }




More information about the umbrello-devel mailing list