Skip to content

Commit

Permalink
QgsVectorLayerEditBuffer fix : access mChangedAttributeValues by fid …
Browse files Browse the repository at this point in the history
…keys
  • Loading branch information
blazek committed Sep 22, 2015
1 parent 5af78ab commit 2e441b5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/qgsvectorlayereditbuffer.cpp
Expand Up @@ -572,9 +572,9 @@ QString QgsVectorLayerEditBuffer::dumpEditBuffer()
void QgsVectorLayerEditBuffer::handleAttributeAdded( int index )
{
// go through the changed attributes map and adapt indices
for ( int i = 0; i < mChangedAttributeValues.size(); ++i )
Q_FOREACH ( QgsFeatureId fid, mChangedAttributeValues.keys() )
{
updateAttributeMapIndex( mChangedAttributeValues[i], index, + 1 );
updateAttributeMapIndex( mChangedAttributeValues[fid], index, + 1 );
}

// go through added features and adapt attributes
Expand All @@ -590,9 +590,9 @@ void QgsVectorLayerEditBuffer::handleAttributeAdded( int index )
void QgsVectorLayerEditBuffer::handleAttributeDeleted( int index )
{
// go through the changed attributes map and adapt indices
for ( int i = 0; i < mChangedAttributeValues.size(); ++i )
Q_FOREACH ( QgsFeatureId fid, mChangedAttributeValues.keys() )
{
QgsAttributeMap& attrMap = mChangedAttributeValues[i];
QgsAttributeMap& attrMap = mChangedAttributeValues[fid];
// remove the attribute
if ( attrMap.contains( index ) )
attrMap.remove( index );
Expand Down

0 comments on commit 2e441b5

Please sign in to comment.