Skip to content

Commit

Permalink
fix #4646
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n authored and alexbruy committed Dec 25, 2011
1 parent ea2a434 commit 5c7f817
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/attributetable/qgsattributetablemodel.cpp
Expand Up @@ -424,9 +424,9 @@ QVariant QgsAttributeTableModel::data( const QModelIndex &index, int role ) cons
}
}

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

return val.toString();
Expand Down Expand Up @@ -492,7 +492,7 @@ void QgsAttributeTableModel::executeAction( int action, const QModelIndex &idx )

for ( int i = 0; i < mAttributes.size(); i++ )
{
attributes.insert( i, data( index( idx.row(), i ), Qt::EditRole ) );
attributes.insert( mAttributes[i], data( index( idx.row(), i ), Qt::EditRole ) );
}

mLayer->actions()->doAction( action, attributes, fieldIdx( idx.column() ) );
Expand All @@ -509,7 +509,7 @@ void QgsAttributeTableModel::featureForm( QModelIndex &idx )
f.changeAttribute( mAttributes[i], data( index( idx.row(), i ), Qt::EditRole ) );
}

QgsFeatureAction action( tr( "Attributes changed" ), f, mLayer, -1, this );
QgsFeatureAction action( tr( "Attributes changed" ), f, mLayer, -1, -1, this );
if ( mLayer->isEditable() )
action.editFeature();
else
Expand Down

0 comments on commit 5c7f817

Please sign in to comment.