Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[composer] Make sure $feature has the same value in composer labels a…
…s it does when used in filename expressions
  • Loading branch information
nyalldawson committed Jan 1, 2014
1 parent 21a85c6 commit 8c64fbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/composer/qgsatlascomposition.cpp
Expand Up @@ -296,6 +296,7 @@ void QgsAtlasComposition::prepareForFeature( int featureI )

QgsExpression::setSpecialColumn( "$atlasfeatureid", mCurrentFeature.id() );
QgsExpression::setSpecialColumn( "$atlasgeometry", QVariant::fromValue( *mCurrentFeature.geometry() ) );
QgsExpression::setSpecialColumn( "$feature", QVariant(( int )featureI + 1 ) );

// generate filename for current feature
evalFeatureFilename();
Expand Down Expand Up @@ -367,7 +368,6 @@ void QgsAtlasComposition::prepareForFeature( int featureI )
// evaluate label expressions
QList<QgsComposerLabel*> labels;
mComposition->composerItems( labels );
QgsExpression::setSpecialColumn( "$feature", QVariant(( int )featureI + 1 ) );

for ( QList<QgsComposerLabel*>::iterator lit = labels.begin(); lit != labels.end(); ++lit )
{
Expand Down

0 comments on commit 8c64fbc

Please sign in to comment.