Skip to content
Permalink
Browse files
Allow preparing expressions in QgsDataDefined without requiring a layer
  • Loading branch information
nyalldawson committed Jul 4, 2014
1 parent 176e6c8 commit 12f52690f318f117088eef06b2112c1268d9889c
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/core/qgsdatadefined.cpp
@@ -65,7 +65,17 @@ bool QgsDataDefined::prepareExpression( QgsVectorLayer* layer )
}
}

mExpression->prepare( layer->pendingFields() );
if ( layer )
{
mExpression->prepare( layer->pendingFields() );
}
else
{
//preparing expression without a layer set, so pass empty field list
QgsFields empty;
mExpression->prepare( empty );
}

if ( mExpression->hasEvalError() )
{
QgsDebugMsg( "Prepare error:" + mExpression->evalErrorString() );

0 comments on commit 12f5269

Please sign in to comment.