Skip to content

Commit

Permalink
don't try to add attributes twice, if some attribute change fails
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@8208 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Mar 12, 2008
1 parent c6d4738 commit 23a8958
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/qgsattributetable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,10 @@ bool QgsAttributeTable::commitChanges(QgsVectorLayer* layer)
{
// add new attributes beforehand, so attribute changes can be applied
isSuccessful = layer->commitAttributeChanges(QgsAttributeIds(), mAddedAttributes, QgsChangedAttributesMap());

if(isSuccessful)
// forget added attributes on successful addition
mAddedAttributes.clear();
}

if(isSuccessful)
Expand Down

0 comments on commit 23a8958

Please sign in to comment.