Skip to content
Permalink
Browse files

Fix #11510 graduated renderer causes crash

  • Loading branch information
elpaso committed Oct 28, 2014
1 parent d73c9d8 commit efc7921c977f20d23e45f61ebd5e10d5903e8e01
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
@@ -965,7 +965,7 @@ QList<double> QgsGraduatedSymbolRendererV2::getDataValues( QgsVectorLayer *vlaye
else
lst = expression->referencedColumns();

QgsFeatureIterator fit = vlayer->getFeatures( QgsFeatureRequest().setFlags( QgsFeatureRequest::NoGeometry ).setSubsetOfAttributes( lst, vlayer->pendingFields() ) );
QgsFeatureIterator fit = vlayer->getFeatures( QgsFeatureRequest().setSubsetOfAttributes( lst, vlayer->pendingFields() ) );

// create list of non-null attribute values
while ( fit.nextFeature( f ) )

4 comments on commit efc7921

@nyalldawson

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson replied Oct 28, 2014

@elpaso Wouldn't it be better to check if the expression requires geometry (ie QgsExpression::needsGeometry), and only fetch it if required?

@NathanW2

This comment has been minimized.

Copy link
Member

@NathanW2 NathanW2 replied Oct 28, 2014

@elpaso

This comment has been minimized.

Copy link
Contributor Author

@elpaso elpaso replied Oct 28, 2014

Absolutely yes. I'll try that.

@elpaso

This comment has been minimized.

Copy link
Contributor Author

@elpaso elpaso replied Oct 28, 2014

Like this ?

QgsFeatureIterator fit = vlayer->getFeatures( QgsFeatureRequest().setFlags( expression->needsGeometry() ? QgsFeatureRequest::NoFlags : QgsFeatureRequest::NoGeometry ).setSubsetOfAttributes( lst, vlayer->pendingFields() ) );

Please sign in to comment.
You can’t perform that action at this time.