File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ QgsCategorizedSymbolRendererV2::QgsCategorizedSymbolRendererV2( QString attrName
142
142
mSourceColorRamp( NULL ),
143
143
mInvertedColorRamp( false ),
144
144
mScaleMethod( DEFAULT_SCALE_METHOD ),
145
+ mExpression( 0 ),
145
146
mRotationFieldIdx( -1 ),
146
147
mSizeScaleFieldIdx( -1 )
147
148
{
@@ -199,8 +200,9 @@ QgsSymbolV2* QgsCategorizedSymbolRendererV2::symbolForFeature( QgsFeature& featu
199
200
{
200
201
const QgsAttributes& attrs = feature.attributes ();
201
202
QVariant value;
202
- if ( mAttrNum < 0 || mAttrNum >= attrs. count () )
203
+ if ( mAttrNum == - 1 )
203
204
{
205
+ Q_ASSERT ( mExpression );
204
206
value = mExpression ->evaluate ( &feature );
205
207
}
206
208
else
@@ -406,6 +408,7 @@ void QgsCategorizedSymbolRendererV2::stopRender( QgsRenderContext& context )
406
408
delete it2.value ();
407
409
}
408
410
mTempSymbols .clear ();
411
+ delete mExpression ;
409
412
}
410
413
411
414
QList<QString> QgsCategorizedSymbolRendererV2::usedAttributes ()
You can’t perform that action at this time.
0 commit comments