Skip to content
Permalink
Browse files

Keep selection if exchanging ids for added features, safety check for…

… 0 geometry in splitFeatures method
  • Loading branch information
mhugent committed May 30, 2013
1 parent 15539f3 commit 4c02d7ff9539fce1b4c870d6f9da057f221b7eb0
Showing with 10 additions and 0 deletions.
  1. +6 −0 src/core/qgsvectorlayereditbuffer.cpp
  2. +4 −0 src/core/qgsvectorlayereditutils.cpp
@@ -386,6 +386,12 @@ bool QgsVectorLayerEditBuffer::commitChanges( QStringList& commitErrors )
{
if ( featuresToAdd[i].id() != ids[i] )
{
//update selection
if ( L->mSelectedFeatureIds.contains( ids[i] ) )
{
L->mSelectedFeatureIds.remove( ids[i] );
L->mSelectedFeatureIds.insert( featuresToAdd[i].id() );
}
emit featureDeleted( ids[i] );
emit featureAdded( featuresToAdd[i].id() );
}
@@ -224,6 +224,10 @@ int QgsVectorLayerEditUtils::splitFeatures( const QList<QgsPoint>& splitLine, bo
QgsFeatureList::iterator select_it = featureList.begin();
for ( ; select_it != featureList.end(); ++select_it )
{
if ( !select_it->geometry() )
{
continue;
}
QList<QgsGeometry*> newGeometries;
QList<QgsPoint> topologyTestPoints;
QgsGeometry* newGeometry = 0;

0 comments on commit 4c02d7f

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