Skip to content

Commit 06aeb14

Browse files
committedDec 23, 2011
fix #4646
1 parent 9461465 commit 06aeb14

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎src/gui/attributetable/qgsattributetablemodel.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,9 @@ void QgsAttributeTableModel::attributeValueChanged( QgsFeatureId fid, int idx, c
181181
{
182182
if ( mFeatureMap.contains( fid ) )
183183
{
184-
mFeatureMap[ fid ].changeAttribute( fieldCol( idx ), value );
184+
mFeatureMap[ fid ].changeAttribute( idx, value );
185185
}
186+
186187
setData( index( idToRow( fid ), fieldCol( idx ) ), value, Qt::EditRole );
187188
}
188189

@@ -460,9 +461,9 @@ QVariant QgsAttributeTableModel::data( const QModelIndex &index, int role ) cons
460461
}
461462
}
462463

463-
if ( role == Qt::DisplayRole && mValueMaps.contains( index.column() ) )
464+
if ( role == Qt::DisplayRole && mValueMaps.contains( fieldId ) )
464465
{
465-
return mValueMaps[ index.column()]->key( val.toString(), QString( "(%1)" ).arg( val.toString() ) );
466+
return mValueMaps[ fieldId ]->key( val.toString(), QString( "(%1)" ).arg( val.toString() ) );
466467
}
467468

468469
return val.toString();
@@ -528,7 +529,7 @@ void QgsAttributeTableModel::executeAction( int action, const QModelIndex &idx )
528529

529530
for ( int i = 0; i < mAttributes.size(); i++ )
530531
{
531-
attributes.insert( i, data( index( idx.row(), i ), Qt::EditRole ) );
532+
attributes.insert( mAttributes[i], data( index( idx.row(), i ), Qt::EditRole ) );
532533
}
533534

534535
mLayer->actions()->doAction( action, attributes, fieldIdx( idx.column() ) );

0 commit comments

Comments
 (0)
Please sign in to comment.