Skip to content

Commit a066fe3

Browse files
author
wonder
committed
Fixed a segfault with simplify tool (#2450)
git-svn-id: http://svn.osgeo.org/qgis/trunk@13176 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 26f4b45 commit a066fe3

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/app/qgsmaptoolsimplify.cpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ void QgsMapToolSimplify::canvasPressEvent( QMouseEvent * e )
259259
vlayer->select( QgsAttributeList(), selectRect, true );
260260

261261
QgsGeometry* geometry = QgsGeometry::fromPoint( layerCoords );
262-
double minDistance = 10000000;
262+
double minDistance = DBL_MAX;
263263
double currentDistance;
264264
QgsFeature f;
265265

@@ -274,16 +274,18 @@ void QgsMapToolSimplify::canvasPressEvent( QMouseEvent * e )
274274
mSelectedFeature = f;
275275
}
276276
}
277-
if ( mSelectedFeature.geometry()->isMultipart() )
278-
{
279-
QMessageBox::critical( 0, tr( "Unsupported operation" ), tr( "Multipart features are not supported for simplification." ) );
280-
return;
281-
}
277+
282278
// delete previous rubberband (if any)
283279
removeRubberBand();
284280

285281
if ( mSelectedFeature.isValid() )
286282
{
283+
if ( mSelectedFeature.geometry()->isMultipart() )
284+
{
285+
QMessageBox::critical( 0, tr( "Unsupported operation" ), tr( "Multipart features are not supported for simplification." ) );
286+
return;
287+
}
288+
287289
mRubberBand = new QgsRubberBand( mCanvas );
288290
mRubberBand->setToGeometry( mSelectedFeature.geometry(), false );
289291
mRubberBand->setColor( Qt::red );

0 commit comments

Comments
 (0)