[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Thu Oct 30 12:08:04 UTC 2003


CVS commit by okellogg: 

Fix beastie 66848 (deleting message in seq.diagram caused crash.)


  M +4 -3      messagewidget.cpp   1.23
  M +5 -2      umlview.cpp   1.110
  M +2 -1      umlview.h   1.43


--- kdesdk/umbrello/umbrello/messagewidget.cpp  #1.22:1.23
@@ -248,7 +248,8 @@ bool MessageWidget::contains(ObjectWidge
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 void MessageWidget::slotMenuSelection(int sel) {
-        if(sel == ListPopupMenu::mt_Delete)
-                m_pView -> removeWidget(this);//this will cleanup this widget and the text widget
-        else
+        if(sel == ListPopupMenu::mt_Delete) {
+                // This will clean up this widget and the text widget:
+                m_pView -> removeWidget(this, true);
+        } else
                 m_pFText -> slotMenuSelection(sel);
 }

--- kdesdk/umbrello/umbrello/umlview.cpp  #1.109:1.110
@@ -851,5 +851,5 @@ AssociationWidget * UMLView::findAssocWi
 }
 ////////////////////////////////////////////////////////////////////////////////////////////////////
-void UMLView::removeWidget(UMLWidget * o) {
+void UMLView::removeWidget(UMLWidget * o, bool isMessage /*=false*/) {
         if(!o)
                 return;
@@ -870,4 +870,7 @@ void UMLView::removeWidget(UMLWidget * o
         disconnect( this, SIGNAL( sigClearAllSelected() ), o, SLOT( slotClearAllSelected() ) );
         disconnect( this, SIGNAL(sigColorChanged(int)), o, SLOT(slotColorChanged(int)));
+        if (isMessage)
+                m_MessageList.remove(static_cast<MessageWidget*>(o));
+        else
         m_WidgetList.remove(o);
         delete o;

--- kdesdk/umbrello/umbrello/umlview.h  #1.42:1.43
@@ -399,6 +399,7 @@ public:
          *
          * @param o             The widget to remove.
+         * @param isMessage     Set to true when invoking on a MessageWidget.
          */
-        void removeWidget(UMLWidget * o);
+        void removeWidget(UMLWidget * o, bool isMessage = false);
 
         /**






More information about the umbrello-devel mailing list