Skip to content
Permalink
Browse files
Fixed a segfault with simplify tool (#2450)
git-svn-id: http://svn.osgeo.org/qgis/trunk@13176 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Mar 28, 2010
1 parent 26f4b45 commit a066fe33eb341d77ff2340a70a7cadc931841d04
Showing with 8 additions and 6 deletions.
  1. +8 −6 src/app/qgsmaptoolsimplify.cpp
@@ -259,7 +259,7 @@ void QgsMapToolSimplify::canvasPressEvent( QMouseEvent * e )
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 @@ void QgsMapToolSimplify::canvasPressEvent( QMouseEvent * e )
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 );

0 comments on commit a066fe3

Please sign in to comment.