[QGIS Commit] r11387 - in trunk/qgis/src: core plugins/diagram_overlay

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Aug 15 09:13:25 EDT 2009


Author: jef
Date: 2009-08-15 09:13:24 -0400 (Sat, 15 Aug 2009)
New Revision: 11387

Modified:
   trunk/qgis/src/core/qgscentralpointpositionmanager.cpp
   trunk/qgis/src/core/qgsmaprenderer.cpp
   trunk/qgis/src/plugins/diagram_overlay/qgsdiagramrenderer.cpp
Log:
fix warnings

Modified: trunk/qgis/src/core/qgscentralpointpositionmanager.cpp
===================================================================
--- trunk/qgis/src/core/qgscentralpointpositionmanager.cpp	2009-08-15 10:46:03 UTC (rev 11386)
+++ trunk/qgis/src/core/qgscentralpointpositionmanager.cpp	2009-08-15 13:13:24 UTC (rev 11387)
@@ -216,7 +216,6 @@
     default:
       return 6;
   }
-  return 0;
 }
 
 int QgsCentralPointPositionManager::calculatePolygonCentroid( double x[], double y[], int numberOfPoints, double& centroidX, double& centroidY ) const

Modified: trunk/qgis/src/core/qgsmaprenderer.cpp
===================================================================
--- trunk/qgis/src/core/qgsmaprenderer.cpp	2009-08-15 10:46:03 UTC (rev 11386)
+++ trunk/qgis/src/core/qgsmaprenderer.cpp	2009-08-15 13:13:24 UTC (rev 11387)
@@ -637,6 +637,7 @@
     }
     catch ( QgsCsException &cse )
     {
+      Q_UNUSED( cse );
       QgsDebugMsg( QString( "Transform error caught:%s" ).arg( cse.what() ) );
     }
   }

Modified: trunk/qgis/src/plugins/diagram_overlay/qgsdiagramrenderer.cpp
===================================================================
--- trunk/qgis/src/plugins/diagram_overlay/qgsdiagramrenderer.cpp	2009-08-15 10:46:03 UTC (rev 11386)
+++ trunk/qgis/src/plugins/diagram_overlay/qgsdiagramrenderer.cpp	2009-08-15 13:13:24 UTC (rev 11387)
@@ -285,7 +285,7 @@
   return 0;
 }
 
-int QgsDiagramRenderer::interpolateSize( double value, double lowerValue, double upperValue, \
+int QgsDiagramRenderer::interpolateSize( double value, double lowerValue, double upperValue,
     int lowerSize, int upperSize ) const
 {
   switch ( mItemInterpretation )
@@ -305,13 +305,9 @@
         return upperSize;
       }
 
-      QgsDiagramFactory::SizeType t;
-      if ( mFactory )
-      {
-        t = mFactory->sizeType();
-      }
+      QgsDiagramFactory::SizeType t = mFactory ? mFactory->sizeType() : QgsDiagramFactory::HEIGHT;
 
-      if ( !mFactory || t == QgsDiagramFactory::HEIGHT )
+      if ( t == QgsDiagramFactory::HEIGHT )
       {
         //do one dimensional linear interpolation
         return ( int )((( value - lowerValue ) * upperSize + ( upperValue - value ) * lowerSize ) / ( upperValue - lowerValue ) );
@@ -327,5 +323,4 @@
     default:
       return 1;
   }
-  return 0; //something went wrong if we arrive here
 }



More information about the QGIS-commit mailing list