[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Tue Mar 23 05:08:09 UTC 2004


CVS commit by okellogg: 

updateAssociations(): Remove the special-casing of at_Generalization,
multiple generalization arrows actually exhibit less crossing this way.


  M +4 -25     associationwidget.cpp   1.88


--- kdesdk/umbrello/umbrello/associationwidget.cpp  #1.87:1.88
@@ -1157,17 +1157,10 @@ void AssociationWidget::doUpdates(int ot
                 updateRegionLineCount( regionCount - 1, regionCount, region, role );
                 updateAssociations( totalCount - 1, oldRegion, role );
-                updateAssociations( regionCount, region, role );
         } else if( totalCount != regionCount ) {
                 updateRegionLineCount( regionCount - 1, regionCount, region, role );
-                updateAssociations( regionCount, region, role );
         } else {
                 updateRegionLineCount( m_role[role].m_nIndex, totalCount, region, role );
-                /*
-                 * This update does not seem to be required after all.
-                 * Nevertheless, if you experience strange crossed lines,
-                 * try uncommenting the following:
-                 */
-                // updateAssociations( totalCount, region, role );
         }
+        updateAssociations( regionCount, region, role );
 }
 
@@ -2554,16 +2547,6 @@ void AssociationWidget::updateAssociatio
         while ( (assocwidget = assoc_it.current()) ) {
                 ++assoc_it;
-                WidgetRole *roleA;
-                WidgetRole *roleB;
-                if (assocwidget->getAssocType() == at_Generalization) {
-                        // For generalizations, the general class plays role A
-                        // and the specialized class plays role B.
-                        // Let's swap the roles to simplify the following logic.
-                        roleA = &assocwidget->m_role[B];
-                        roleB = &assocwidget->m_role[A];
-                } else {
-                        roleA = &assocwidget->m_role[A];
-                        roleB = &assocwidget->m_role[B];
-                }
+                WidgetRole *roleA = &assocwidget->m_role[A];
+                WidgetRole *roleB = &assocwidget->m_role[B];
                 UMLWidget *wA = roleA->m_pWidget;
                 UMLWidget *wB = roleB->m_pWidget;
@@ -2582,9 +2565,5 @@ void AssociationWidget::updateAssociatio
                 for (AssociationWidget* assocwidget2 = ordered.first(); assocwidget2;
                      assocwidget2 = ordered.next()) {
-                        UMLWidget * otherWidget;
-                        if (assocwidget2->getAssocType() == at_Generalization)
-                                otherWidget = assocwidget2->m_role[role].m_pWidget;
-                        else
-                                otherWidget = assocwidget2->m_role[other].m_pWidget;
+                        UMLWidget * otherWidget = assocwidget2->m_role[other].m_pWidget;
                         if (ownWidget == otherWidget) {
 #ifdef DEBUG_ASSOCLINES






More information about the umbrello-devel mailing list