Skip to content
Permalink
Browse files
[composer] Make $rownum in attribute table column expressions evaluat…
…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 a2c13ecdd89baaf197c5ace04258c7e4567cb172
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/core/composer/qgscomposerattributetable.cpp
@@ -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() );

0 comments on commit a2c13ec

Please sign in to comment.