[Uml-devel] KDE_3_2_BRANCH: kdesdk/umbrello/umbrello

Jonathan Riddell jri at jriddell.org
Sat Mar 27 13:43:04 UTC 2004


CVS commit by jriddell: 

backport commit from Tue Mar 23 13:08:56 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.80.2.7


--- kdesdk/umbrello/umbrello/associationwidget.cpp  #1.80.2.6:1.80.2.7
@@ -1205,17 +1205,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 );
 }
 
@@ -2602,16 +2595,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;
@@ -2630,9 +2613,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