Skip to content

Commit bff6fe5

Browse files
committedNov 7, 2013
Set currentfeature expression variable for Atlas printing. Fix #8766
1 parent 866cee4 commit bff6fe5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎src/core/composer/qgsatlascomposition.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ QgsAtlasComposition::QgsAtlasComposition( QgsComposition* composition ) :
4141
QgsExpression::setSpecialColumn( "$feature", QVariant(( int )0 ) );
4242
QgsExpression::setSpecialColumn( "$numpages", QVariant(( int )1 ) );
4343
QgsExpression::setSpecialColumn( "$numfeatures", QVariant(( int )0 ) );
44+
QgsExpression::setSpecialColumn( "$currentfeature", QVariant(( int )0 ) );
4445
}
4546

4647
QgsAtlasComposition::~QgsAtlasComposition()
@@ -225,6 +226,7 @@ void QgsAtlasComposition::prepareForFeature( int featureI )
225226

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

229231
if ( !mSingleFile && mFilenamePattern.size() > 0 )
230232
{

0 commit comments

Comments
 (0)
Please sign in to comment.