Skip to content
Permalink
Browse files

QgsVectorLayerEditBuffer fix : access mChangedAttributeValues by fid …

…keys
  • Loading branch information
blazek committed Sep 22, 2015
1 parent 5af78ab commit 2e441b55c1d506399f8218d3e30eb1350b014074
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/core/qgsvectorlayereditbuffer.cpp
@@ -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
@@ -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 );

0 comments on commit 2e441b5

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