Skip to content
Permalink
Browse files

Destroy active undo command if the vertex can't be deleted

git-svn-id: http://svn.osgeo.org/qgis/trunk@11145 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Jul 22, 2009
1 parent 7ecd98b commit 37d01af55d954afe8b8adb8c069010668a266d65
Showing with 11 additions and 2 deletions.
  1. +11 −2 src/app/qgsmaptooldeletevertex.cpp
@@ -76,15 +76,24 @@ void QgsMapToolDeleteVertex::canvasReleaseEvent( QMouseEvent * e )
vlayer = dynamic_cast<QgsVectorLayer*>( currentLayer );
}

bool success = true;
if ( vlayer && mRecentSnappingResults.size() > 0 )
{
QList<QgsSnappingResult>::iterator sr_it = mRecentSnappingResults.begin();
vlayer->beginEditCommand( tr( "Vertex deleted" ) );
for ( ; sr_it != mRecentSnappingResults.end(); ++sr_it )
{
vlayer->deleteVertex( sr_it->snappedAtGeometry, sr_it->snappedVertexNr );
if (!vlayer->deleteVertex( sr_it->snappedAtGeometry, sr_it->snappedVertexNr ))
{
success = false;
vlayer->destroyEditCommand();
break;
}
}
if (success)
{
vlayer->endEditCommand();
}
vlayer->endEditCommand();
}

mCanvas->refresh();

0 comments on commit 37d01af

Please sign in to comment.
You can’t perform that action at this time.