Skip to content
Permalink
Browse files
[composer] Set the expression context for labels created while atlas …
…preview is enabled (fix #9457)
  • Loading branch information
nyalldawson committed Jan 30, 2014
1 parent 3994c98 commit 78ea81a6bd4342e197f95f099aa14a1104978a55
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/core/composer/qgscomposerlabel.cpp
@@ -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()

0 comments on commit 78ea81a

Please sign in to comment.