Skip to content

Commit 5c7f817

Browse files
jef-nalexbruy
authored andcommitted
fix #4646
1 parent ea2a434 commit 5c7f817

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/app/attributetable/qgsattributetablemodel.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)