[Uml-devel] kdesdk/umbrello/umbrello/diagram

Luis De la Parra Blum lparrab at gmx.net
Thu Apr 3 14:54:08 UTC 2003


CVS commit by luis: 

remove the remaining min() and max() functions.
use kMin and kMax instead


  M +3 -5      actorwidget.cpp   1.4
  M +0 -1      classwidget.cpp   1.12
  M +4 -7      diagramelement.cpp   1.7
  M +0 -2      diagramview.cpp   1.8


--- kdesdk/umbrello/umbrello/diagram/diagramview.cpp  #1.7:1.8
@@ -37,6 +37,4 @@ namespace
         const long Selecting = 0x01;
         const long CreatingAssociation = 0x01<<1;
-        int min(int a, int b) { return (a<b?a:b);}
-        int max(int a, int b) { return (a>b?a:b);}
 }
 

--- kdesdk/umbrello/umbrello/diagram/diagramelement.cpp  #1.6:1.7
@@ -20,7 +20,4 @@
 #include <qpopupmenu.h>
 
-//anonymous namespace for file-only data
-float min( float a, float b ) { return a < b ? a: b;}
-float max( float a, float b ) { return a > b ? a: b;}
 
 
@@ -91,5 +88,5 @@ void DiagramElement::moveToForeground()
         for( it = l.begin() ; it != l.end() ; ++it )
         {
-                maxZ = max(maxZ, (*it)->z());
+                maxZ = kMax(maxZ, (*it)->z());
         }
         kdDebug()<<"max z is "<<maxZ<<endl;
@@ -117,5 +114,5 @@ void DiagramElement::moveToBackground()
         for( it = l.begin() ; it != l.end() ; ++it )
         {
-                minZ = min(minZ, (*it)->z());
+                minZ = kMin(minZ, (*it)->z());
         }
         kdDebug()<<"min z is "<<minZ<<endl;
@@ -145,5 +142,5 @@ void DiagramElement::raise()
                 if((*it)->z() > z() )
                 {
-                        next = min(next, (*it)->z());
+                        next = kMin(next, (*it)->z());
                 }
         }
@@ -174,5 +171,5 @@ void DiagramElement::lower()
                 if((*it)->z() < z() )
                 {
-                        prev = max(prev, (*it)->z());
+                        prev = kMax(prev, (*it)->z());
                 }
         }

--- kdesdk/umbrello/umbrello/diagram/classwidget.cpp  #1.11:1.12
@@ -38,5 +38,4 @@
 // unnamed namespace : data for this file only
 namespace{
- int max(int a, int b) { return a>b?a:b; }
  //vertical and horizontal margins
  int vMargin = 10;

--- kdesdk/umbrello/umbrello/diagram/actorwidget.cpp  #1.3:1.4
@@ -3,4 +3,5 @@
 #include "actorwidget.h"
 #include <qapplication.h>
+#include <kglobal.h>
 #include <kdebug.h>
 #include <qpainter.h>
@@ -11,7 +12,4 @@
 // unnamed namespace : data for this file only
 namespace{
- 
- int max(int a, int b) { return a>b?a:b; };
- 
  //vertical and horizontal margins
  int vMargin = 10;
@@ -105,6 +103,6 @@ int currentWidth = 0;
         
 currentWidth = fm.width(m_name);
-maxWidth = max(maxWidth,currentWidth);  
-maxWidth = max(maxWidth, actorWidth);
+maxWidth = kMax(maxWidth,currentWidth); 
+maxWidth = kMax(maxWidth, actorWidth);
 
 m_width = maxWidth + (2*hMargin);






More information about the umbrello-devel mailing list