Skip to content

Commit

Permalink
[composer] Set the expression context for labels created while atlas …
Browse files Browse the repository at this point in the history
…preview is enabled (fix #9457)
  • Loading branch information
nyalldawson committed Jan 30, 2014
1 parent 3994c98 commit 78ea81a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/composer/qgscomposerlabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ QgsComposerLabel::QgsComposerLabel( QgsComposition *composition ):
//default to a 10 point font size
mFont.setPointSizeF( 10 );

if ( mComposition && mComposition->atlasMode() == QgsComposition::PreviewAtlas )
{
//a label added while atlas preview is enabled needs to have the expression context set,
//otherwise fields in the label aren't correctly evaluated until atlas preview feature changes (#9457)
setExpressionContext( mComposition->atlasComposition().currentFeature(), mComposition->atlasComposition().coverageLayer() );
}
}

QgsComposerLabel::~QgsComposerLabel()
Expand Down

0 comments on commit 78ea81a

Please sign in to comment.