@@ -650,18 +650,18 @@ QgsExpressionContextScope *QgsExpressionContextUtils::atlasScope( const QgsLayou
{
// add some dummy atlas variables. This is done so that as in certain contexts we want to show
// users that these variables are available even if they have no current value
scope->addVariable ( QgsExpressionContextScope::StaticVariable ( QStringLiteral ( " atlas_pagename" ), QString (), true ) );
scope->addVariable ( QgsExpressionContextScope::StaticVariable ( QStringLiteral ( " atlas_feature" ), QVariant::fromValue ( QgsFeature () ), true ) );
scope->addVariable ( QgsExpressionContextScope::StaticVariable ( QStringLiteral ( " atlas_featureid" ), QVariant (), true ) );
scope->addVariable ( QgsExpressionContextScope::StaticVariable ( QStringLiteral ( " atlas_geometry" ), QVariant::fromValue ( QgsGeometry () ), true ) );
scope->addVariable ( QgsExpressionContextScope::StaticVariable ( QStringLiteral ( " atlas_pagename" ), QString (), true , true ) );
scope->addVariable ( QgsExpressionContextScope::StaticVariable ( QStringLiteral ( " atlas_feature" ), QVariant::fromValue ( QgsFeature () ), true , true ) );
scope->addVariable ( QgsExpressionContextScope::StaticVariable ( QStringLiteral ( " atlas_featureid" ), QVariant (), true , true ) );
scope->addVariable ( QgsExpressionContextScope::StaticVariable ( QStringLiteral ( " atlas_geometry" ), QVariant::fromValue ( QgsGeometry () ), true , true ) );
return scope;
}
// add known atlas variables
scope->addVariable ( QgsExpressionContextScope::StaticVariable ( QStringLiteral ( " atlas_totalfeatures" ), atlas->count (), true ) );
scope->addVariable ( QgsExpressionContextScope::StaticVariable ( QStringLiteral ( " atlas_featurenumber" ), atlas->currentFeatureNumber () + 1 , true ) );
scope->addVariable ( QgsExpressionContextScope::StaticVariable ( QStringLiteral ( " atlas_filename" ), atlas->currentFilename (), true ) );
scope->addVariable ( QgsExpressionContextScope::StaticVariable ( QStringLiteral ( " atlas_pagename" ), atlas->nameForPage ( atlas->currentFeatureNumber () ), true ) );
scope->addVariable ( QgsExpressionContextScope::StaticVariable ( QStringLiteral ( " atlas_totalfeatures" ), atlas->count (), true , true ) );
scope->addVariable ( QgsExpressionContextScope::StaticVariable ( QStringLiteral ( " atlas_featurenumber" ), atlas->currentFeatureNumber () + 1 , true , true ) );
scope->addVariable ( QgsExpressionContextScope::StaticVariable ( QStringLiteral ( " atlas_filename" ), atlas->currentFilename (), true , true ) );
scope->addVariable ( QgsExpressionContextScope::StaticVariable ( QStringLiteral ( " atlas_pagename" ), atlas->nameForPage ( atlas->currentFeatureNumber () ), true , true ) );
if ( atlas->enabled () && atlas->coverageLayer () )
{