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

Jonathan Riddell jri at jriddell.org
Tue Feb 10 10:33:38 UTC 2004


CVS commit by jriddell: 

Backport commit from thomas Jan 29 and 30
--
CVS commit by thomas:

bug fix: when floating text block of role belonging to association is
moved, the parent association is recalculated..and it shouldnt
be. Similarly, moving vertice of selected association screws up
floating text box position..and it shouldnt be concerned. Both
problems now fixed


  M +20 -2     umlwidget.cpp   1.70.2.1
  M +8 -0      umlwidget.h   1.24.2.1


--- kdesdk/umbrello/umbrello/umlwidget.cpp  #1.70:1.70.2.1
@@ -279,5 +279,6 @@ void UMLWidget::mouseMoveEvent(QMouseEve
                         calls_to_calc_head = 0;
 #endif
-                        adjustAssocs(newX, newY);
+                        //adjustAssocs(newX, newY);
+                        adjustUnselectedAssocs(newX, newY);
 #ifdef DEBUG_ASSOCLINES
                         kdDebug() << "calls_to_calc_head = " << calls_to_calc_head << endl;
@@ -391,6 +392,12 @@ void UMLWidget::mouseReleaseEvent(QMouse
                 // Adjust assoc lines again - when the widget is moved around
                 // quickly the lastUpdate timer may have not yet fired.
-                adjustAssocs( getX(), getY() );
+                //
+                // COMMENT: I *dont* think the full adjustAssocs is needed. It certainly screws
+                // up the display when a role floating text box belonging to that assoc
+                // is moved.  Ithink  its best to do noting here. -b.t.
 
+                // adjustUnselectedAssocs( getX(), getY() );
+
+                // BUT DO do this..so that if we quit right now, we are asked to save
                 m_pView->getDocument()->setModified(true);
         }
@@ -712,4 +719,15 @@ void UMLWidget::adjustAssocs(int x, int 
 }
 
+void UMLWidget::adjustUnselectedAssocs(int x, int y)
+{
+        AssociationWidgetListIt assoc_it(m_Assocs);
+        AssociationWidget* assocwidget = 0;
+        while((assocwidget=assoc_it.current())) {
+                ++assoc_it;
+                if(!assocwidget->getSelected())
+                        assocwidget->widgetMoved(this, x, y);
+        }
+}
+
 void UMLWidget::startPopupMenu(QPoint At) {
         slotRemovePopupMenu();

--- kdesdk/umbrello/umbrello/umlwidget.h  #1.24:1.24.2.1
@@ -510,4 +510,12 @@ public:
 
         /**
+         * Adjusts all unselected associations with the given co-ordinates
+         *
+         * @param x The x-coordinate.
+         * @param y The y-coordinate.
+         */
+        void adjustUnselectedAssocs(int x, int y); 
+
+        /**
          * Set the m_bActivated flag of a widget but does not perform the Activate method
          *






More information about the umbrello-devel mailing list