Summary: | using a containment will crash umbrello | ||
---|---|---|---|
Product: | [Applications] umbrello | Reporter: | Leo Blommers <lblommers> |
Component: | general | Assignee: | Umbrello Development Group <umbrello-devel> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | 1.3.2 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Leo Blommers
2004-12-09 10:35:46 UTC
*** 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; |