Skip to content

Commit

Permalink
Fixed a segfault with simplify tool (#2450)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13176 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Mar 28, 2010
1 parent b8c1bc8 commit 50298dd
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/app/qgsmaptoolsimplify.cpp
Expand Up @@ -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;

Expand All @@ -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 );
Expand Down

0 comments on commit 50298dd

Please sign in to comment.