[QGIS Commit] r13471 - in trunk/qgis/src: app gui

svn_qgis at osgeo.org svn_qgis at osgeo.org
Wed May 12 18:49:14 EDT 2010


Author: jef
Date: 2010-05-12 18:49:13 -0400 (Wed, 12 May 2010)
New Revision: 13471

Modified:
   trunk/qgis/src/app/qgsmaptoolidentify.cpp
   trunk/qgis/src/gui/qgsrubberband.cpp
Log:
apply #2692. Thanks again Jeremy.

Modified: trunk/qgis/src/app/qgsmaptoolidentify.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptoolidentify.cpp	2010-05-12 22:45:25 UTC (rev 13470)
+++ trunk/qgis/src/app/qgsmaptoolidentify.cpp	2010-05-12 22:49:13 UTC (rev 13471)
@@ -295,7 +295,8 @@
       convertMeasurement( calc, dist, myDisplayUnits, false );
       QString str = calc.textUnit( dist, 3, myDisplayUnits, false );  // dist and myDisplayUnits are out params
       derivedAttributes.insert( tr( "Length" ), str );
-      if ( f_it->geometry()->wkbType() == QGis::WKBLineString )
+      if ( f_it->geometry()->wkbType() == QGis::WKBLineString ||
+           f_it->geometry()->wkbType() == QGis::WKBLineString25D )
       {
         // Add the start and end points in as derived attributes
         str = QLocale::system().toString( f_it->geometry()->asPolyline().first().x(), 'g', 10 );
@@ -316,7 +317,9 @@
       QString str = calc.textUnit( area, 3, myDisplayUnits, true );
       derivedAttributes.insert( tr( "Area" ), str );
     }
-    else if ( layer->geometryType() == QGis::Point )
+    else if ( layer->geometryType() == QGis::Point &&
+              ( f_it->geometry()->wkbType() == QGis::WKBPoint ||
+                f_it->geometry()->wkbType() == QGis::WKBPoint25D ) )
     {
       // Include the x and y coordinates of the point as a derived attribute
       QString str;

Modified: trunk/qgis/src/gui/qgsrubberband.cpp
===================================================================
--- trunk/qgis/src/gui/qgsrubberband.cpp	2010-05-12 22:45:25 UTC (rev 13470)
+++ trunk/qgis/src/gui/qgsrubberband.cpp	2010-05-12 22:49:13 UTC (rev 13471)
@@ -202,19 +202,20 @@
       for ( int i = 0; i < mpt.size(); ++i )
       {
         QgsPoint pt = mpt[i];
+        mPoints.push_back( QList<QgsPoint>() );
         if ( layer )
         {
-          addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() - d ) ), false );
-          addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() - d ) ), false );
-          addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() + d ) ), false );
-          addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() + d ) ), false );
+          addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() - d ) ), false, i );
+          addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() - d ) ), false, i );
+          addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() + d ) ), false, i );
+          addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() + d ) ), false, i );
         }
         else
         {
-          addPoint( QgsPoint( pt.x() - d, pt.y() - d ), false );
-          addPoint( QgsPoint( pt.x() + d, pt.y() - d ), false );
-          addPoint( QgsPoint( pt.x() + d, pt.y() + d ), false );
-          addPoint( QgsPoint( pt.x() - d, pt.y() + d ), false );
+          addPoint( QgsPoint( pt.x() - d, pt.y() - d ), false, i );
+          addPoint( QgsPoint( pt.x() + d, pt.y() - d ), false, i );
+          addPoint( QgsPoint( pt.x() + d, pt.y() + d ), false, i );
+          addPoint( QgsPoint( pt.x() - d, pt.y() + d ), false, i );
         }
       }
     }
@@ -248,8 +249,7 @@
       QgsMultiPolyline mline = geom->asMultiPolyline();
       for ( int i = 0; i < mline.size(); ++i )
       {
-        QList<QgsPoint> newList;
-        mPoints.push_back( newList );
+        mPoints.push_back( QList<QgsPoint>() );
         QgsPolyline line = mline[i];
         for ( int j = 0; j < line.size(); ++j )
         {
@@ -295,8 +295,7 @@
       QgsMultiPolygon multipoly = geom->asMultiPolygon();
       for ( int i = 0; i < multipoly.size(); ++i )
       {
-        QList<QgsPoint> newList;
-        mPoints.push_back( newList );
+        mPoints.push_back( QList<QgsPoint>() );
         QgsPolygon poly = multipoly[i];
         QgsPolyline line = poly[0];
         for ( int j = 0; j < line.count(); ++j )



More information about the QGIS-commit mailing list