Version: 1.3.2 (using KDE KDE 3.3.2) Installed from: SuSE RPMs OS: Linux Create two classes, and add a containment relationship. Next remove the containment relationship. The class list still shows the relationship. If you now try to make a new containment relationship between the two classes umbrello will crash.
*** This bug has been confirmed by popular vote. ***
CVS commit by okellogg: slotMenuSelection(mt_Delete): In case of a containment, determine the new parent in the list view. BUG:94728 M +31 -5 associationwidget.cpp 1.134 --- kdesdk/umbrello/umbrello/associationwidget.cpp #1.133:1.134 @@ -12,7 +12,14 @@ * * ***************************************************************************/ + +// own header +#include "associationwidget.h" +// system includes #include <cstdlib> #include <cmath> - +// qt/kde includes +#include <kdebug.h> +#include <klocale.h> +// app includes #include "activitywidget.h" #include "uml.h" @@ -26,5 +33,4 @@ #include "attribute.h" #include "association.h" -#include "associationwidget.h" #include "assocrules.h" #include "floatingtext.h" @@ -33,7 +39,6 @@ #include "dialogs/assocpropdlg.h" #include "inputdialog.h" - -#include <kdebug.h> -#include <klocale.h> +#include "umllistview.h" +#include "umllistviewitem.h" using namespace Uml; @@ -2101,4 +2106,25 @@ void AssociationWidget::slotMenuSelectio case ListPopupMenu::mt_Delete: + if (getAssocType() == at_Containment) { + UMLListView *lv = UMLApp::app()->getListView(); + UMLObject *oldContainer = getWidget(A)->getUMLObject(); + UMLObject *objToBeMoved = getWidget(B)->getUMLObject(); + if (objToBeMoved == NULL) { + m_pView->removeAssocInViewAndDoc(this); + return; + } + UMLListViewItem *newLVParent = NULL; + if (oldContainer) { + UMLListViewItem *oldLVParent = lv->findUMLObject(oldContainer); + if (oldLVParent) + newLVParent = dynamic_cast<UMLListViewItem*>(oldLVParent->parent()); + } + if (newLVParent == NULL) + newLVParent = lv->theLogicalView(); + Object_Type ot = objToBeMoved->getBaseType(); + lv->moveObject( objToBeMoved->getID(), + UMLListView::convert_OT_LVT(ot), + newLVParent ); + } m_pView->removeAssocInViewAndDoc(this); break;