[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Tue Oct 28 00:17:03 UTC 2003


CVS commit by okellogg: 

createAutoAssociations(): Check that the assoc is allowed.


  M +12 -4     umlview.cpp   1.108


--- kdesdk/umbrello/umbrello/umlview.cpp  #1.107:1.108
@@ -574,5 +574,4 @@ void UMLView::slotObjectRemoved(UMLObjec
 
                 // Following lines temporarily commented out due to crashes.
-                // I will look into this  -- okellogg  2003-09-02
                 /* Update list; removing a widget will also delete the associations
                  * connected to it; so we have to update the list, because other
@@ -2363,6 +2362,8 @@ void UMLView::createAutoAssociations( UM
         //   for each of the UMLCanvasObject's UMLAssociations
         //     if umlassoc's "other" role has a widget representation on this view then
+        //       if the assoc type is permitted in the current diagram type then
         //       create the AssocWidget
         //     end if
+        //     end if
         //   end loop
         // end if
@@ -2414,7 +2415,14 @@ void UMLView::createAutoAssociations( UM
                         continue;
                 // Both objects are represented in this view:
+                // Check that the assoc is allowed.
+                Uml::Association_Type assocType = assoc->getAssocType();
+                if (!AssocRules::allowAssociation(assocType, widget, pOtherWidget)) {
+                        kdDebug() << "createAutoAssociations: not transferring assoc "
+                                  << "of type " << assocType << endl;
+                        continue;
+                }
                 // Create the AssociationWidget.
-                AssociationWidget * temp = new AssociationWidget( this, widget ,
-                                                assoc->getAssocType(), pOtherWidget );
+                AssociationWidget * temp = new AssociationWidget( this, widget,
+                                                             assocType, pOtherWidget );
                 if (! addAssociation(temp))
                         delete temp;






More information about the umbrello-devel mailing list