Skip to content

Commit

Permalink
Feature #8725: check QgsFeatureRequest::NoGeometry
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuarte47 committed Dec 17, 2013
1 parent 1481a7e commit 134def2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/qgsfeaturerequest.cpp
Expand Up @@ -571,7 +571,7 @@ bool QgsFeatureRequest::simplifyGeometry( QgsGeometry* geometry, const QgsCoordi
unsigned char* targetWkb = (unsigned char*)malloc( targetWkbSize );
memcpy( targetWkb, wkb, targetWkbSize );
geometry->fromWkb( targetWkb, targetWkbSize );
return true;
return true;
}
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -694,7 +694,7 @@ bool QgsVectorLayer::draw( QgsRenderContext& rendererContext )
.setSubsetOfAttributes( attributes );

// Enable the simplification of the geometries before fetch the features using the current map2pixel context.
if ( mSimplifyDrawing )
if ( mSimplifyDrawing && !(featureRequest.flags() & QgsFeatureRequest::NoGeometry) )
{
featureRequest.setFlags( featureRequest.flags() | QgsFeatureRequest::SimplifyGeometries );
featureRequest.setCoordinateTransform( rendererContext.coordinateTransform() );
Expand Down Expand Up @@ -1224,7 +1224,7 @@ QgsFeatureIterator QgsVectorLayer::getFeatures( const QgsFeatureRequest& request
if ( !mDataProvider )
return QgsFeatureIterator();

if ( mSimplifyDrawing && request.flags() & QgsFeatureRequest::SimplifyGeometries )
if ( mSimplifyDrawing && (request.flags() & QgsFeatureRequest::SimplifyGeometries) && !(request.flags() & QgsFeatureRequest::NoGeometry) )
return QgsFeatureIterator( new QgsSimplifiedVectorLayerFeatureIterator( this, request ) );

return QgsFeatureIterator( new QgsVectorLayerFeatureIterator( this, request ) );
Expand Down

0 comments on commit 134def2

Please sign in to comment.