Skip to content

Commit db036f6

Browse files
author
mhugent
committed
Applied patch from Adrien to remove negative selection ids when commiting added features
git-svn-id: http://svn.osgeo.org/qgis/trunk@8783 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 1d1bb77 commit db036f6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/core/qgsvectorlayer.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -2476,6 +2476,15 @@ bool QgsVectorLayer::commitChanges()
24762476
}
24772477
else
24782478
{
2479+
//Remove all negative Id in selected features as they are not valid any more after commit
2480+
if(mSelectedFeatureIds.size() > 0)
2481+
{
2482+
for(QgsFeatureList::iterator it = mAddedFeatures.begin(); it != mAddedFeatures.end(); ++it)
2483+
{
2484+
mSelectedFeatureIds.remove(it->featureId());
2485+
}
2486+
}
2487+
24792488
// done, remove features from the list
24802489
mAddedFeatures.clear();
24812490
addedFeaturesOk = TRUE;

0 commit comments

Comments
 (0)