Skip to content

Commit 2e441b5

Browse files
committed
QgsVectorLayerEditBuffer fix : access mChangedAttributeValues by fid keys
1 parent 5af78ab commit 2e441b5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/core/qgsvectorlayereditbuffer.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,9 +572,9 @@ QString QgsVectorLayerEditBuffer::dumpEditBuffer()
572572
void QgsVectorLayerEditBuffer::handleAttributeAdded( int index )
573573
{
574574
// go through the changed attributes map and adapt indices
575-
for ( int i = 0; i < mChangedAttributeValues.size(); ++i )
575+
Q_FOREACH ( QgsFeatureId fid, mChangedAttributeValues.keys() )
576576
{
577-
updateAttributeMapIndex( mChangedAttributeValues[i], index, + 1 );
577+
updateAttributeMapIndex( mChangedAttributeValues[fid], index, + 1 );
578578
}
579579

580580
// go through added features and adapt attributes
@@ -590,9 +590,9 @@ void QgsVectorLayerEditBuffer::handleAttributeAdded( int index )
590590
void QgsVectorLayerEditBuffer::handleAttributeDeleted( int index )
591591
{
592592
// go through the changed attributes map and adapt indices
593-
for ( int i = 0; i < mChangedAttributeValues.size(); ++i )
593+
Q_FOREACH ( QgsFeatureId fid, mChangedAttributeValues.keys() )
594594
{
595-
QgsAttributeMap& attrMap = mChangedAttributeValues[i];
595+
QgsAttributeMap& attrMap = mChangedAttributeValues[fid];
596596
// remove the attribute
597597
if ( attrMap.contains( index ) )
598598
attrMap.remove( index );

0 commit comments

Comments
 (0)