[Uml-devel] branches/work/soc-umbrello

Gopala Krishna A krishna.ggk at gmail.com
Sat Aug 30 11:08:27 UTC 2008


SVN commit 854814 by gopala:

Merged revisions 854787 via svnmerge from 
svn+ssh://svn.kde.org/home/kde/trunk/KDE/kdesdk/umbrello

........
  r854787 | okellogg | 2008-08-30 15:53:08 +0530 (Sat, 30 Aug 2008) | 2 lines
  
  getAssocLineRectangle(): Do computation of pen_width outside loop.
........


 _M            . (directory)  
 M  +8 -9      umbrello/associationwidget.cpp  


** branches/work/soc-umbrello #property svnmerge-integrated
   - /trunk/KDE/kdesdk/umbrello:1-854015,854687
   + /trunk/KDE/kdesdk/umbrello:1-854015,854687,854787
--- branches/work/soc-umbrello/umbrello/associationwidget.cpp #854813:854814
@@ -3248,16 +3248,20 @@
 QRectF AssociationWidget::getAssocLineRectangle()
 {
     QRectF rectangle;
-    QPointF p;
-    uint pen_width;
 
     /* we also want the end points connected to the other widget */
     int pos = m_LinePath.count();
 
+    /* the lines have the width of the pen */
+    uint pen_width = m_LinePath.getPen().width();
+
+    if (pen_width == 0)
+        pen_width = 1; // width must be at least 1
+
     /* go through all points on the linepath */
-    for( int i=0 ; i < (int) pos; i++ )
+    for (int i = 0; i < pos; i++)
     {
-        p = m_LinePath.getPoint( i );
+        QPointF p = m_LinePath.getPoint(i);
 
         /* the first point is our starting point */
         if (i == 0) {
@@ -3265,11 +3269,6 @@
             continue;
         }
 
-        /* the lines have the width of the pen */
-        pen_width = m_LinePath.getPen().width();
-        if (pen_width == 0)
-            pen_width = 1; // width must be at least 1
-
         if (p.x() < rectangle.x())
             rectangle.setX(p.x());
         if (p.y() < rectangle.y())




More information about the umbrello-devel mailing list