Bug 147202

Summary: Crash when changing the association type to containment
Product: [Applications] umbrello Reporter: Dmitri Fedoruk <dfedoruk>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Dmitri Fedoruk 2007-06-25 15:52:12 UTC
Version:            (using KDE KDE 3.5.6)
Installed from:    Fedora RPMs
OS:                Linux

Umbrello crashes when I have two associated classes and want to change the type of the association. The association is made up automatially when I add an attribute to the second class which is of a type of the first one.

<i>How to reproduce:</i>
1) Create a blank class
2) Create a second blank class
3) Add to the second class an attribute which is an instance of the first class
4) Click on the generated association and change its type to the "Containment".


<i>Backtrace:</i>
[KCrash handler]
#6  0x00000012 in ?? ()
#7  0x081401d6 in DocWindow::updateDocumentation ()
#8  0x0814056d in DocWindow::showDocumentation ()
#9  0x081ccafc in UMLView::showDocumentation ()
#10 0x08110878 in AssociationWidget::showDialog ()
#11 0x08149575 in FloatingTextWidget::slotMenuSelection ()
#12 0x0818bb04 in ToolBarStateArrow::mouseDoubleClickWidget ()
#13 0x0818b6df in ToolBarState::mouseDoubleClick ()
#14 0x465ae471 in QScrollView::viewportMouseDoubleClickEvent ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#15 0x465ac011 in QScrollView::eventFilter ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#16 0x4647d0cc in QObject::activate_filters ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#17 0x4647d14b in QObject::event () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#18 0x464ba01c in QWidget::event () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#19 0x4641453b in QApplication::internalNotify ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#20 0x46415d09 in QApplication::notify ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#21 0x46bf7932 in KApplication::notify () from /usr/lib/libkdecore.so.4
#22 0x463ab996 in QETWidget::translateMouseEvent ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#23 0x463aa766 in QApplication::x11ProcessEvent ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#24 0x463bc38b in QEventLoop::processEvents ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#25 0x4642de30 in QEventLoop::enterLoop ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#26 0x4642dce6 in QEventLoop::exec () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#27 0x4641417f in QApplication::exec () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#28 0x081657d7 in main ()
Comment 1 Oliver Kellogg 2007-06-27 06:49:37 UTC
SVN commit 680735 by okellogg:

mouseReleaseEvent(): Temporarily disallow ListPopupMenu for m_pObject types
other than Uml::ot_Association until somebody finds time to implement that.
Implementation would require certain controls in AssocPropDlg to be made
read-only for non-ot_Association types of m_pObject.

BUG:147202


 M  +1 -0      ChangeLog  
 M  +2 -0      umbrello/associationwidget.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #680734:680735
@@ -6,6 +6,7 @@
 * Crash when linking to undefined xmi.id (146748)
 * End Activity Symbol gets invalid when line thickness is increased (146925)
 * The size of a fork/join is not restored (147069)
+* Crash when changing the association type to containment (147202)
 
 Version 1.5.71
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/associationwidget.cpp #680734:680735
@@ -2244,6 +2244,8 @@
         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)));
Comment 2 Oliver Kellogg 2007-07-05 01:05:40 UTC
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,