[QGIS Commit] r14713 - in trunk/qgis/src: analysis/interpolation analysis/raster app app/legend core core/composer core/raster core/renderer core/spatialindex/geometry core/spatialindex/rtree core/spatialindex/tools core/symbology-ng gui mapserver plugins/dxf2shp_converter/dxflib/src plugins/georeferencer plugins/grass plugins/grass/qtermwidget plugins/point_displacement_renderer providers/grass providers/wms

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Nov 19 02:51:19 EST 2010


Author: jef
Date: 2010-11-18 23:51:19 -0800 (Thu, 18 Nov 2010)
New Revision: 14713

Modified:
   trunk/qgis/src/analysis/interpolation/CloughTocherInterpolator.cc
   trunk/qgis/src/analysis/interpolation/DualEdgeTriangulation.cc
   trunk/qgis/src/analysis/interpolation/MathUtils.cc
   trunk/qgis/src/analysis/interpolation/MathUtils.h
   trunk/qgis/src/analysis/interpolation/Point3D.h
   trunk/qgis/src/analysis/interpolation/Vector3D.h
   trunk/qgis/src/analysis/raster/qgsrastermatrix.cpp
   trunk/qgis/src/app/legend/qgslegend.cpp
   trunk/qgis/src/app/qgsdisplayangle.cpp
   trunk/qgis/src/app/qgslabeldialog.cpp
   trunk/qgis/src/app/qgsmaptoolmeasureangle.cpp
   trunk/qgis/src/app/qgsmaptoolnodetool.cpp
   trunk/qgis/src/app/qgsmaptoolsimplify.cpp
   trunk/qgis/src/app/qgspointrotationitem.cpp
   trunk/qgis/src/app/qgsvectorlayerproperties.cpp
   trunk/qgis/src/core/composer/qgscomposerarrow.cpp
   trunk/qgis/src/core/composer/qgscomposeritem.cpp
   trunk/qgis/src/core/composer/qgscomposerlegend.cpp
   trunk/qgis/src/core/composer/qgscomposermap.cpp
   trunk/qgis/src/core/composer/qgscomposerpicture.cpp
   trunk/qgis/src/core/qgscoordinatereferencesystem.cpp
   trunk/qgis/src/core/qgsdistancearea.cpp
   trunk/qgis/src/core/qgsmaprenderer.cpp
   trunk/qgis/src/core/qgspallabeling.cpp
   trunk/qgis/src/core/qgspoint.cpp
   trunk/qgis/src/core/qgsrectangle.cpp
   trunk/qgis/src/core/qgsscalecalculator.cpp
   trunk/qgis/src/core/qgssearchtreenode.cpp
   trunk/qgis/src/core/qgstolerance.cpp
   trunk/qgis/src/core/qgsvectorlayer.cpp
   trunk/qgis/src/core/raster/qgscolorrampshader.cpp
   trunk/qgis/src/core/raster/qgsrasterlayer.cpp
   trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp
   trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp
   trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp
   trunk/qgis/src/core/spatialindex/geometry/LineSegment.cc
   trunk/qgis/src/core/spatialindex/geometry/Region.cc
   trunk/qgis/src/core/spatialindex/rtree/Index.cc
   trunk/qgis/src/core/spatialindex/rtree/Node.cc
   trunk/qgis/src/core/spatialindex/rtree/RTree.cc
   trunk/qgis/src/core/spatialindex/tools/ExternalSort.cc
   trunk/qgis/src/core/spatialindex/tools/Tools.cc
   trunk/qgis/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
   trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.cpp
   trunk/qgis/src/gui/qgsannotationitem.cpp
   trunk/qgis/src/gui/qgsmapcanvas.cpp
   trunk/qgis/src/mapserver/qgssldrule.cpp
   trunk/qgis/src/mapserver/qgswmsserver.cpp
   trunk/qgis/src/plugins/dxf2shp_converter/dxflib/src/dl_dxf.cpp
   trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.cpp
   trunk/qgis/src/plugins/georeferencer/qgsgeoreftransform.cpp
   trunk/qgis/src/plugins/georeferencer/qgsimagewarper.cpp
   trunk/qgis/src/plugins/georeferencer/qgsleastsquares.cpp
   trunk/qgis/src/plugins/georeferencer/qgsresidualplotitem.cpp
   trunk/qgis/src/plugins/grass/qgsgrassedit.cpp
   trunk/qgis/src/plugins/grass/qgsgrassnewmapset.cpp
   trunk/qgis/src/plugins/grass/qtermwidget/TerminalDisplay.cpp
   trunk/qgis/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.cpp
   trunk/qgis/src/providers/grass/qgsgrassrasterprovider.cpp
   trunk/qgis/src/providers/wms/qgswmsprovider.cpp
Log:
use Qt macros also for min/max/abs/fabs - removes OSX cmath kludges

Modified: trunk/qgis/src/analysis/interpolation/CloughTocherInterpolator.cc
===================================================================
--- trunk/qgis/src/analysis/interpolation/CloughTocherInterpolator.cc	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/analysis/interpolation/CloughTocherInterpolator.cc	2010-11-19 07:51:19 UTC (rev 14713)
@@ -16,11 +16,8 @@
 
 #include "CloughTocherInterpolator.h"
 #include "qgslogger.h"
-#ifndef Q_OS_MACX
+
 #include <cmath>
-#else
-#include <math.h>
-#endif
 
 double CloughTocherInterpolator::calcBernsteinPoly( int n, int i, int j, int k, double u, double v, double w )
 {

Modified: trunk/qgis/src/analysis/interpolation/DualEdgeTriangulation.cc
===================================================================
--- trunk/qgis/src/analysis/interpolation/DualEdgeTriangulation.cc	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/analysis/interpolation/DualEdgeTriangulation.cc	2010-11-19 07:51:19 UTC (rev 14713)
@@ -383,7 +383,7 @@
         //Take the higher z-Value in case of two equal points
         Point3D* newPoint = mPointVector[mPointVector.count()-1];
         Point3D* existingPoint = mPointVector[mTwiceInsPoint];
-        existingPoint->setZ( std::max( newPoint->getZ(), existingPoint->getZ() ) );
+        existingPoint->setZ( qMax( newPoint->getZ(), existingPoint->getZ() ) );
 
         mPointVector.remove( mPointVector.count() - 1 );
         delete newPoint;

Modified: trunk/qgis/src/analysis/interpolation/MathUtils.cc
===================================================================
--- trunk/qgis/src/analysis/interpolation/MathUtils.cc	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/analysis/interpolation/MathUtils.cc	2010-11-19 07:51:19 UTC (rev 14713)
@@ -205,7 +205,7 @@
     double a = normal.getX();
     double b = normal.getY();
     double c = -( normal.getX() * p2->getX() + normal.getY() * p2->getY() );
-    double distance = fabs(( a * thepoint->getX() + b * thepoint->getY() + c ) / ( sqrt( a * a + b * b ) ) );
+    double distance = qAbs(( a * thepoint->getX() + b * thepoint->getY() + c ) / ( sqrt( a * a + b * b ) ) );
     return distance;
   }
   else
@@ -250,8 +250,8 @@
     double px = testp->getX();
     double py = testp->getY();
 
-    double xmin = min( min( ax, px ), min( bx, cx ) );
-    double ymin = min( min( ay, py ), min( by, cy ) );
+    double xmin = qMin( qMin( ax, px ), qMin( bx, cx ) );
+    double ymin = qMin( qMin( ay, py ), qMin( by, cy ) );
     ax -= xmin;
     bx -= xmin;
     cx -= xmin;
@@ -479,7 +479,7 @@
     return 1;
   }
   double tmp = a;
-  for ( int i = 2; i <= fabs(( double )b ); i++ )
+  for ( int i = 2; i <= qAbs(( double )b ); i++ )
   {
 
     a *= tmp;

Modified: trunk/qgis/src/analysis/interpolation/MathUtils.h
===================================================================
--- trunk/qgis/src/analysis/interpolation/MathUtils.h	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/analysis/interpolation/MathUtils.h	2010-11-19 07:51:19 UTC (rev 14713)
@@ -17,11 +17,7 @@
 #ifndef MATHUTILS_H
 #define MATHUTILS_H
 
-#ifndef Q_OS_MACX
 #include <cmath>
-#else
-#include <math.h>
-#endif
 #include "Vector3D.h"
 #include "Point3D.h"
 

Modified: trunk/qgis/src/analysis/interpolation/Point3D.h
===================================================================
--- trunk/qgis/src/analysis/interpolation/Point3D.h	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/analysis/interpolation/Point3D.h	2010-11-19 07:51:19 UTC (rev 14713)
@@ -17,11 +17,7 @@
 #ifndef POINT3D_H
 #define POINT3D_H
 
-#ifndef Q_OS_MACX
 #include <cmath>
-#else
-#include <math.h>
-#endif
 #include <iostream>
 
 /**Point3D is a class to represent a three dimensional point*/

Modified: trunk/qgis/src/analysis/interpolation/Vector3D.h
===================================================================
--- trunk/qgis/src/analysis/interpolation/Vector3D.h	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/analysis/interpolation/Vector3D.h	2010-11-19 07:51:19 UTC (rev 14713)
@@ -17,11 +17,7 @@
 #ifndef VECTOR3D_H
 #define VECTOR3D_H
 
-#ifndef Q_OS_MACX
 #include <cmath>
-#else
-#include <math.h>
-#endif
 
 class ANALYSIS_EXPORT Vector3D
       /**

Modified: trunk/qgis/src/analysis/raster/qgsrastermatrix.cpp
===================================================================
--- trunk/qgis/src/analysis/raster/qgsrastermatrix.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/analysis/raster/qgsrastermatrix.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -18,18 +18,14 @@
 #include "qgsrastermatrix.h"
 #include <string.h>
 
-#ifndef Q_OS_MACX
 #include <cmath>
-#else
-#include <math.h>
-#endif
 
 QgsRasterMatrix::QgsRasterMatrix(): mColumns( 0 ), mRows( 0 ), mData( 0 )
 {
 }
 
 QgsRasterMatrix::QgsRasterMatrix( int nCols, int nRows, float* data, double nodataValue ):
-  mColumns( nCols ), mRows( nRows ), mData( data ), mNodataValue( nodataValue )
+    mColumns( nCols ), mRows( nRows ), mData( data ), mNodataValue( nodataValue )
 {
 }
 
@@ -163,22 +159,22 @@
 
 bool QgsRasterMatrix::oneArgumentOperation( OneArgOperator op )
 {
-  if( !mData )
+  if ( !mData )
   {
     return false;
   }
 
   int nEntries = mColumns * mRows;
   double value;
-  for( int i = 0; i < nEntries; ++i )
+  for ( int i = 0; i < nEntries; ++i )
   {
     value = mData[i];
-    if( value != mNodataValue )
+    if ( value != mNodataValue )
     {
-      switch( op )
+      switch ( op )
       {
         case opSQRT:
-          if( value < 0 )  //no complex numbers
+          if ( value < 0 ) //no complex numbers
           {
             mData[i] = static_cast<float>( mNodataValue );
           }
@@ -213,15 +209,15 @@
 
 bool QgsRasterMatrix::twoArgumentOperation( TwoArgOperator op, const QgsRasterMatrix& other )
 {
-  if( isNumber() && other.isNumber() )  //operation on two 1x1 matrices
+  if ( isNumber() && other.isNumber() ) //operation on two 1x1 matrices
   {
     //operations with nodata values always generate nodata
-    if( mData[0] == mNodataValue || other.number() == other.nodataValue() )
+    if ( mData[0] == mNodataValue || other.number() == other.nodataValue() )
     {
       mData[0] = static_cast<float>( mNodataValue );
       return true;
     }
-    switch( op )
+    switch ( op )
     {
       case opPLUS:
         mData[0] = static_cast<float>( number() + other.number() );
@@ -233,7 +229,7 @@
         mData[0] = static_cast<float>( number() * other.number() );
         break;
       case opDIV:
-        if( other.number() == 0 )
+        if ( other.number() == 0 )
         {
           mData[0] = static_cast<float>( mNodataValue );
         }
@@ -243,7 +239,7 @@
         }
         break;
       case opPOW:
-        if( !testPowerValidity( mData[0], ( float ) other.number() ) )
+        if ( !testPowerValidity( mData[0], ( float ) other.number() ) )
         {
           mData[0] = static_cast<float>( mNodataValue );
         }
@@ -275,22 +271,22 @@
   }
 
   //two matrices
-  if( !isNumber() && !other.isNumber() )
+  if ( !isNumber() && !other.isNumber() )
   {
     float* matrix = other.mData;
     int nEntries = mColumns * mRows;
     double value1, value2;
 
-    for( int i = 0; i < nEntries; ++i )
+    for ( int i = 0; i < nEntries; ++i )
     {
       value1 = mData[i]; value2 = matrix[i];
-      if( value1 == mNodataValue || value2 == other.mNodataValue )
+      if ( value1 == mNodataValue || value2 == other.mNodataValue )
       {
         mData[i] = static_cast<float>( mNodataValue );
       }
       else
       {
-        switch( op )
+        switch ( op )
         {
           case opPLUS:
             mData[i] = static_cast<float>( value1 + value2 );
@@ -302,7 +298,7 @@
             mData[i] = static_cast<float>( value1 * value2 );
             break;
           case opDIV:
-            if( value2 == 0 )
+            if ( value2 == 0 )
             {
               mData[i] = static_cast<float>( mNodataValue );
             }
@@ -312,7 +308,7 @@
             }
             break;
           case opPOW:
-            if( !testPowerValidity( value1, value2 ) )
+            if ( !testPowerValidity( value1, value2 ) )
             {
               mData[i] = static_cast<float>( mNodataValue );
             }
@@ -346,7 +342,7 @@
   }
 
   //this matrix is a single number and the other one a real matrix
-  if( isNumber() )
+  if ( isNumber() )
   {
     float* matrix = other.mData;
     int nEntries = other.nColumns() * other.nRows();
@@ -355,24 +351,24 @@
     mData = new float[nEntries]; mColumns = other.nColumns(); mRows = other.nRows();
     mNodataValue = other.nodataValue();
 
-    if( value == mNodataValue )
+    if ( value == mNodataValue )
     {
-      for( int i = 0; i < nEntries; ++i )
+      for ( int i = 0; i < nEntries; ++i )
       {
         mData[i] = static_cast<float>( mNodataValue );
       }
       return true;
     }
 
-    for( int i = 0; i < nEntries; ++i )
+    for ( int i = 0; i < nEntries; ++i )
     {
-      if( matrix[i] == other.mNodataValue )
+      if ( matrix[i] == other.mNodataValue )
       {
         mData[i] = static_cast<float>( mNodataValue );
         continue;
       }
 
-      switch( op )
+      switch ( op )
       {
         case opPLUS:
           mData[i] = static_cast<float>( value + matrix[i] );
@@ -384,7 +380,7 @@
           mData[i] = static_cast<float>( value * matrix[i] );
           break;
         case opDIV:
-          if( matrix[i] == 0 )
+          if ( matrix[i] == 0 )
           {
             mData[i] = static_cast<float>( mNodataValue );
           }
@@ -394,7 +390,7 @@
           }
           break;
         case opPOW:
-          if( !testPowerValidity( value, matrix[i] ) )
+          if ( !testPowerValidity( value, matrix[i] ) )
           {
             mData[i] = static_cast<float>( mNodataValue );
           }
@@ -430,23 +426,23 @@
     double value = other.number();
     int nEntries = mColumns * mRows;
 
-    if( other.number() == other.mNodataValue )
+    if ( other.number() == other.mNodataValue )
     {
-      for( int i = 0; i < nEntries; ++i )
+      for ( int i = 0; i < nEntries; ++i )
       {
         mData[i] = static_cast<float>( mNodataValue );
       }
       return true;
     }
 
-    for( int i = 0; i < nEntries; ++i )
+    for ( int i = 0; i < nEntries; ++i )
     {
-      if( mData[i] == mNodataValue )
+      if ( mData[i] == mNodataValue )
       {
         continue;
       }
 
-      switch( op )
+      switch ( op )
       {
         case opPLUS:
           mData[i] = static_cast<float>( mData[i] + value );
@@ -458,7 +454,7 @@
           mData[i] = static_cast<float>( mData[i] * value );
           break;
         case opDIV:
-          if( value == 0 )
+          if ( value == 0 )
           {
             mData[i] = static_cast<float>( mNodataValue );
           }
@@ -468,7 +464,7 @@
           }
           break;
         case opPOW:
-          if( !testPowerValidity( mData[i], value ) )
+          if ( !testPowerValidity( mData[i], value ) )
           {
             mData[i] = static_cast<float>( mNodataValue );
           }
@@ -503,7 +499,7 @@
 
 bool QgsRasterMatrix::testPowerValidity( double base, double power )
 {
-  if(( base == 0 && power < 0 ) || ( power < 0 && ( power - floor( power ) ) > 0 ) )
+  if (( base == 0 && power < 0 ) || ( power < 0 && ( power - floor( power ) ) > 0 ) )
   {
     return false;
   }

Modified: trunk/qgis/src/app/legend/qgslegend.cpp
===================================================================
--- trunk/qgis/src/app/legend/qgslegend.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/app/legend/qgslegend.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -1688,7 +1688,7 @@
     QgsDebugMsg( "Raster units per pixel  : " + QString::number( layer->rasterUnitsPerPixel() ) );
     QgsDebugMsg( "MapUnitsPerPixel before : " + QString::number( mMapCanvas->mapUnitsPerPixel() ) );
 
-    mMapCanvas->zoomByFactor( fabs( layer->rasterUnitsPerPixel() / mMapCanvas->mapUnitsPerPixel() ) );
+    mMapCanvas->zoomByFactor( qAbs( layer->rasterUnitsPerPixel() / mMapCanvas->mapUnitsPerPixel() ) );
     mMapCanvas->refresh();
 
     QgsDebugMsg( "MapUnitsPerPixel after  : " + QString::number( mMapCanvas->mapUnitsPerPixel() ) );

Modified: trunk/qgis/src/app/qgsdisplayangle.cpp
===================================================================
--- trunk/qgis/src/app/qgsdisplayangle.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/app/qgsdisplayangle.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -15,12 +15,7 @@
 
 #include "qgsdisplayangle.h"
 #include <QSettings>
-
-#ifndef Q_OS_MACX
 #include <cmath>
-#else
-#include <math.h>
-#endif
 
 QgsDisplayAngle::QgsDisplayAngle( QWidget * parent, Qt::WindowFlags f ): QDialog( parent, f )
 {

Modified: trunk/qgis/src/app/qgslabeldialog.cpp
===================================================================
--- trunk/qgis/src/app/qgslabeldialog.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/app/qgslabeldialog.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -330,7 +330,7 @@
 int QgsLabelDialog::itemNoForField( QString theFieldName, QStringList theFieldList )
 {
   //if no matches assume first item in list is blank and return that
-  return std::max( 0, theFieldList.indexOf( theFieldName ) );
+  return qMax( 0, theFieldList.indexOf( theFieldName ) );
 }
 
 QgsLabelDialog::~QgsLabelDialog()

Modified: trunk/qgis/src/app/qgsmaptoolmeasureangle.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptoolmeasureangle.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/app/qgsmaptoolmeasureangle.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -22,12 +22,7 @@
 #include "qgsrubberband.h"
 #include <QMouseEvent>
 #include <QSettings>
-
-#ifndef Q_OS_MACX
 #include <cmath>
-#else
-#include <math.h>
-#endif
 
 QgsMapToolMeasureAngle::QgsMapToolMeasureAngle( QgsMapCanvas* canvas ): QgsMapTool( canvas ), mRubberBand( 0 ), mResultDisplay( 0 )
 {
@@ -57,9 +52,9 @@
       double azimutOne = distArea->bearing( mAnglePoints.at( 1 ), mAnglePoints.at( 0 ) );
       double azimutTwo = distArea->bearing( mAnglePoints.at( 1 ), point );
       double resultAngle = azimutTwo - azimutOne;
-      QgsDebugMsg( QString::number( fabs( resultAngle ) ) );
+      QgsDebugMsg( QString::number( qAbs( resultAngle ) ) );
       QgsDebugMsg( QString::number( M_PI ) );
-      if ( fabs( resultAngle ) > M_PI )
+      if ( qAbs( resultAngle ) > M_PI )
       {
         if ( resultAngle < 0 )
         {

Modified: trunk/qgis/src/app/qgsmaptoolnodetool.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptoolnodetool.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/app/qgsmaptoolnodetool.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -21,7 +21,7 @@
 #include "qgsvectordataprovider.h"
 #include "qgstolerance.h"
 #include "qgsgeometry.h"
-#include <math.h>
+#include <cmath>
 #include <QMouseEvent>
 #include <QMessageBox>
 #include "qgslogger.h"

Modified: trunk/qgis/src/app/qgsmaptoolsimplify.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptoolsimplify.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/app/qgsmaptoolsimplify.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -446,7 +446,7 @@
         }
         else
         {  // calculate perpendicular distance to line (pythagorean theorem):
-          dist_to_seg = sqrt( fabs( seg_len * seg_len - proj * proj ) );
+          dist_to_seg = sqrt( qAbs( seg_len * seg_len - proj * proj ) );
         }
         if ( max_dist < dist_to_seg )
         {

Modified: trunk/qgis/src/app/qgspointrotationitem.cpp
===================================================================
--- trunk/qgis/src/app/qgspointrotationitem.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/app/qgspointrotationitem.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -15,12 +15,7 @@
 
 #include "qgspointrotationitem.h"
 #include <QPainter>
-
-#ifndef Q_OS_MACX
 #include <cmath>
-#else
-#include <math.h>
-#endif
 
 QgsPointRotationItem::QgsPointRotationItem( QgsMapCanvas* canvas ): QgsMapCanvasItem( canvas ), mOrientation( Clockwise ), mRotation( 0.0 )
 {

Modified: trunk/qgis/src/app/qgsvectorlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsvectorlayerproperties.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/app/qgsvectorlayerproperties.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -141,7 +141,7 @@
   for ( ; it != overlayPluginList.constEnd(); ++it )
   {
     QgsApplyDialog* d = ( *it )->dialog( lyr );
-    position = tabWidget->insertTab( tabWidget->count(), qobject_cast<QDialog*>( d ), QgisApp::getThemeIcon( "propertyicons/diagram.png" ), tr( "Overlay"));
+    position = tabWidget->insertTab( tabWidget->count(), qobject_cast<QDialog*>( d ), QgisApp::getThemeIcon( "propertyicons/diagram.png" ), tr( "Overlay" ) );
     tabWidget->setCurrentIndex( position ); //ugly, but otherwise the properties dialog is a mess
     mOverlayDialogs.push_back( d );
   }
@@ -172,8 +172,8 @@
   tblAttributes->setHorizontalHeaderItem( attrEditTypeCol, new QTableWidgetItem( tr( "Edit widget" ) ) );
   tblAttributes->setHorizontalHeaderItem( attrAliasCol, new QTableWidgetItem( tr( "Alias" ) ) );
 
-  tblAttributes->horizontalHeader()->setResizeMode(1,QHeaderView::Stretch);
-  tblAttributes->horizontalHeader()->setResizeMode(7,QHeaderView::Stretch);
+  tblAttributes->horizontalHeader()->setResizeMode( 1, QHeaderView::Stretch );
+  tblAttributes->horizontalHeader()->setResizeMode( 7, QHeaderView::Stretch );
   tblAttributes->setSelectionBehavior( QAbstractItemView::SelectRows );
   tblAttributes->setSelectionMode( QAbstractItemView::MultiSelection );
 
@@ -805,7 +805,7 @@
 
   QString xMin, yMin, xMax, yMax;
   double changeoverValue = 99999; // The 'largest' 5 digit number
-  if ( fabs( myExtent.xMinimum() ) > changeoverValue )
+  if ( qAbs( myExtent.xMinimum() ) > changeoverValue )
   {
     xMin = QString( "%1" ).arg( myExtent.xMinimum(), 0, 'f', 2 );
   }
@@ -814,7 +814,7 @@
     xMin = QString( "%1" ).arg( myExtent.xMinimum() );
   }
 
-  if ( fabs( myExtent.yMinimum() ) > changeoverValue )
+  if ( qAbs( myExtent.yMinimum() ) > changeoverValue )
   {
     yMin = QString( "%1" ).arg( myExtent.yMinimum(), 0, 'f', 2 );
   }
@@ -823,7 +823,7 @@
     yMin = QString( "%1" ).arg( myExtent.yMinimum() );
   }
 
-  if ( fabs( myExtent.xMaximum() ) > changeoverValue )
+  if ( qAbs( myExtent.xMaximum() ) > changeoverValue )
   {
     xMax = QString( "%1" ).arg( myExtent.xMaximum(), 0, 'f', 2 );
   }
@@ -832,7 +832,7 @@
     xMax = QString( "%1" ).arg( myExtent.xMaximum() );
   }
 
-  if ( fabs( myExtent.yMaximum() ) > changeoverValue )
+  if ( qAbs( myExtent.yMaximum() ) > changeoverValue )
   {
     yMax = QString( "%1" ).arg( myExtent.yMaximum(), 0, 'f', 2 );
   }

Modified: trunk/qgis/src/core/composer/qgscomposerarrow.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgscomposerarrow.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/composer/qgscomposerarrow.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -19,19 +19,24 @@
 #include <QPainter>
 #include <QSvgRenderer>
 
-#ifndef Q_OS_MACX
 #include <cmath>
-#else
-#include <math.h>
-#endif
 
-QgsComposerArrow::QgsComposerArrow( QgsComposition* c ): QgsComposerItem( c ), mStartPoint( 0, 0 ), mStopPoint( 0, 0 ), mMarkerMode( DefaultMarker ), mArrowColor( QColor( 0, 0, 0 ) )
+QgsComposerArrow::QgsComposerArrow( QgsComposition* c )
+    : QgsComposerItem( c )
+    , mStartPoint( 0, 0 )
+    , mStopPoint( 0, 0 )
+    , mMarkerMode( DefaultMarker )
+    , mArrowColor( QColor( 0, 0, 0 ) )
 {
   initGraphicsSettings();
 }
 
-QgsComposerArrow::QgsComposerArrow( const QPointF& startPoint, const QPointF& stopPoint, QgsComposition* c ): QgsComposerItem( c ), mStartPoint( startPoint ), \
-    mStopPoint( stopPoint ), mMarkerMode( DefaultMarker ), mArrowColor( QColor( 0, 0, 0 ) )
+QgsComposerArrow::QgsComposerArrow( const QPointF& startPoint, const QPointF& stopPoint, QgsComposition* c )
+    : QgsComposerItem( c )
+    , mStartPoint( startPoint )
+    , mStopPoint( stopPoint )
+    , mMarkerMode( DefaultMarker )
+    , mArrowColor( QColor( 0, 0, 0 ) )
 {
   initGraphicsSettings();
   adaptItemSceneRect();
@@ -134,8 +139,8 @@
   //make nicer preview
   if ( mComposition && mComposition->plotStyle() == QgsComposition::Preview )
   {
-    imageWidth *= std::min( viewScaleFactor, 10.0 );
-    imageHeight *= std::min( viewScaleFactor, 10.0 );
+    imageWidth *= qMin( viewScaleFactor, 10.0 );
+    imageHeight *= qMin( viewScaleFactor, 10.0 );
   }
   QImage markerImage( imageWidth, imageHeight, QImage::Format_ARGB32 );
   QColor markerBG( 255, 255, 255, 0 ); //transparent white background
@@ -251,8 +256,8 @@
 void QgsComposerArrow::adaptItemSceneRect()
 {
   //rectangle containing start and end point
-  QRectF rect = QRectF( std::min( mStartPoint.x(), mStopPoint.x() ), std::min( mStartPoint.y(), mStopPoint.y() ), \
-                        fabs( mStopPoint.x() - mStartPoint.x() ), fabs( mStopPoint.y() - mStartPoint.y() ) );
+  QRectF rect = QRectF( qMin( mStartPoint.x(), mStopPoint.x() ), qMin( mStartPoint.y(), mStopPoint.y() ), \
+                        qAbs( mStopPoint.x() - mStartPoint.x() ), qAbs( mStopPoint.y() - mStartPoint.y() ) );
   double enlarge = 0;
   if ( mMarkerMode == DefaultMarker )
   {
@@ -264,8 +269,8 @@
   }
   else if ( mMarkerMode == SVGMarker )
   {
-    double maxArrowHeight = std::max( mStartArrowHeadHeight, mStopArrowHeadHeight );
-    enlarge = mPen.widthF() / 2 + std::max( mArrowHeadWidth / 2.0, maxArrowHeight / 2.0 );
+    double maxArrowHeight = qMax( mStartArrowHeadHeight, mStopArrowHeadHeight );
+    enlarge = mPen.widthF() / 2 + qMax( mArrowHeadWidth / 2.0, maxArrowHeight / 2.0 );
   }
 
   rect.adjust( -enlarge, -enlarge, enlarge, enlarge );

Modified: trunk/qgis/src/core/composer/qgscomposeritem.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgscomposeritem.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/composer/qgscomposeritem.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -31,11 +31,7 @@
 #include "qgsrectangle.h" //just for debugging
 #include "qgslogger.h"
 
-#ifndef Q_OS_MACX
 #include <cmath>
-#else
-#include <math.h>
-#endif
 
 #define FONT_WORKAROUND_SCALE 10 //scale factor for upscaling fontsize and downscaling painter
 
@@ -346,7 +342,7 @@
   double diffY = mouseMoveStopPoint.y() - mMouseMoveStartPos.y();
 
   //it was only a click
-  if ( abs( diffX ) < std::numeric_limits<double>::min() && abs( diffY ) < std::numeric_limits<double>::min() )
+  if ( qAbs( diffX ) < std::numeric_limits<double>::min() && qAbs( diffY ) < std::numeric_limits<double>::min() )
   {
     return;
   }
@@ -892,7 +888,7 @@
 
 bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& height ) const
 {
-  if ( abs( mRotation ) <= 0 ) //width and height stays the same if there is no rotation
+  if ( qAbs( mRotation ) <= 0.0 ) //width and height stays the same if there is no rotation
   {
     return true;
   }

Modified: trunk/qgis/src/core/composer/qgscomposerlegend.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgscomposerlegend.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/composer/qgscomposerlegend.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -163,7 +163,7 @@
 
   p->setPen( QColor( 0, 0, 0 ) );
   drawText( p, mBoxSpace, currentYCoord, groupItem->text(), mGroupFont );
-  maxXCoord = std::max( maxXCoord, 2 * mBoxSpace + textWidthMillimeters( mGroupFont, groupItem->text() ) );
+  maxXCoord = qMax( maxXCoord, 2 * mBoxSpace + textWidthMillimeters( mGroupFont, groupItem->text() ) );
 
   //children can be other group items or layer items
   int numChildItems = groupItem->rowCount();
@@ -212,7 +212,7 @@
       drawText( p, mBoxSpace, currentYCoord, layerItem->text(), mLayerFont );
     }
 
-    maxXCoord = std::max( maxXCoord, 2 * mBoxSpace + textWidthMillimeters( mLayerFont, layerItem->text() ) );
+    maxXCoord = qMax( maxXCoord, 2 * mBoxSpace + textWidthMillimeters( mLayerFont, layerItem->text() ) );
   }
   //and child items
   drawLayerChildItems( p, layerItem, currentYCoord, maxXCoord, opacity );
@@ -235,7 +235,7 @@
   }
 
   //standerd item height
-  double itemHeight = std::max( mSymbolHeight, fontAscentMillimeters( mItemFont ) );
+  double itemHeight = qMax( mSymbolHeight, fontAscentMillimeters( mItemFont ) );
 
   QStandardItem* currentItem;
 
@@ -275,13 +275,13 @@
     {
       //draw symbol
       drawSymbol( p, symbol, currentYCoord + ( itemHeight - mSymbolHeight ) / 2, currentXCoord, realSymbolHeight, layerOpacity );
-      realItemHeight = std::max( realSymbolHeight, itemHeight );
+      realItemHeight = qMax( realSymbolHeight, itemHeight );
       currentXCoord += mIconLabelSpace;
     }
     else if ( symbolNg ) //item with symbol NG?
     {
       drawSymbolV2( p, symbolNg, currentYCoord + ( itemHeight - mSymbolHeight ) / 2, currentXCoord, realSymbolHeight, layerOpacity );
-      realItemHeight = std::max( realSymbolHeight, itemHeight );
+      realItemHeight = qMax( realSymbolHeight, itemHeight );
       currentXCoord += mIconLabelSpace;
     }
     else //item with icon?
@@ -304,7 +304,7 @@
     }
     currentXCoord += mBoxSpace;
 
-    maxXCoord = std::max( maxXCoord, currentXCoord );
+    maxXCoord = qMax( maxXCoord, currentXCoord );
 
     currentYCoord += realItemHeight;
   }

Modified: trunk/qgis/src/core/composer/qgscomposermap.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgscomposermap.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/composer/qgscomposermap.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -1292,16 +1292,16 @@
   for ( ; it != xLines.constEnd(); ++it )
   {
     currentAnnotationString = QString::number( it->first, 'f', mGridAnnotationPrecision );
-    currentExtension = std::max( textWidthMillimeters( mGridAnnotationFont, currentAnnotationString ), fontAscentMillimeters( mGridAnnotationFont ) );
-    maxExtension = std::max( maxExtension, currentExtension );
+    currentExtension = qMax( textWidthMillimeters( mGridAnnotationFont, currentAnnotationString ), fontAscentMillimeters( mGridAnnotationFont ) );
+    maxExtension = qMax( maxExtension, currentExtension );
   }
 
   it = yLines.constBegin();
   for ( ; it != yLines.constEnd(); ++it )
   {
     currentAnnotationString = QString::number( it->first, 'f', mGridAnnotationPrecision );
-    currentExtension = std::max( textWidthMillimeters( mGridAnnotationFont, currentAnnotationString ), fontAscentMillimeters( mGridAnnotationFont ) );
-    maxExtension = std::max( maxExtension, currentExtension );
+    currentExtension = qMax( textWidthMillimeters( mGridAnnotationFont, currentAnnotationString ), fontAscentMillimeters( mGridAnnotationFont ) );
+    maxExtension = qMax( maxExtension, currentExtension );
   }
 
   return maxExtension + mAnnotationFrameDistance;

Modified: trunk/qgis/src/core/composer/qgscomposerpicture.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgscomposerpicture.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/composer/qgscomposerpicture.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -86,8 +86,8 @@
         //make nicer preview
         if ( mComposition && mComposition->plotStyle() == QgsComposition::Preview )
         {
-          boundImageWidth *= std::min( viewScaleFactor, 10.0 );
-          boundImageHeight *= std::min( viewScaleFactor, 10.0 );
+          boundImageWidth *= qMin( viewScaleFactor, 10.0 );
+          boundImageHeight *= qMin( viewScaleFactor, 10.0 );
         }
         mImage = QImage( boundImageWidth, boundImageHeight, QImage::Format_ARGB32 );
         updateImageFromSvg();

Modified: trunk/qgis/src/core/qgscoordinatereferencesystem.cpp
===================================================================
--- trunk/qgis/src/core/qgscoordinatereferencesystem.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/qgscoordinatereferencesystem.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -747,7 +747,7 @@
     static const double feetToMeter = 0.3048;
     static const double smallNum = 1e-3;
 
-    if ( std::abs( toMeter - feetToMeter ) < smallNum )
+    if ( qAbs( toMeter - feetToMeter ) < smallNum )
       unit = "Foot";
 
     QgsDebugMsg( "Projection has linear units of " + unit );

Modified: trunk/qgis/src/core/qgsdistancearea.cpp
===================================================================
--- trunk/qgis/src/core/qgsdistancearea.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/qgsdistancearea.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -494,7 +494,7 @@
   double tu2 = 0;
 
   int iterLimit = 20;
-  while ( fabs( lambda - lambdaP ) > 1e-12 && --iterLimit > 0 )
+  while ( qAbs( lambda - lambdaP ) > 1e-12 && --iterLimit > 0 )
   {
     sinLambda = sin( lambda );
     cosLambda = cos( lambda );
@@ -665,7 +665,7 @@
   }
   // QgsDebugMsg("Area from point: " + (points[i % size]).toString(2));
   area = area / 2.0;
-  return fabs( area ); // All areas are positive!
+  return qAbs( area ); // All areas are positive!
 }
 
 QString QgsDistanceArea::textUnit( double value, int decimals, QGis::UnitType u, bool isArea, bool keepBaseUnit )
@@ -682,12 +682,12 @@
         {
           unitLabel = QObject::tr( " m2" );
         }
-        else if ( fabs( value ) > 1000000.0 )
+        else if ( qAbs( value ) > 1000000.0 )
         {
           unitLabel = QObject::tr( " km2" );
           value = value / 1000000.0;
         }
-        else if ( fabs( value ) > 10000.0 )
+        else if ( qAbs( value ) > 10000.0 )
         {
           unitLabel = QObject::tr( " ha" );
           value = value / 10000.0;
@@ -699,21 +699,21 @@
       }
       else
       {
-        if ( keepBaseUnit || fabs( value ) == 0.0 )
+        if ( keepBaseUnit || qAbs( value ) == 0.0 )
         {
           unitLabel = QObject::tr( " m" );
         }
-        else if ( fabs( value ) > 1000.0 )
+        else if ( qAbs( value ) > 1000.0 )
         {
           unitLabel = QObject::tr( " km" );
           value = value / 1000;
         }
-        else if ( fabs( value ) < 0.01 )
+        else if ( qAbs( value ) < 0.01 )
         {
           unitLabel = QObject::tr( " mm" );
           value = value * 1000;
         }
-        else if ( fabs( value ) < 0.1 )
+        else if ( qAbs( value ) < 0.1 )
         {
           unitLabel = QObject::tr( " cm" );
           value = value * 100;
@@ -727,7 +727,7 @@
     case QGis::Feet:
       if ( isArea )
       {
-        if ( keepBaseUnit  || fabs( value ) <= ( 528.0*528.0 ) )
+        if ( keepBaseUnit  || qAbs( value ) <= ( 528.0*528.0 ) )
         {
           unitLabel = QObject::tr( " sq ft" );
         }
@@ -739,9 +739,9 @@
       }
       else
       {
-        if ( fabs( value ) <= 528.0 || keepBaseUnit )
+        if ( qAbs( value ) <= 528.0 || keepBaseUnit )
         {
-          if ( fabs( value ) == 1.0 )
+          if ( qAbs( value ) == 1.0 )
           {
             unitLabel = QObject::tr( " foot" );
           }
@@ -764,7 +764,7 @@
       }
       else
       {
-        if ( fabs( value ) == 1.0 )
+        if ( qAbs( value ) == 1.0 )
           unitLabel = QObject::tr( " degree" );
         else
           unitLabel = QObject::tr( " degrees" );

Modified: trunk/qgis/src/core/qgsmaprenderer.cpp
===================================================================
--- trunk/qgis/src/core/qgsmaprenderer.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/qgsmaprenderer.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -104,8 +104,8 @@
   {
     // Use abs() on the extent to avoid the case where the extent is
     // symmetrical about 0.
-    double xMean = ( fabs( extent.xMinimum() ) + fabs( extent.xMaximum() ) ) * 0.5;
-    double yMean = ( fabs( extent.yMinimum() ) + fabs( extent.yMaximum() ) ) * 0.5;
+    double xMean = ( qAbs( extent.xMinimum() ) + qAbs( extent.xMaximum() ) ) * 0.5;
+    double yMean = ( qAbs( extent.yMinimum() ) + qAbs( extent.yMaximum() ) ) * 0.5;
 
     double xRange = extent.width() / xMean;
     double yRange = extent.height() / yMean;
@@ -388,7 +388,7 @@
       QgsMapToPixel rasterMapToPixel;
       QgsMapToPixel bk_mapToPixel;
 
-      if ( ml->type() == QgsMapLayer::RasterLayer && fabs( rasterScaleFactor - 1.0 ) > 0.000001 )
+      if ( ml->type() == QgsMapLayer::RasterLayer && qAbs( rasterScaleFactor - 1.0 ) > 0.000001 )
       {
         scaleRaster = true;
       }

Modified: trunk/qgis/src/core/qgspallabeling.cpp
===================================================================
--- trunk/qgis/src/core/qgspallabeling.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/qgspallabeling.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -402,8 +402,8 @@
   }
   QgsPoint ptSize = xform->toMapCoordinates( w, h );
 
-  labelX = fabs( ptSize.x() - ptZero.x() );
-  labelY = fabs( ptSize.y() - ptZero.y() );
+  labelX = qAbs( ptSize.x() - ptZero.x() );
+  labelY = qAbs( ptSize.y() - ptZero.y() );
 }
 
 
@@ -570,7 +570,7 @@
 
   if ( distance != 0 )
   {
-    feat->setDistLabel( fabs( ptOne.x() - ptZero.x() )* distance * vectorScaleFactor );
+    feat->setDistLabel( qAbs( ptOne.x() - ptZero.x() )* distance * vectorScaleFactor );
   }
 
   //add parameters for data defined labeling to QgsPalGeometry

Modified: trunk/qgis/src/core/qgspoint.cpp
===================================================================
--- trunk/qgis/src/core/qgspoint.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/qgspoint.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -136,12 +136,12 @@
 
 QString QgsPoint::toDegreesMinutesSeconds( int thePrecision ) const
 {
-  int myDegreesX = int( std::abs( m_x ) );
+  int myDegreesX = int( qAbs( m_x ) );
   float myFloatMinutesX = float(( qAbs( m_x ) - myDegreesX ) * 60 );
   int myIntMinutesX = int( myFloatMinutesX );
   float mySecondsX = float( myFloatMinutesX - myIntMinutesX ) * 60;
 
-  int myDegreesY = int( std::abs( m_y ) );
+  int myDegreesY = int( qAbs( m_y ) );
   float myFloatMinutesY = float(( qAbs( m_y ) - myDegreesY ) * 60 );
   int myIntMinutesY = int( myFloatMinutesY );
   float mySecondsY = float( myFloatMinutesY - myIntMinutesY ) * 60;
@@ -220,8 +220,8 @@
 {
   //algorithm from 'graphics GEMS', A. Paeth: 'A Fast 2D Point-on-line test'
   if (
-    fabs(( b.y() - a.y() ) *( m_x - a.x() ) - ( m_y - a.y() ) *( b.x() - a.x() ) )
-    >= qMax( fabs( b.x() - a.x() ), fabs( b.y() - a.y() ) )
+    qAbs(( b.y() - a.y() ) *( m_x - a.x() ) - ( m_y - a.y() ) *( b.x() - a.x() ) )
+    >= qMax( qAbs( b.x() - a.x() ), qAbs( b.y() - a.y() ) )
   )
   {
     return 0;

Modified: trunk/qgis/src/core/qgsrectangle.cpp
===================================================================
--- trunk/qgis/src/core/qgsrectangle.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/qgsrectangle.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -213,7 +213,7 @@
     int precision = 0;
     if (( width() < 1 || height() < 1 ) && ( width() > 0 && height() > 0 ) )
     {
-      precision = static_cast<int>( ceil( -1.0 * log10( std::min( width(), height() ) ) ) ) + 1;
+      precision = static_cast<int>( ceil( -1.0 * log10( qMin( width(), height() ) ) ) ) + 1;
       // sanity check
       if ( precision > 20 )
         precision = 20;

Modified: trunk/qgis/src/core/qgsscalecalculator.cpp
===================================================================
--- trunk/qgis/src/core/qgsscalecalculator.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/qgsscalecalculator.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -17,8 +17,7 @@
  ***************************************************************************/
 /* $Id$ */
 
-#include <assert.h>
-#include <math.h>
+#include <cmath>
 #include "qgslogger.h"
 #include "qgsrectangle.h"
 #include "qgsscalecalculator.h"
@@ -84,7 +83,7 @@
       delta = calculateGeographicDistance( mapExtent );
       break;
     default:
-      assert( "bad map units" );
+      Q_ASSERT( "bad map units" );
       break;
   }
   QgsDebugMsg( "Using conversionFactor of " + QString::number( conversionFactor ) );

Modified: trunk/qgis/src/core/qgssearchtreenode.cpp
===================================================================
--- trunk/qgis/src/core/qgssearchtreenode.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/qgssearchtreenode.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -28,14 +28,8 @@
 #include <QSettings>
 #include <iostream>
 
-#ifndef Q_OS_MACX
 #include <cmath>
-#else
-#include <math.h>
-#endif
 
-
-
 #define EVAL_STR(x) (x.length() ? x : "(empty)")
 
 QgsSearchTreeNode::QgsSearchTreeNode( QgsSearchTreeNode::Type t )

Modified: trunk/qgis/src/core/qgstolerance.cpp
===================================================================
--- trunk/qgis/src/core/qgstolerance.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/qgstolerance.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -16,10 +16,8 @@
 #include "qgstolerance.h"
 #include <QSettings>
 #include <QPoint>
-#include <math.h>
+#include <cmath>
 
-
-
 double QgsTolerance::toleranceInMapUnits( double tolerance, QgsMapLayer* layer, QgsMapRenderer* renderer, UnitType units )
 {
   if ( units == MapUnits )

Modified: trunk/qgis/src/core/qgsvectorlayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsvectorlayer.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/qgsvectorlayer.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -668,10 +668,10 @@
 
       for ( int i = 0; i < pa.size(); ++i )
       {
-        largestX  = std::max( largestX,  pa.point( i ).x() );
-        smallestX = std::min( smallestX, pa.point( i ).x() );
-        largestY  = std::max( largestY,  pa.point( i ).y() );
-        smallestY = std::min( smallestY, pa.point( i ).y() );
+        largestX  = qMax( largestX,  pa.point( i ).x() );
+        smallestX = qMin( smallestX, pa.point( i ).x() );
+        largestY  = qMax( largestY,  pa.point( i ).y() );
+        smallestY = qMin( smallestY, pa.point( i ).y() );
       }
       QgsDebugMsg( QString( "Largest  X coordinate was %1" ).arg( largestX ) );
       QgsDebugMsg( QString( "Smallest X coordinate was %1" ).arg( smallestX ) );

Modified: trunk/qgis/src/core/raster/qgscolorrampshader.cpp
===================================================================
--- trunk/qgis/src/core/raster/qgscolorrampshader.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/raster/qgscolorrampshader.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -23,7 +23,7 @@
 
 #include "qgscolorrampshader.h"
 
-#include <math.h>
+#include <cmath>
 
 QgsColorRampShader::QgsColorRampShader( double theMinimumValue, double theMaximumValue ) : QgsRasterShaderFunction( theMinimumValue, theMaximumValue )
 {
@@ -63,7 +63,7 @@
   {
     //Start searching from the last index - assumtion is that neighboring pixels tend to be similar values
     myColorRampItem = mColorRampItemList.value( mCurrentColorRampItemIndex );
-    myTinyDiff = fabs( theValue - myColorRampItem.value );
+    myTinyDiff = qAbs( theValue - myColorRampItem.value );
     //If the previous entry is less, then search closer to the top of the list (assumes mColorRampItemList is sorted)
     if ( mCurrentColorRampItemIndex != 0 && theValue <= mColorRampItemList.at( mCurrentColorRampItemIndex - 1 ).value )
     {
@@ -105,7 +105,7 @@
   {
     //Start searching from the last index - assumtion is that neighboring pixels tend to be similar values
     myColorRampItem = mColorRampItemList.value( mCurrentColorRampItemIndex );
-    myTinyDiff = fabs( theValue - myColorRampItem.value );
+    myTinyDiff = qAbs( theValue - myColorRampItem.value );
     if ( theValue == myColorRampItem.value || myTinyDiff <= DOUBLE_DIFF_THRESHOLD )
     {
       *theReturnRedValue = myColorRampItem.color.red();
@@ -154,7 +154,7 @@
   {
     //Start searching from the last index - assumtion is that neighboring pixels tend to be similar values
     myColorRampItem = mColorRampItemList.value( mCurrentColorRampItemIndex );
-    myTinyDiff = fabs( theValue - myColorRampItem.value );
+    myTinyDiff = qAbs( theValue - myColorRampItem.value );
     //If the previous entry is less, then search closer to the top of the list (assumes mColorRampItemList is sorted)
     if ( mCurrentColorRampItemIndex != 0 && theValue <= mColorRampItemList.at( mCurrentColorRampItemIndex - 1 ).value )
     {

Modified: trunk/qgis/src/core/raster/qgsrasterlayer.cpp
===================================================================
--- trunk/qgis/src/core/raster/qgsrasterlayer.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/raster/qgsrasterlayer.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -819,7 +819,7 @@
         {
           double myValue = readValue( myData, myDataType, iX + ( iY * myXBlockSize ) );
 
-          if ( mValidNoDataValue && ( fabs( myValue - mNoDataValue ) <= TINY_VALUE || myValue != myValue ) )
+          if ( mValidNoDataValue && ( qAbs( myValue - mNoDataValue ) <= TINY_VALUE || myValue != myValue ) )
           {
             continue; // NULL
           }
@@ -887,7 +887,7 @@
         {
           double myValue = readValue( myData, myDataType, iX + ( iY * myXBlockSize ) );
 
-          if ( mValidNoDataValue && ( fabs( myValue - mNoDataValue ) <= TINY_VALUE || myValue != myValue ) )
+          if ( mValidNoDataValue && ( qAbs( myValue - mNoDataValue ) <= TINY_VALUE || myValue != myValue ) )
           {
             continue; // NULL
           }
@@ -1278,7 +1278,7 @@
       for ( int myColumn = 0; myColumn < mLastViewPort.drawableAreaXDim; ++myColumn )
       {
         myValue = readValue( myGdalScanData, myDataType, myRow * mLastViewPort.drawableAreaXDim + myColumn );
-        if ( mValidNoDataValue && ( fabs( myValue - mNoDataValue ) <= TINY_VALUE || myValue != myValue ) )
+        if ( mValidNoDataValue && ( qAbs( myValue - mNoDataValue ) <= TINY_VALUE || myValue != myValue ) )
         {
           continue;
         }
@@ -1443,8 +1443,8 @@
   // calculate raster pixel offsets from origin to clipped rect
   // we're only interested in positive offsets where the origin of the raster
   // is northwest of the origin of the view
-  myRasterViewPort->rectXOffsetFloat = ( theViewExtent.xMinimum() - mLayerExtent.xMinimum() ) / fabs( mGeoTransform[1] );
-  myRasterViewPort->rectYOffsetFloat = ( mLayerExtent.yMaximum() - theViewExtent.yMaximum() ) / fabs( mGeoTransform[5] );
+  myRasterViewPort->rectXOffsetFloat = ( theViewExtent.xMinimum() - mLayerExtent.xMinimum() ) / qAbs( mGeoTransform[1] );
+  myRasterViewPort->rectYOffsetFloat = ( mLayerExtent.yMaximum() - theViewExtent.yMaximum() ) / qAbs( mGeoTransform[5] );
 
   if ( myRasterViewPort->rectXOffsetFloat < 0 )
   {
@@ -1512,8 +1512,8 @@
   myRasterViewPort->topLeftPoint = theQgsMapToPixel.transform( myRasterExtent.xMinimum(), myRasterExtent.yMaximum() );
   myRasterViewPort->bottomRightPoint = theQgsMapToPixel.transform( myRasterExtent.xMaximum(), myRasterExtent.yMinimum() );
 
-  myRasterViewPort->drawableAreaXDim = static_cast<int>( fabs(( myRasterViewPort->clippedWidth / theQgsMapToPixel.mapUnitsPerPixel() * mGeoTransform[1] ) ) + 0.5 );
-  myRasterViewPort->drawableAreaYDim = static_cast<int>( fabs(( myRasterViewPort->clippedHeight / theQgsMapToPixel.mapUnitsPerPixel() * mGeoTransform[5] ) ) + 0.5 );
+  myRasterViewPort->drawableAreaXDim = static_cast<int>( qAbs(( myRasterViewPort->clippedWidth / theQgsMapToPixel.mapUnitsPerPixel() * mGeoTransform[1] ) ) + 0.5 );
+  myRasterViewPort->drawableAreaYDim = static_cast<int>( qAbs(( myRasterViewPort->clippedHeight / theQgsMapToPixel.mapUnitsPerPixel() * mGeoTransform[5] ) ) + 0.5 );
 
   //the drawable area can start to get very very large when you get down displaying 2x2 or smaller, this is becasue
   //theQgsMapToPixel.mapUnitsPerPixel() is less then 1,
@@ -1573,9 +1573,9 @@
 
     //fetch image in several parts if it is too memory consuming
     //also some WMS servers have a pixel limit, so it's better to make several requests
-    int totalPixelWidth = fabs(( myRasterViewPort->clippedXMax -  myRasterViewPort->clippedXMin )
+    int totalPixelWidth = qAbs(( myRasterViewPort->clippedXMax -  myRasterViewPort->clippedXMin )
                                / theQgsMapToPixel.mapUnitsPerPixel() * mGeoTransform[1] ) + 1;
-    int totalPixelHeight = fabs(( myRasterViewPort->clippedYMax -  myRasterViewPort->clippedYMin )
+    int totalPixelHeight = qAbs(( myRasterViewPort->clippedYMax -  myRasterViewPort->clippedYMin )
                                 / theQgsMapToPixel.mapUnitsPerPixel() * mGeoTransform[5] ) + 1;
     int numParts = totalPixelWidth * totalPixelHeight / 5000000 + 1.0;
     int numRowsPerPart = totalPixelHeight / numParts + 1.0;
@@ -1962,7 +1962,7 @@
 #endif
       QString v;
 
-      if ( mValidNoDataValue && ( fabs( value - mNoDataValue ) <= TINY_VALUE || value != value ) )
+      if ( mValidNoDataValue && ( qAbs( value - mNoDataValue ) <= TINY_VALUE || value != value ) )
       {
         v = tr( "null (no data)" );
       }
@@ -3063,7 +3063,7 @@
 // We can only use one of the mGeoTransform[], so go with the
 // horisontal one.
 
-  return fabs( mGeoTransform[1] );
+  return qAbs( mGeoTransform[1] );
 }
 
 /**
@@ -4516,9 +4516,9 @@
 
       if ( mValidNoDataValue &&
            (
-             ( fabs( myRedValue - mNoDataValue ) <= TINY_VALUE || myRedValue != myRedValue ) ||
-             ( fabs( myGreenValue - mNoDataValue ) <= TINY_VALUE || myGreenValue != myGreenValue ) ||
-             ( fabs( myBlueValue - mNoDataValue ) <= TINY_VALUE || myBlueValue != myBlueValue )
+             ( qAbs( myRedValue - mNoDataValue ) <= TINY_VALUE || myRedValue != myRedValue ) ||
+             ( qAbs( myGreenValue - mNoDataValue ) <= TINY_VALUE || myGreenValue != myGreenValue ) ||
+             ( qAbs( myBlueValue - mNoDataValue ) <= TINY_VALUE || myBlueValue != myBlueValue )
            )
          )
       {
@@ -4618,7 +4618,7 @@
       myBlueValue = 0;
       myPixelValue = readValue( rasterScanLine, ( GDALDataType )myDataType, i );
 
-      if ( mValidNoDataValue && ( fabs( myPixelValue - mNoDataValue ) <= TINY_VALUE || myPixelValue != myPixelValue ) )
+      if ( mValidNoDataValue && ( qAbs( myPixelValue - mNoDataValue ) <= TINY_VALUE || myPixelValue != myPixelValue ) )
       {
         imageScanLine[ i ] = myDefaultColor;
         continue;
@@ -4698,7 +4698,7 @@
       myBlueValue = 0;
       myPixelValue = readValue( rasterScanLine, ( GDALDataType )myDataType, i );
 
-      if ( mValidNoDataValue && ( fabs( myPixelValue - mNoDataValue ) <= TINY_VALUE || myPixelValue != myPixelValue ) )
+      if ( mValidNoDataValue && ( qAbs( myPixelValue - mNoDataValue ) <= TINY_VALUE || myPixelValue != myPixelValue ) )
       {
         imageScanLine[ i ] = myDefaultColor;
         continue;
@@ -4795,7 +4795,7 @@
       myBlueValue = 0;
       myPixelValue = readValue( rasterScanLine, ( GDALDataType )myDataType, i );
 
-      if ( mValidNoDataValue && ( fabs( myPixelValue - mNoDataValue ) <= TINY_VALUE || myPixelValue != myPixelValue ) )
+      if ( mValidNoDataValue && ( qAbs( myPixelValue - mNoDataValue ) <= TINY_VALUE || myPixelValue != myPixelValue ) )
       {
         imageScanLine[ i ] = myDefaultColor;
         continue;
@@ -4891,7 +4891,7 @@
     {
       myGrayValue = readValue( rasterScanLine, ( GDALDataType )myDataType, i );
 
-      if ( mValidNoDataValue && ( fabs( myGrayValue - mNoDataValue ) <= TINY_VALUE || myGrayValue != myGrayValue ) )
+      if ( mValidNoDataValue && ( qAbs( myGrayValue - mNoDataValue ) <= TINY_VALUE || myGrayValue != myGrayValue ) )
       {
         imageScanLine[ i ] = myDefaultColor;
         continue;
@@ -4981,7 +4981,7 @@
     {
       myPixelValue = readValue( rasterScanLine, myDataType, i );
 
-      if ( mValidNoDataValue && ( fabs( myPixelValue - mNoDataValue ) <= TINY_VALUE || myPixelValue != myPixelValue ) )
+      if ( mValidNoDataValue && ( qAbs( myPixelValue - mNoDataValue ) <= TINY_VALUE || myPixelValue != myPixelValue ) )
       {
         imageScanLine[ i ] = myDefaultColor;
         continue;
@@ -5081,14 +5081,14 @@
                      ( theRasterViewPort->rectXOffsetFloat -
                        theRasterViewPort->rectXOffset )
                      / theQgsMapToPixel->mapUnitsPerPixel()
-                     * fabs( mGeoTransform[1] )
+                     * qAbs( mGeoTransform[1] )
                    );
 
     paintYoffset = static_cast<int>(
                      ( theRasterViewPort->rectYOffsetFloat -
                        theRasterViewPort->rectYOffset )
                      / theQgsMapToPixel->mapUnitsPerPixel()
-                     * fabs( mGeoTransform[5] )
+                     * qAbs( mGeoTransform[5] )
                    );
   }
 
@@ -5121,8 +5121,8 @@
     int myPixelBoundaryY = 0;
     if ( theQgsMapToPixel )
     {
-      myPixelBoundaryX = static_cast<int>( theRasterViewPort->topLeftPoint.x() + 0.5 ) + static_cast<int>( fabs( mGeoTransform[1] / theQgsMapToPixel->mapUnitsPerPixel() ) ) - paintXoffset;
-      myPixelBoundaryY = static_cast<int>( theRasterViewPort->topLeftPoint.y() + 0.5 ) + static_cast<int>( fabs( mGeoTransform[5] / theQgsMapToPixel->mapUnitsPerPixel() ) ) - paintYoffset;
+      myPixelBoundaryX = static_cast<int>( theRasterViewPort->topLeftPoint.x() + 0.5 ) + static_cast<int>( qAbs( mGeoTransform[1] / theQgsMapToPixel->mapUnitsPerPixel() ) ) - paintXoffset;
+      myPixelBoundaryY = static_cast<int>( theRasterViewPort->topLeftPoint.y() + 0.5 ) + static_cast<int>( qAbs( mGeoTransform[5] / theQgsMapToPixel->mapUnitsPerPixel() ) ) - paintYoffset;
     }
 
     //INSTANCE: 1x2
@@ -5762,18 +5762,18 @@
                            ( mViewPort->rectXOffsetFloat -
                              mViewPort->rectXOffset )
                            / mMapToPixel->mapUnitsPerPixel()
-                           * fabs( mGeoTransform[1] )
+                           * qAbs( mGeoTransform[1] )
                          );
 
           paintYoffset = static_cast<int>(
                            ( mViewPort->rectYOffsetFloat -
                              mViewPort->rectYOffset )
                            / mMapToPixel->mapUnitsPerPixel()
-                           * fabs( mGeoTransform[5] )
+                           * qAbs( mGeoTransform[5] )
                          );
 
           imageX = static_cast<int>( mViewPort->topLeftPoint.x() + 0.5 );
-          imageY = static_cast<int>( mViewPort->topLeftPoint.y() + 0.5 +  fabs( mGeoTransform[5] ) * mCurrentPartRasterMin / mMapToPixel->mapUnitsPerPixel() );
+          imageY = static_cast<int>( mViewPort->topLeftPoint.y() + 0.5 +  qAbs( mGeoTransform[5] ) * mCurrentPartRasterMin / mMapToPixel->mapUnitsPerPixel() );
         }
 
         mPainter->drawImage( imageX,
@@ -5812,7 +5812,7 @@
   int overlapRows = 0;
   if ( mMapToPixel )
   {
-    overlapRows = mMapToPixel->mapUnitsPerPixel() / fabs( mGeoTransform[5] ) + 2;
+    overlapRows = mMapToPixel->mapUnitsPerPixel() / qAbs( mGeoTransform[5] ) + 2;
   }
   if ( mCurrentPartRasterMax + overlapRows >= mViewPort->clippedHeight )
   {
@@ -5829,7 +5829,7 @@
   {
     if ( mMapToPixel )
     {
-      ySize = fabs((( rasterYSize ) / mMapToPixel->mapUnitsPerPixel() * mGeoTransform[5] ) ) + 0.5;
+      ySize = qAbs((( rasterYSize ) / mMapToPixel->mapUnitsPerPixel() * mGeoTransform[5] ) ) + 0.5;
     }
   }
   if ( ySize < 1 || xSize < 1 )
@@ -5875,14 +5875,14 @@
                      ( mViewPort->rectXOffsetFloat -
                        mViewPort->rectXOffset )
                      / mMapToPixel->mapUnitsPerPixel()
-                     * fabs( mGeoTransform[1] )
+                     * qAbs( mGeoTransform[1] )
                    );
 
     paintYoffset = static_cast<int>(
                      ( mViewPort->rectYOffsetFloat -
                        mViewPort->rectYOffset )
                      / mMapToPixel->mapUnitsPerPixel()
-                     * fabs( mGeoTransform[5] )
+                     * qAbs( mGeoTransform[5] )
                    );
   }
 
@@ -5906,8 +5906,8 @@
     int myPixelBoundaryY = 0;
     if ( mMapToPixel )
     {
-      myPixelBoundaryX = static_cast<int>( mViewPort->topLeftPoint.x() + 0.5 ) + static_cast<int>( fabs( mGeoTransform[1] / mMapToPixel->mapUnitsPerPixel() ) ) - paintXoffset;
-      myPixelBoundaryY = static_cast<int>( mViewPort->topLeftPoint.y() + 0.5 ) + static_cast<int>( fabs( mGeoTransform[5] / mMapToPixel->mapUnitsPerPixel() ) ) - paintYoffset;
+      myPixelBoundaryX = static_cast<int>( mViewPort->topLeftPoint.x() + 0.5 ) + static_cast<int>( qAbs( mGeoTransform[1] / mMapToPixel->mapUnitsPerPixel() ) ) - paintXoffset;
+      myPixelBoundaryY = static_cast<int>( mViewPort->topLeftPoint.y() + 0.5 ) + static_cast<int>( qAbs( mGeoTransform[5] / mMapToPixel->mapUnitsPerPixel() ) ) - paintYoffset;
     }
 
     //INSTANCE: 1x2

Modified: trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -25,7 +25,7 @@
 #include "qgsvectordataprovider.h"
 #include "qgsvectorlayer.h"
 #include "qgsrendercontext.h"
-#include <math.h>
+#include <cmath>
 #include <QDomNode>
 #include <QDomElement>
 #include <QImage>
@@ -145,7 +145,7 @@
     {
       //first find out the value for the scale classification attribute
       const QgsAttributeMap& attrs = f.attributeMap();
-      fieldScale = sqrt( fabs( attrs[theSymbol->scaleClassificationField()].toDouble() ) );
+      fieldScale = sqrt( qAbs( attrs[theSymbol->scaleClassificationField()].toDouble() ) );
       QgsDebugMsgLevel( QString( "Feature has field scale factor %1" ).arg( fieldScale ), 3 );
     }
     if ( theSymbol->rotationClassificationField() >= 0 )

Modified: trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -30,7 +30,7 @@
 #include <QImage>
 #include <QPainter>
 #include <QString>
-#include <math.h>
+#include <cmath>
 
 QgsSingleSymbolRenderer::QgsSingleSymbolRenderer( QGis::GeometryType type )
 {
@@ -141,7 +141,7 @@
     {
       //first find out the value for the scale classification attribute
       const QgsAttributeMap& attrs = f.attributeMap();
-      fieldScale = sqrt( fabs( attrs[ mSymbol0->scaleClassificationField()].toDouble() ) );
+      fieldScale = sqrt( qAbs( attrs[ mSymbol0->scaleClassificationField()].toDouble() ) );
       QgsDebugMsgLevel( QString( "Feature has field scale factor %1" ).arg( fieldScale ), 3 );
     }
     if ( mSymbol0->rotationClassificationField() >= 0 )

Modified: trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -24,7 +24,7 @@
 #include "qgssymbol.h"
 #include "qgssymbologyutils.h"
 #include "qgslogger.h"
-#include <math.h>
+#include <cmath>
 #include <QDomNode>
 #include <QPainter>
 #include <QImage>
@@ -123,7 +123,7 @@
     {
       //first find out the value for the scale classification attribute
       const QgsAttributeMap& attrs = f.attributeMap();
-      fieldScale = sqrt( fabs( attrs[symbol->scaleClassificationField()].toDouble() ) );
+      fieldScale = sqrt( qAbs( attrs[symbol->scaleClassificationField()].toDouble() ) );
     }
     if ( symbol->rotationClassificationField() >= 0 )
     {

Modified: trunk/qgis/src/core/spatialindex/geometry/LineSegment.cc
===================================================================
--- trunk/qgis/src/core/spatialindex/geometry/LineSegment.cc	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/spatialindex/geometry/LineSegment.cc	2010-11-19 07:51:19 UTC (rev 14713)
@@ -177,8 +177,8 @@
   for ( unsigned long cDim = 0; cDim < m_dimension; cDim++ )
   {
     coords[cDim] =
-      ( std::abs( m_pStartPoint[cDim] - m_pEndPoint[cDim] ) / 2.0 ) +
-      std::min( m_pStartPoint[cDim], m_pEndPoint[cDim] );
+      ( qAbs( m_pStartPoint[cDim] - m_pEndPoint[cDim] ) / 2.0 ) +
+      qMin( m_pStartPoint[cDim], m_pEndPoint[cDim] );
   }
 
   out = Point( coords, m_dimension );
@@ -198,8 +198,8 @@
 
   for ( unsigned long cDim = 0; cDim < m_dimension; cDim++ )
   {
-    low[cDim] = std::min( m_pStartPoint[cDim], m_pEndPoint[cDim] );
-    high[cDim] = std::max( m_pStartPoint[cDim], m_pEndPoint[cDim] );
+    low[cDim] = qMin( m_pStartPoint[cDim], m_pEndPoint[cDim] );
+    high[cDim] = qMax( m_pStartPoint[cDim], m_pEndPoint[cDim] );
   }
 
   out = Region( low, high, m_dimension );
@@ -247,10 +247,10 @@
     );
 
   if ( m_pEndPoint[0] >= m_pStartPoint[0] - std::numeric_limits<double>::epsilon() &&
-       m_pEndPoint[0] <= m_pStartPoint[0] + std::numeric_limits<double>::epsilon() ) return std::abs( p.m_pCoords[0] - m_pStartPoint[0] );
+       m_pEndPoint[0] <= m_pStartPoint[0] + std::numeric_limits<double>::epsilon() ) return qAbs( p.m_pCoords[0] - m_pStartPoint[0] );
 
   if ( m_pEndPoint[1] >= m_pStartPoint[1] - std::numeric_limits<double>::epsilon() &&
-       m_pEndPoint[1] <= m_pStartPoint[1] + std::numeric_limits<double>::epsilon() ) return std::abs( p.m_pCoords[1] - m_pStartPoint[1] );
+       m_pEndPoint[1] <= m_pStartPoint[1] + std::numeric_limits<double>::epsilon() ) return qAbs( p.m_pCoords[1] - m_pStartPoint[1] );
 
   double x1 = m_pStartPoint[0];
   double x2 = m_pEndPoint[0];
@@ -259,7 +259,7 @@
   double y2 = m_pEndPoint[1];
   double y0 = p.m_pCoords[1];
 
-  return std::abs(( x2 - x1 ) *( y1 - y0 ) - ( x1 - x0 ) *( y2 - y1 ) ) / ( std::sqrt(( x2 - x1 ) *( x2 - x1 ) + ( y2 - y1 ) *( y2 - y1 ) ) );
+  return qAbs(( x2 - x1 ) *( y1 - y0 ) - ( x1 - x0 ) *( y2 - y1 ) ) / ( std::sqrt(( x2 - x1 ) *( x2 - x1 ) + ( y2 - y1 ) *( y2 - y1 ) ) );
 }
 
 // assuming moving from start to end, positive distance is from right hand side.
@@ -325,7 +325,7 @@
   coords[1] = r.m_pLow[1];
   double d4 = getRelativeMinimumDistance( Point( coords, 2 ) );
 
-  return std::max( d1, std::max( d2, std::max( d3, d4 ) ) );
+  return qMax( d1, qMax( d2, qMax( d3, d4 ) ) );
 }
 
 double Tools::Geometry::LineSegment::getAngleOfPerpendicularRay()

Modified: trunk/qgis/src/core/spatialindex/geometry/Region.cc
===================================================================
--- trunk/qgis/src/core/spatialindex/geometry/Region.cc	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/spatialindex/geometry/Region.cc	2010-11-19 07:51:19 UTC (rev 14713)
@@ -395,8 +395,8 @@
 
   for ( unsigned long cDim = 0; cDim < m_dimension; cDim++ )
   {
-    ret.m_pLow[cDim] = std::max( m_pLow[cDim], r.m_pLow[cDim] );
-    ret.m_pHigh[cDim] = std::min( m_pHigh[cDim], r.m_pHigh[cDim] );
+    ret.m_pLow[cDim] = qMax( m_pLow[cDim], r.m_pLow[cDim] );
+    ret.m_pHigh[cDim] = qMin( m_pHigh[cDim], r.m_pHigh[cDim] );
   }
 
   return ret;
@@ -416,8 +416,8 @@
   {
     if ( m_pLow[cDim] > r.m_pHigh[cDim] || m_pHigh[cDim] < r.m_pLow[cDim] ) return 0.0;
 
-    f1 = std::max( m_pLow[cDim], r.m_pLow[cDim] );
-    f2 = std::min( m_pHigh[cDim], r.m_pHigh[cDim] );
+    f1 = qMax( m_pLow[cDim], r.m_pLow[cDim] );
+    f2 = qMin( m_pHigh[cDim], r.m_pHigh[cDim] );
     ret *= f2 - f1;
   }
 
@@ -450,8 +450,8 @@
 
   for ( unsigned long cDim = 0; cDim < m_dimension; cDim++ )
   {
-    m_pLow[cDim] = std::min( m_pLow[cDim], r.m_pLow[cDim] );
-    m_pHigh[cDim] = std::max( m_pHigh[cDim], r.m_pHigh[cDim] );
+    m_pLow[cDim] = qMin( m_pLow[cDim], r.m_pLow[cDim] );
+    m_pHigh[cDim] = qMax( m_pHigh[cDim], r.m_pHigh[cDim] );
   }
 }
 
@@ -464,8 +464,8 @@
 
   for ( unsigned long cDim = 0; cDim < m_dimension; cDim++ )
   {
-    m_pLow[cDim] = std::min( m_pLow[cDim], p.m_pCoords[cDim] );
-    m_pHigh[cDim] = std::max( m_pHigh[cDim], p.m_pCoords[cDim] );
+    m_pLow[cDim] = qMin( m_pLow[cDim], p.m_pCoords[cDim] );
+    m_pHigh[cDim] = qMax( m_pHigh[cDim], p.m_pCoords[cDim] );
   }
 }
 

Modified: trunk/qgis/src/core/spatialindex/rtree/Index.cc
===================================================================
--- trunk/qgis/src/core/spatialindex/rtree/Index.cc	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/spatialindex/rtree/Index.cc	2010-11-19 07:51:19 UTC (rev 14713)
@@ -309,8 +309,8 @@
 
       for ( unsigned long cChild = 0; cChild < m_children; cChild++ )
       {
-        m_nodeMBR.m_pLow[cDim] = std::min( m_nodeMBR.m_pLow[cDim], m_ptrMBR[cChild]->m_pLow[cDim] );
-        m_nodeMBR.m_pHigh[cDim] = std::max( m_nodeMBR.m_pHigh[cDim], m_ptrMBR[cChild]->m_pHigh[cDim] );
+        m_nodeMBR.m_pLow[cDim] = qMin( m_nodeMBR.m_pLow[cDim], m_ptrMBR[cChild]->m_pLow[cDim] );
+        m_nodeMBR.m_pHigh[cDim] = qMax( m_nodeMBR.m_pHigh[cDim], m_ptrMBR[cChild]->m_pHigh[cDim] );
       }
     }
   }
@@ -355,8 +355,8 @@
 
       for ( unsigned long cChild = 0; cChild < m_children; cChild++ )
       {
-        m_nodeMBR.m_pLow[cDim] = std::min( m_nodeMBR.m_pLow[cDim], m_ptrMBR[cChild]->m_pLow[cDim] );
-        m_nodeMBR.m_pHigh[cDim] = std::max( m_nodeMBR.m_pHigh[cDim], m_ptrMBR[cChild]->m_pHigh[cDim] );
+        m_nodeMBR.m_pLow[cDim] = qMin( m_nodeMBR.m_pLow[cDim], m_ptrMBR[cChild]->m_pLow[cDim] );
+        m_nodeMBR.m_pHigh[cDim] = qMax( m_nodeMBR.m_pHigh[cDim], m_ptrMBR[cChild]->m_pHigh[cDim] );
       }
     }
   }

Modified: trunk/qgis/src/core/spatialindex/rtree/Node.cc
===================================================================
--- trunk/qgis/src/core/spatialindex/rtree/Node.cc	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/spatialindex/rtree/Node.cc	2010-11-19 07:51:19 UTC (rev 14713)
@@ -326,8 +326,8 @@
 
       for ( unsigned long cChild = 0; cChild < m_children; cChild++ )
       {
-        m_nodeMBR.m_pLow[cDim] = std::min( m_nodeMBR.m_pLow[cDim], m_ptrMBR[cChild]->m_pLow[cDim] );
-        m_nodeMBR.m_pHigh[cDim] = std::max( m_nodeMBR.m_pHigh[cDim], m_ptrMBR[cChild]->m_pHigh[cDim] );
+        m_nodeMBR.m_pLow[cDim] = qMin( m_nodeMBR.m_pLow[cDim], m_ptrMBR[cChild]->m_pLow[cDim] );
+        m_nodeMBR.m_pHigh[cDim] = qMax( m_nodeMBR.m_pHigh[cDim], m_ptrMBR[cChild]->m_pHigh[cDim] );
       }
     }
   }
@@ -439,8 +439,8 @@
 
       for ( unsigned long cChild = 0; cChild < m_children; cChild++ )
       {
-        m_nodeMBR.m_pLow[cDim] = std::min( m_nodeMBR.m_pLow[cDim], m_ptrMBR[cChild]->m_pLow[cDim] );
-        m_nodeMBR.m_pHigh[cDim] = std::max( m_nodeMBR.m_pHigh[cDim], m_ptrMBR[cChild]->m_pHigh[cDim] );
+        m_nodeMBR.m_pLow[cDim] = qMin( m_nodeMBR.m_pLow[cDim], m_ptrMBR[cChild]->m_pLow[cDim] );
+        m_nodeMBR.m_pHigh[cDim] = qMax( m_nodeMBR.m_pHigh[cDim], m_ptrMBR[cChild]->m_pHigh[cDim] );
       }
     }
 
@@ -673,7 +673,7 @@
           d1 = a->getArea() - a1;
           mbr2->getCombinedRegion( *b, *( m_ptrMBR[cChild] ) );
           d2 = b->getArea() - a2;
-          d = std::abs( d1 - d2 );
+          d = qAbs( d1 - d2 );
 
           if ( d > m )
           {
@@ -826,7 +826,7 @@
       marginh += bbh1.getMargin() + bbh2.getMargin();
     } // for (cChild)
 
-    double margin = std::min( marginl, marginh );
+    double margin = qMin( marginl, marginh );
 
     // keep minimum margin as split axis.
     if ( margin < minimumMargin )
@@ -935,8 +935,8 @@
           if ( m_ptrMBR[cChild]->m_pLow[cDim] > m_ptrMBR[greatestLower]->m_pLow[cDim] ) greatestLower = cChild;
           if ( m_ptrMBR[cChild]->m_pHigh[cDim] < m_ptrMBR[leastUpper]->m_pHigh[cDim] ) leastUpper = cChild;
 
-          leastLower = std::min( m_ptrMBR[cChild]->m_pLow[cDim], leastLower );
-          greatestUpper = std::max( m_ptrMBR[cChild]->m_pHigh[cDim], greatestUpper );
+          leastLower = qMin( m_ptrMBR[cChild]->m_pLow[cDim], leastLower );
+          greatestUpper = qMax( m_ptrMBR[cChild]->m_pHigh[cDim], greatestUpper );
         }
 
         width = greatestUpper - leastLower;
@@ -1047,8 +1047,8 @@
 
           for ( unsigned long cChild = 0; cChild < p->m_children; cChild++ )
           {
-            p->m_nodeMBR.m_pLow[cDim] = std::min( p->m_nodeMBR.m_pLow[cDim], p->m_ptrMBR[cChild]->m_pLow[cDim] );
-            p->m_nodeMBR.m_pHigh[cDim] = std::max( p->m_nodeMBR.m_pHigh[cDim], p->m_ptrMBR[cChild]->m_pHigh[cDim] );
+            p->m_nodeMBR.m_pLow[cDim] = qMin( p->m_nodeMBR.m_pLow[cDim], p->m_ptrMBR[cChild]->m_pLow[cDim] );
+            p->m_nodeMBR.m_pHigh[cDim] = qMax( p->m_nodeMBR.m_pHigh[cDim], p->m_ptrMBR[cChild]->m_pHigh[cDim] );
           }
         }
       }

Modified: trunk/qgis/src/core/spatialindex/rtree/RTree.cc
===================================================================
--- trunk/qgis/src/core/spatialindex/rtree/RTree.cc	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/spatialindex/rtree/RTree.cc	2010-11-19 07:51:19 UTC (rev 14713)
@@ -639,8 +639,8 @@
 
       for ( unsigned long cChild = 0; cChild < e.m_pNode->m_children; cChild++ )
       {
-        tmpRegion.m_pLow[cDim] = std::min( tmpRegion.m_pLow[cDim], e.m_pNode->m_ptrMBR[cChild]->m_pLow[cDim] );
-        tmpRegion.m_pHigh[cDim] = std::max( tmpRegion.m_pHigh[cDim], e.m_pNode->m_ptrMBR[cChild]->m_pHigh[cDim] );
+        tmpRegion.m_pLow[cDim] = qMin( tmpRegion.m_pLow[cDim], e.m_pNode->m_ptrMBR[cChild]->m_pLow[cDim] );
+        tmpRegion.m_pHigh[cDim] = qMax( tmpRegion.m_pHigh[cDim], e.m_pNode->m_ptrMBR[cChild]->m_pHigh[cDim] );
       }
     }
 

Modified: trunk/qgis/src/core/spatialindex/tools/ExternalSort.cc
===================================================================
--- trunk/qgis/src/core/spatialindex/tools/ExternalSort.cc	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/spatialindex/tools/ExternalSort.cc	2010-11-19 07:51:19 UTC (rev 14713)
@@ -212,7 +212,7 @@
         // if there are no more records in the file, do nothing.
       }
 
-      cMaxRun = std::max( cRun, cMaxRun );
+      cMaxRun = qMax( cRun, cMaxRun );
       cRun++;
       if ( cRun == runs.size() ) cRun = 0;
     }

Modified: trunk/qgis/src/core/spatialindex/tools/Tools.cc
===================================================================
--- trunk/qgis/src/core/spatialindex/tools/Tools.cc	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/spatialindex/tools/Tools.cc	2010-11-19 07:51:19 UTC (rev 14713)
@@ -640,7 +640,7 @@
         rl * blockSize
       )
       {
-        unsigned long l = std::max( bufferLength, rl * blockSize );
+        unsigned long l = qMax( bufferLength, rl * blockSize );
 
         byte* tmp;
         try
@@ -717,10 +717,10 @@
     );
 
   // maximum resident set size
-  m_peakMemory = std::max( m_peakMemory, m_tmpRU.ru_maxrss );
+  m_peakMemory = qMax( m_peakMemory, m_tmpRU.ru_maxrss );
 
   // total memory
-  m_totalMemory = std::max( m_totalMemory, m_tmpRU.ru_ixrss + m_tmpRU.ru_idrss + m_tmpRU.ru_isrss + m_tmpRU.ru_maxrss );
+  m_totalMemory = qMax( m_totalMemory, m_tmpRU.ru_ixrss + m_tmpRU.ru_idrss + m_tmpRU.ru_isrss + m_tmpRU.ru_maxrss );
 }
 
 void Tools::ResourceUsage::stop()
@@ -757,10 +757,10 @@
   m_writeIO += ru.ru_oublock - m_tmpRU.ru_oublock;
 
   // maximum resident set size
-  m_peakMemory = std::max( m_peakMemory, ru.ru_maxrss );
+  m_peakMemory = qMax( m_peakMemory, ru.ru_maxrss );
 
   // total memory
-  m_totalMemory = std::max( m_totalMemory, ru.ru_ixrss + ru.ru_idrss + ru.ru_isrss + ru.ru_maxrss );
+  m_totalMemory = qMax( m_totalMemory, ru.ru_ixrss + ru.ru_idrss + ru.ru_isrss + ru.ru_maxrss );
 
   // page faults
   m_pageFaults += ru.ru_majflt - m_tmpRU.ru_majflt;

Modified: trunk/qgis/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
===================================================================
--- trunk/qgis/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -25,7 +25,7 @@
 #include <QDomElement>
 #include <QSettings> // for legend
 #include <limits> // for jenks classification
-#include "math.h" // for pretty classification
+#include <cmath> // for pretty classification
 
 QgsRendererRangeV2::QgsRendererRangeV2( double lowerValue, double upperValue, QgsSymbolV2* symbol, QString label )
     : mLowerValue( lowerValue ), mUpperValue( upperValue ), mSymbol( symbol ), mLabel( label )

Modified: trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.cpp
===================================================================
--- trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -313,7 +313,7 @@
 static QPointF linesIntersection( QPointF p1, double t1, QPointF p2, double t2 )
 {
   // parallel lines? (or the difference between angles is less than cca 0.1 degree)
-  if (( t1 == DBL_MAX && t2 == DBL_MAX ) || fabs( t1 - t2 ) < 0.001 )
+  if (( t1 == DBL_MAX && t2 == DBL_MAX ) || qAbs( t1 - t2 ) < 0.001 )
     return QPointF();
 
   double x, y;

Modified: trunk/qgis/src/gui/qgsannotationitem.cpp
===================================================================
--- trunk/qgis/src/gui/qgsannotationitem.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/gui/qgsannotationitem.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -107,10 +107,10 @@
     halfSymbolSize = scaledSymbolSize() / 2.0;
   }
 
-  double xMinPos = std::min( -halfSymbolSize, mOffsetFromReferencePoint.x() - mFrameBorderWidth );
-  double xMaxPos = std::max( halfSymbolSize, mOffsetFromReferencePoint.x() + mFrameSize.width() + mFrameBorderWidth );
-  double yMinPos = std::min( -halfSymbolSize, mOffsetFromReferencePoint.y() - mFrameBorderWidth );
-  double yMaxPos = std::max( halfSymbolSize, mOffsetFromReferencePoint.y() + mFrameSize.height() + mFrameBorderWidth );
+  double xMinPos = qMin( -halfSymbolSize, mOffsetFromReferencePoint.x() - mFrameBorderWidth );
+  double xMaxPos = qMax( halfSymbolSize, mOffsetFromReferencePoint.x() + mFrameSize.width() + mFrameBorderWidth );
+  double yMinPos = qMin( -halfSymbolSize, mOffsetFromReferencePoint.y() - mFrameBorderWidth );
+  double yMaxPos = qMax( halfSymbolSize, mOffsetFromReferencePoint.y() + mFrameSize.height() + mFrameBorderWidth );
   mBoundingRect = QRectF( xMinPos, yMinPos, xMaxPos - xMinPos, yMaxPos - yMinPos );
 }
 
@@ -283,16 +283,16 @@
 
   int cursorSensitivity = 7;
 
-  if ( abs( itemPos.x() ) < cursorSensitivity && abs( itemPos.y() ) < cursorSensitivity ) //move map point if position is close to the origin
+  if ( qAbs( itemPos.x() ) < cursorSensitivity && qAbs( itemPos.y() ) < cursorSensitivity ) //move map point if position is close to the origin
   {
     return MoveMapPosition;
   }
 
   bool left, right, up, down;
-  left = abs( itemPos.x() - mOffsetFromReferencePoint.x() ) < cursorSensitivity;
-  right = abs( itemPos.x() - ( mOffsetFromReferencePoint.x() + mFrameSize.width() ) ) < cursorSensitivity;
-  up = abs( itemPos.y() - mOffsetFromReferencePoint.y() ) < cursorSensitivity;
-  down = abs( itemPos.y() - ( mOffsetFromReferencePoint.y() + mFrameSize.height() ) ) < cursorSensitivity;
+  left = qAbs( itemPos.x() - mOffsetFromReferencePoint.x() ) < cursorSensitivity;
+  right = qAbs( itemPos.x() - ( mOffsetFromReferencePoint.x() + mFrameSize.width() ) ) < cursorSensitivity;
+  up = qAbs( itemPos.y() - mOffsetFromReferencePoint.y() ) < cursorSensitivity;
+  down = qAbs( itemPos.y() - ( mOffsetFromReferencePoint.y() + mFrameSize.height() ) ) < cursorSensitivity;
 
   if ( left && up )
   {

Modified: trunk/qgis/src/gui/qgsmapcanvas.cpp
===================================================================
--- trunk/qgis/src/gui/qgsmapcanvas.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/gui/qgsmapcanvas.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -717,8 +717,8 @@
     // Don't want to interfer with mouse events
 
     QgsRectangle currentExtent = mMapRenderer->extent();
-    double dx = fabs(( currentExtent.xMaximum() - currentExtent.xMinimum() ) / 4 );
-    double dy = fabs(( currentExtent.yMaximum() - currentExtent.yMinimum() ) / 4 );
+    double dx = qAbs(( currentExtent.xMaximum() - currentExtent.xMinimum() ) / 4 );
+    double dy = qAbs(( currentExtent.yMaximum() - currentExtent.yMinimum() ) / 4 );
 
     switch ( e->key() )
     {
@@ -1289,8 +1289,8 @@
   QgsPoint start = getCoordinateTransform()->toMapCoordinates( mCanvasProperties->rubberStartPoint );
   QgsPoint end = getCoordinateTransform()->toMapCoordinates( releasePoint );
 
-  double dx = fabs( end.x() - start.x() );
-  double dy = fabs( end.y() - start.y() );
+  double dx = qAbs( end.x() - start.x() );
+  double dy = qAbs( end.y() - start.y() );
 
   // modify the extent
   QgsRectangle r = mMapRenderer->extent();

Modified: trunk/qgis/src/mapserver/qgssldrule.cpp
===================================================================
--- trunk/qgis/src/mapserver/qgssldrule.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/mapserver/qgssldrule.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -26,7 +26,7 @@
 #include <QSvgRenderer>
 #include <QTemporaryFile>
 #include <QPainter>
-#include <math.h>
+#include <cmath>
 
 QgsSLDRule::QgsSLDRule( double minDenom, double maxDenom, const QgsSymbol& s, const QgsFilter* f ): mSymbol( s ), mMinScaleDenominator( minDenom ), mMaxScaleDenominator( maxDenom )
 {
@@ -54,7 +54,7 @@
     {
       //first find out the value for the scale classification attribute
       const QgsAttributeMap& attrs = f.attributeMap();
-      fieldScale = sqrt( fabs( attrs[mSymbol.scaleClassificationField()].toDouble() ) );
+      fieldScale = sqrt( qAbs( attrs[mSymbol.scaleClassificationField()].toDouble() ) );
     }
 
     *pic = mSymbol.getPointSymbolAsImage( widthScale, selected, selectionColor, fieldScale, rotation, rasterScaleFactor );

Modified: trunk/qgis/src/mapserver/qgswmsserver.cpp
===================================================================
--- trunk/qgis/src/mapserver/qgswmsserver.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/mapserver/qgswmsserver.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -1146,7 +1146,7 @@
     }
 
     //finally draw text
-    double symbolItemHeight = std::max( itemFontMetrics.ascent() / fontOversamplingFactor, currentSymbolHeight );
+    double symbolItemHeight = qMax( itemFontMetrics.ascent() / fontOversamplingFactor, currentSymbolHeight );
 
     if ( p )
     {

Modified: trunk/qgis/src/plugins/dxf2shp_converter/dxflib/src/dl_dxf.cpp
===================================================================
--- trunk/qgis/src/plugins/dxf2shp_converter/dxflib/src/dl_dxf.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/plugins/dxf2shp_converter/dxflib/src/dl_dxf.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -1226,7 +1226,7 @@
     double x = toReal( values[11], 0.0 );
     double y = toReal( values[21], 0.0 );
 
-    if ( fabs( x ) < 1.0e-6 )
+    if ( qAbs( x ) < 1.0e-6 )
     {
       if ( y > 0.0 )
       {
@@ -1821,9 +1821,9 @@
           double dist = sqrt( pow( x2 - x1, 2 ) + pow( y2 - y1, 2 ) ) / 2.0;
 
           // alpha can't be 0.0 at this point
-          radius = fabs( dist / sin( alpha / 2.0 ) );
+          radius = qAbs( dist / sin( alpha / 2.0 ) );
 
-          double wu = fabs( pow( radius, 2.0 ) - pow( dist, 2.0 ) );
+          double wu = qAbs( pow( radius, 2.0 ) - pow( dist, 2.0 ) );
           double h = sqrt( wu );
           double angle = acos(( x2 - x1 ) / dist );
 
@@ -1836,7 +1836,7 @@
             angle -= M_PI / 2.0;
           }
 
-          if ( fabs( alpha ) > M_PI )
+          if ( qAbs( alpha ) > M_PI )
           {
             h *= -1.0;
           }
@@ -2470,7 +2470,7 @@
   {
     dw.dxfReal( 10, data.x );
     dw.dxfReal( 20, data.y );
-    if ( fabs( data.bulge ) > 1.0e-10 )
+    if ( qAbs( data.bulge ) > 1.0e-10 )
     {
       dw.dxfReal( 42, data.bulge );
     }
@@ -2481,7 +2481,7 @@
     //dw.entityAttributes(attrib);
     dw.dxfString( 8, polylineLayer );
     dw.coord( VERTEX_COORD_CODE, data.x, data.y );
-    if ( fabs( data.bulge ) > 1.0e-10 )
+    if ( qAbs( data.bulge ) > 1.0e-10 )
     {
       dw.dxfReal( 42, data.bulge );
     }

Modified: trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.cpp
===================================================================
--- trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -1878,10 +1878,10 @@
         case 3: src = QgsPoint( dX, oY + ( double )s*stepY ); break;
       }
       t.transform( src, raster, rasterToWorld );
-      minX = std::min( raster.x(), minX );
-      maxX = std::max( raster.x(), maxX );
-      minY = std::min( raster.y(), minY );
-      maxY = std::max( raster.y(), maxY );
+      minX = qMin( raster.x(), minX );
+      maxX = qMax( raster.x(), maxX );
+      minY = qMin( raster.y(), minY );
+      maxY = qMax( raster.y(), maxY );
     }
   }
   return QgsRectangle( minX, minY, maxX, maxY );

Modified: trunk/qgis/src/plugins/georeferencer/qgsgeoreftransform.cpp
===================================================================
--- trunk/qgis/src/plugins/georeferencer/qgsgeoreftransform.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/plugins/georeferencer/qgsgeoreftransform.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -23,7 +23,6 @@
 #include "qgsleastsquares.h"
 
 #include <cmath>
-using std::abs;
 using std::cos;
 using std::sin;
 using std::pow;
@@ -454,7 +453,7 @@
   else
   {
     // Guard against division by zero
-    if ( abs( s ) < std::numeric_limits<double>::epsilon() )
+    if ( qAbs( s ) < std::numeric_limits<double>::epsilon() )
     {
       for ( int i = 0; i < nPointCount; ++i )
       {
@@ -479,7 +478,7 @@
   return true;
 }
 
-QgsGDALGeorefTransform::QgsGDALGeorefTransform( bool useTPS, unsigned int polynomialOrder ) : mPolynomialOrder( std::min( 3u, polynomialOrder ) ), mIsTPSTransform( useTPS )
+QgsGDALGeorefTransform::QgsGDALGeorefTransform( bool useTPS, unsigned int polynomialOrder ) : mPolynomialOrder( qMin( 3u, polynomialOrder ) ), mIsTPSTransform( useTPS )
 {
   mGDALTransformer     = NULL;
   mGDALTransformerArgs = NULL;

Modified: trunk/qgis/src/plugins/georeferencer/qgsimagewarper.cpp
===================================================================
--- trunk/qgis/src/plugins/georeferencer/qgsimagewarper.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/plugins/georeferencer/qgsimagewarper.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -332,7 +332,7 @@
 int CPL_STDCALL QgsImageWarper::updateWarpProgress( double dfComplete, const char *pszMessage, void *pProgressArg )
 {
   QProgressDialog *progress = static_cast<QProgressDialog*>( pProgressArg );
-  progress->setValue( std::min( 100u, ( uint )( dfComplete*100.0 ) ) );
+  progress->setValue( qMin( 100u, ( uint )( dfComplete*100.0 ) ) );
   qApp->processEvents();
   // TODO: call QEventLoop manually to make "cancel" button more responsive
   if ( progress->wasCanceled() )

Modified: trunk/qgis/src/plugins/georeferencer/qgsleastsquares.cpp
===================================================================
--- trunk/qgis/src/plugins/georeferencer/qgsleastsquares.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/plugins/georeferencer/qgsleastsquares.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -245,7 +245,7 @@
 
   // GSL does not support a full SVD, so we artificially add a linear dependent row
   // to the matrix in case the system is underconstrained.
-  uint m = std::max( 9u, ( uint )mapCoords.size() * 2u );
+  uint m = qMax( 9u, ( uint )mapCoords.size() * 2u );
   uint n = 9;
   gsl_matrix *S = gsl_matrix_alloc( m, n );
 

Modified: trunk/qgis/src/plugins/georeferencer/qgsresidualplotitem.cpp
===================================================================
--- trunk/qgis/src/plugins/georeferencer/qgsresidualplotitem.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/plugins/georeferencer/qgsresidualplotitem.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -18,11 +18,7 @@
 #include "qgsgeorefdatapoint.h"
 #include <QPainter>
 #include <cfloat>
-#ifndef Q_OS_MACX
 #include <cmath>
-#else
-#include <math.h>
-#endif
 
 QgsResidualPlotItem::QgsResidualPlotItem( QgsComposition* c ): QgsComposerItem( c ), mConvertScaleToMapUnits( false )
 {

Modified: trunk/qgis/src/plugins/grass/qgsgrassedit.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrassedit.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/plugins/grass/qgsgrassedit.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -854,7 +854,7 @@
 
   for ( int i = 0; i < nlines; i++ )
   {
-    int line = abs( mProvider->nodeLine( node, i ) );
+    int line = qAbs( mProvider->nodeLine( node, i ) );
     int type = mProvider->readLine( NULL, NULL, line );
 
     if ( type & GV_LINES )

Modified: trunk/qgis/src/plugins/grass/qgsgrassnewmapset.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrassnewmapset.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/plugins/grass/qgsgrassnewmapset.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -1111,7 +1111,7 @@
       double x1 = points[i].x();
       double x2 = points[i+1].x();
 
-      if ( fabs( x2 - x1 ) > 150 )
+      if ( qAbs( x2 - x1 ) > 150 )
       {
         if ( x2 < x1 )
         {

Modified: trunk/qgis/src/plugins/grass/qtermwidget/TerminalDisplay.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qtermwidget/TerminalDisplay.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/plugins/grass/qtermwidget/TerminalDisplay.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -743,16 +743,16 @@
   if ( lines == 0
        || _image == 0
        || !region.isValid()
-       || ( region.top() + abs( lines ) ) >= region.bottom()
+       || ( region.top() + qAbs( lines ) ) >= region.bottom()
        || this->_lines <= region.height() ) return;
 
   QRect scrollRect;
 
   void* firstCharPos = &_image[ region.top() * this->_columns ];
-  void* lastCharPos = &_image[( region.top() + abs( lines ) ) * this->_columns ];
+  void* lastCharPos = &_image[( region.top() + qAbs( lines ) ) * this->_columns ];
 
   int top = _topMargin + ( region.top() * _fontHeight );
-  int linesToMove = region.height() - abs( lines );
+  int linesToMove = region.height() - qAbs( lines );
   int bytesToMove = linesToMove *
                     this->_columns *
                     sizeof( Character );
@@ -789,7 +789,7 @@
 
     //set region of the display to scroll, making sure that
     //the region aligns correctly to the character grid
-    QPoint topPoint( _leftMargin , top + abs( lines )*_fontHeight );
+    QPoint topPoint( _leftMargin , top + qAbs( lines )*_fontHeight );
 
     scrollRect = QRect( topPoint ,
                         QSize( this->_usedColumns * _fontWidth ,

Modified: trunk/qgis/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.cpp
===================================================================
--- trunk/qgis/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -25,16 +25,17 @@
 #include "qgsvectorlayer.h"
 #include <QDomElement>
 #include <QPainter>
-
-#ifndef Q_OS_MACX
 #include <cmath>
-#else
-#include <math.h>
-#endif
 
-QgsPointDisplacementRenderer::QgsPointDisplacementRenderer( const QString& labelAttributeName ): QgsFeatureRendererV2( "pointDisplacement" ), \
-    mLabelAttributeName( labelAttributeName ), mLabelIndex( -1 ), mTolerance( 0.00001 ), mCircleWidth( 0.4 ), mCircleColor( QColor( 125, 125, 125 ) ), mCircleRadiusAddition( 0 ), \
-    mMaxLabelScaleDenominator( -1 )
+QgsPointDisplacementRenderer::QgsPointDisplacementRenderer( const QString& labelAttributeName )
+    : QgsFeatureRendererV2( "pointDisplacement" )
+    , mLabelAttributeName( labelAttributeName )
+    , mLabelIndex( -1 )
+    , mTolerance( 0.00001 )
+    , mCircleWidth( 0.4 )
+    , mCircleColor( QColor( 125, 125, 125 ) )
+    , mCircleRadiusAddition( 0 )
+    , mMaxLabelScaleDenominator( -1 )
 {
   mRenderer = QgsFeatureRendererV2::defaultRenderer( QGis::Point );
   mCenterSymbol = new QgsMarkerSymbolV2(); //the symbol for the center of a displacement group
@@ -149,7 +150,7 @@
 
   QgsSymbolV2RenderContext symbolContext( context, QgsSymbolV2::MM, 1.0, selected );
   double circleAdditionPainterUnits = symbolContext.outputLineWidth( mCircleRadiusAddition );
-  double radius = std::max(( diagonal / 2 ), labelAttributeList.size() * diagonal / 2 / M_PI ) + circleAdditionPainterUnits;
+  double radius = qMax(( diagonal / 2 ), labelAttributeList.size() * diagonal / 2 / M_PI ) + circleAdditionPainterUnits;
 
   //draw Circle
   drawCircle( radius, symbolContext, pt, symbolList.size() );

Modified: trunk/qgis/src/providers/grass/qgsgrassrasterprovider.cpp
===================================================================
--- trunk/qgis/src/providers/grass/qgsgrassrasterprovider.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/providers/grass/qgsgrassrasterprovider.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -23,7 +23,7 @@
 #include "qgsgrassrasterprovider.h"
 #include "qgsconfig.h"
 
-#include <math.h>
+#include <cmath>
 
 #include "qgsapplication.h"
 #include "qgscoordinatetransform.h"

Modified: trunk/qgis/src/providers/wms/qgswmsprovider.cpp
===================================================================
--- trunk/qgis/src/providers/wms/qgswmsprovider.cpp	2010-11-18 21:06:41 UTC (rev 14712)
+++ trunk/qgis/src/providers/wms/qgswmsprovider.cpp	2010-11-19 07:51:19 UTC (rev 14713)
@@ -26,7 +26,7 @@
 #include "qgslogger.h"
 #include "qgswmsprovider.h"
 
-#include <math.h>
+#include <cmath>
 
 #include "qgscoordinatetransform.h"
 #include "qgsrectangle.h"
@@ -552,10 +552,10 @@
     double tres = mResolutions[i];
 
     // clip view extent to layer extent
-    double xmin = std::max( viewExtent.xMinimum(), layerExtent.xMinimum() );
-    double ymin = std::max( viewExtent.yMinimum(), layerExtent.yMinimum() );
-    double xmax = std::min( viewExtent.xMaximum(), layerExtent.xMaximum() );
-    double ymax = std::min( viewExtent.yMaximum(), layerExtent.yMaximum() );
+    double xmin = qMax( viewExtent.xMinimum(), layerExtent.xMinimum() );
+    double ymin = qMax( viewExtent.yMinimum(), layerExtent.yMinimum() );
+    double xmax = qMin( viewExtent.xMaximum(), layerExtent.xMaximum() );
+    double ymax = qMin( viewExtent.yMaximum(), layerExtent.yMaximum() );
 
     // snap to tile coordinates
     double x0 = floor(( xmin - layerExtent.xMinimum() ) / mTileWidth / tres ) * mTileWidth * tres + layerExtent.xMinimum() + mTileWidth * tres * 0.001;
@@ -2251,7 +2251,7 @@
   myMetadataQString += "</td></tr>";
 
   // Layer Coordinate Reference Systems
-  for ( int j = 0; j < std::min( layer.crs.size(), 10 ); j++ )
+  for ( int j = 0; j < qMin( layer.crs.size(), 10 ); j++ )
   {
     myMetadataQString += "<tr><td bgcolor=\"gray\">";
     myMetadataQString += tr( "Available in CRS" );



More information about the QGIS-commit mailing list