Skip to content

Commit

Permalink
Set currentfeature expression variable for Atlas printing. Fix #8766
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Nov 7, 2013
1 parent 866cee4 commit bff6fe5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/composer/qgsatlascomposition.cpp
Expand Up @@ -41,6 +41,7 @@ QgsAtlasComposition::QgsAtlasComposition( QgsComposition* composition ) :
QgsExpression::setSpecialColumn( "$feature", QVariant(( int )0 ) );
QgsExpression::setSpecialColumn( "$numpages", QVariant(( int )1 ) );
QgsExpression::setSpecialColumn( "$numfeatures", QVariant(( int )0 ) );
QgsExpression::setSpecialColumn( "$currentfeature", QVariant(( int )0 ) );
}

QgsAtlasComposition::~QgsAtlasComposition()
Expand Down Expand Up @@ -225,6 +226,7 @@ void QgsAtlasComposition::prepareForFeature( int featureI )

// retrieve the next feature, based on its id
mCoverageLayer->getFeatures( QgsFeatureRequest().setFilterFid( mFeatureIds[ featureI ] ) ).nextFeature( mCurrentFeature );
QgsExpression::setSpecialColumn( "$currentfeature", mCurrentFeature.id() );

if ( !mSingleFile && mFilenamePattern.size() > 0 )
{
Expand Down

0 comments on commit bff6fe5

Please sign in to comment.