[Uml-devel] [Bug 147202] Crash when changing the association type to containment

Oliver Kellogg okellogg at users.sourceforge.net
Wed Jul 4 23:05:41 UTC 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=147202         




------- Additional Comments From okellogg users sourceforge net  2007-07-05 01:05 -------
SVN commit 683558 by okellogg:

ListPopupMenu::mt_AttributeAssociation: New. At least permit deleting the
AssociationWidget representing the attribute association.
(More selections should be added.)
CCBUG:147202


 M  +6 -4      associationwidget.cpp  
 M  +4 -0      listpopupmenu.cpp  
 M  +1 -0      listpopupmenu.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/associationwidget.cpp #683557:683558
 @ -2345,13 +2345,13  @
             menuType = ListPopupMenu::mt_Anchor;
         else if (isCollaboration())
             menuType = ListPopupMenu::mt_Collaboration_Message;
-        else if( AssocRules::allowRole( type ) )
+        else if (getAssociation() == NULL)
+            menuType = ListPopupMenu::mt_AttributeAssociation;
+        else if (AssocRules::allowRole(type))
             menuType = ListPopupMenu::mt_FullAssociation;
         else
             menuType = ListPopupMenu::mt_Association_Selected;
     }
-    if (m_pObject && getAssociation() == NULL)  // atm m_pObject must be UMLAssociation
-        return;                  //  todo allow ListPopupMenu for other m_pObject types
     m_pMenu = new ListPopupMenu(m_pView, menuType);
     m_pMenu->popup(me -> globalPos());
     connect(m_pMenu, SIGNAL(activated(int)), this, SLOT(slotMenuSelection(int)));
 @ -2418,8 +2418,10  @
     case ListPopupMenu::mt_Delete:
         if (m_pAssocClassLineSel0)
             removeAssocClassLine();
+        else if (getAssociation())
+            m_pView->removeAssocInViewAndDoc(this);
         else
-            m_pView->removeAssocInViewAndDoc(this);
+            m_pView->removeAssoc(this);
         break;
 
     case ListPopupMenu::mt_Rename_MultiA:
--- trunk/KDE/kdesdk/umbrello/umbrello/listpopupmenu.cpp #683557:683558
 @ -1404,6 +1404,10  @
         insertStdItem(mt_Properties);
         break;
 
+    case mt_AttributeAssociation:
+        insertStdItem(mt_Delete);  //  todo add more items
+        break;
+
     case mt_Collaboration_Message:
         //                      insertStdItem(mt_Cut);
         //                      insertStdItem(mt_Copy);
--- trunk/KDE/kdesdk/umbrello/umbrello/listpopupmenu.h #683557:683558
 @ -156,6 +156,7  @
         mt_MultiB,
         mt_Name,                          //Association name
         mt_FullAssociation,                 // Association with role names
+        mt_AttributeAssociation,   // Rendering of an attribute as an association
         mt_RoleNameA,
         mt_RoleNameB,
         mt_Delete_Selection,




More information about the umbrello-devel mailing list