[Uml-devel] kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Thu Dec 9 15:32:09 UTC 2004
CVS commit by okellogg:
Move containment association deletion logic to UMLView::removeAssocInViewAndDoc().
M +0 -23 associationwidget.cpp 1.135
M +16 -2 umlview.cpp 1.194
--- kdesdk/umbrello/umbrello/associationwidget.cpp #1.134:1.135
@@ -39,6 +39,4 @@
#include "dialogs/assocpropdlg.h"
#include "inputdialog.h"
-#include "umllistview.h"
-#include "umllistviewitem.h"
using namespace Uml;
@@ -2106,25 +2104,4 @@ 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;
--- kdesdk/umbrello/umbrello/umlview.cpp #1.193:1.194
@@ -1954,6 +1954,20 @@ void UMLView::removeAssocInViewAndDoc(As
if(!a)
return;
+ if (a->getAssocType() == at_Containment) {
+ UMLObject *objToBeMoved = a->getWidget(B)->getUMLObject();
+ if (objToBeMoved != NULL) {
+ UMLListView *lv = UMLApp::app()->getListView();
+ Object_Type ot = objToBeMoved->getBaseType();
+ lv->moveObject( objToBeMoved->getID(),
+ UMLListView::convert_OT_LVT(ot),
+ lv->theLogicalView() );
+ } else {
+ kdDebug() << "UMLDoc::removeAssociation(containment): "
+ << "objB is NULL" << endl;
+ }
+ } else {
// Remove assoc in doc.
m_pDoc->removeAssociation(a->getAssociation());
+ }
// Remove assoc in view.
removeAssoc(a);
More information about the umbrello-devel
mailing list