@@ -424,9 +424,9 @@ QVariant QgsAttributeTableModel::data( const QModelIndex &index, int role ) cons
424424 }
425425 }
426426
427- if ( role == Qt::DisplayRole && mValueMaps .contains ( index. column () ) )
427+ if ( role == Qt::DisplayRole && mValueMaps .contains ( fieldId ) )
428428 {
429- return mValueMaps [ index. column () ]->key ( val.toString (), QString ( " (%1)" ).arg ( val.toString () ) );
429+ return mValueMaps [ fieldId ]->key ( val.toString (), QString ( " (%1)" ).arg ( val.toString () ) );
430430 }
431431
432432 return val.toString ();
@@ -492,7 +492,7 @@ void QgsAttributeTableModel::executeAction( int action, const QModelIndex &idx )
492492
493493 for ( int i = 0 ; i < mAttributes .size (); i++ )
494494 {
495- attributes.insert ( i , data ( index ( idx.row (), i ), Qt::EditRole ) );
495+ attributes.insert ( mAttributes [i] , data ( index ( idx.row (), i ), Qt::EditRole ) );
496496 }
497497
498498 mLayer ->actions ()->doAction ( action, attributes, fieldIdx ( idx.column () ) );
@@ -509,7 +509,7 @@ void QgsAttributeTableModel::featureForm( QModelIndex &idx )
509509 f.changeAttribute ( mAttributes [i], data ( index ( idx.row (), i ), Qt::EditRole ) );
510510 }
511511
512- QgsFeatureAction action ( tr ( " Attributes changed" ), f, mLayer , -1 , this );
512+ QgsFeatureAction action ( tr ( " Attributes changed" ), f, mLayer , -1 , - 1 , this );
513513 if ( mLayer ->isEditable () )
514514 action.editFeature ();
515515 else
0 commit comments