Skip to content

Commit

Permalink
Keep selection if exchanging ids for added features, safety check for…
Browse files Browse the repository at this point in the history
… 0 geometry in splitFeatures method
  • Loading branch information
mhugent committed May 30, 2013
1 parent 15539f3 commit 4c02d7f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/qgsvectorlayereditbuffer.cpp
Expand Up @@ -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() );
}
Expand Down
4 changes: 4 additions & 0 deletions src/core/qgsvectorlayereditutils.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 4c02d7f

Please sign in to comment.