Skip to content

Commit

Permalink
[composer] Make $rownum in attribute table column expressions evaluat…
Browse files Browse the repository at this point in the history
…e to current row number (works correctly only if no sort columns are specified - in future release sorting for attribute tables should be reworked so that it is done prior to fetching features)
  • Loading branch information
nyalldawson committed Jun 23, 2014
1 parent 787f1a6 commit a2c13ec
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core/composer/qgscomposerattributetable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ bool QgsComposerAttributeTable::getFeatureAttributes( QList<QgsAttributeMap> &at
{
// Lets assume it's an expression
QgsExpression* expression = new QgsExpression(( *columnIt )->attribute() );
expression->setCurrentRowNumber( counter + 1 );
expression->prepare( mVectorLayer->pendingFields() );
QVariant value = expression->evaluate( f ) ;
attributeMaps.last().insert( i, value.toString() );
Expand Down

0 comments on commit a2c13ec

Please sign in to comment.