Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Cleanups
  • Loading branch information
nyalldawson committed Aug 22, 2015
1 parent 43bcc0c commit 89a362c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/qgsexpressioncontext.cpp
Expand Up @@ -545,7 +545,7 @@ QgsExpressionContextScope* QgsExpressionContextUtils::layerScope( QgsMapLayer* l
QString typeString( QGis::vectorGeometryType( vLayer->geometryType() ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( "layer_geometrytype", typeString, true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( "layer_featurecount", QVariant::fromValue( vLayer->featureCount() ), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( "_fields_", QVariant::fromValue( vLayer->fields() ), true ) );
scope->setFields( vLayer->fields() );
}

//TODO - add functions. Possibilities include:
Expand Down Expand Up @@ -754,8 +754,8 @@ void QgsExpressionContextUtils::setComposerItemVariables( QgsComposerItem* compo
QgsExpressionContext QgsExpressionContextUtils::createFeatureBasedContext( const QgsFeature &feature, const QgsFields &fields )
{
QgsExpressionContextScope* scope = new QgsExpressionContextScope();
scope->setVariable( QString( "_feature_" ), QVariant::fromValue( feature ) );
scope->setVariable( QString( "_fields_" ), QVariant::fromValue( fields ) );
scope->setFeature( feature );
scope->setFields( fields );
return QgsExpressionContext() << scope;
}

Expand Down

0 comments on commit 89a362c

Please sign in to comment.