[QGIS Commit] r13176 - trunk/qgis/src/app
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sun Mar 28 04:35:22 EDT 2010
Author: wonder
Date: 2010-03-28 04:34:54 -0400 (Sun, 28 Mar 2010)
New Revision: 13176
Modified:
trunk/qgis/src/app/qgsmaptoolsimplify.cpp
Log:
Fixed a segfault with simplify tool (#2450)
Modified: trunk/qgis/src/app/qgsmaptoolsimplify.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptoolsimplify.cpp 2010-03-27 18:19:19 UTC (rev 13175)
+++ trunk/qgis/src/app/qgsmaptoolsimplify.cpp 2010-03-28 08:34:54 UTC (rev 13176)
@@ -259,7 +259,7 @@
vlayer->select( QgsAttributeList(), selectRect, true );
QgsGeometry* geometry = QgsGeometry::fromPoint( layerCoords );
- double minDistance = 10000000;
+ double minDistance = DBL_MAX;
double currentDistance;
QgsFeature f;
@@ -274,16 +274,18 @@
mSelectedFeature = f;
}
}
- if ( mSelectedFeature.geometry()->isMultipart() )
- {
- QMessageBox::critical( 0, tr( "Unsupported operation" ), tr( "Multipart features are not supported for simplification." ) );
- return;
- }
+
// delete previous rubberband (if any)
removeRubberBand();
if ( mSelectedFeature.isValid() )
{
+ if ( mSelectedFeature.geometry()->isMultipart() )
+ {
+ QMessageBox::critical( 0, tr( "Unsupported operation" ), tr( "Multipart features are not supported for simplification." ) );
+ return;
+ }
+
mRubberBand = new QgsRubberBand( mCanvas );
mRubberBand->setToGeometry( mSelectedFeature.geometry(), false );
mRubberBand->setColor( Qt::red );
More information about the QGIS-commit
mailing list