Skip to content

Commit

Permalink
Fix #11510 graduated renderer causes crash
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Oct 28, 2014
1 parent d73c9d8 commit efc7921
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) )
Expand Down

4 comments on commit efc7921

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@NathanW2
Copy link
Member

@NathanW2 NathanW2 commented on efc7921 Oct 28, 2014 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elpaso
Copy link
Contributor Author

@elpaso elpaso commented on efc7921 Oct 28, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely yes. I'll try that.

@elpaso
Copy link
Contributor Author

@elpaso elpaso commented on efc7921 Oct 28, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like this ?

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

Please sign in to comment.