Skip to content
Permalink
Browse files

[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 8c64fbc65fa0be8ea83c45b4ee29f17c5f663168
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/composer/qgsatlascomposition.cpp
@@ -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();
@@ -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 )
{

0 comments on commit 8c64fbc

Please sign in to comment.
You can’t perform that action at this time.