Skip to content
Permalink
Browse files
Optimise QgsVectorLayerExporter::exportLayer when exporting only sele…
…cted features
  • Loading branch information
nyalldawson committed May 11, 2017
1 parent 75a5d5d commit 446db28a7968446d410fd9f12c393455c9d75773
Showing with 2 additions and 5 deletions.
  1. +2 −5 src/core/qgsvectorlayerexporter.cpp
@@ -326,11 +326,11 @@ QgsVectorLayerExporter::exportLayer( QgsVectorLayer *layer,
QgsFeatureRequest req;
if ( wkbType == QgsWkbTypes::NoGeometry )
req.setFlags( QgsFeatureRequest::NoGeometry );
if ( onlySelected )
req.setFilterFids( layer->selectedFeatureIds() );

QgsFeatureIterator fit = layer->getFeatures( req );

const QgsFeatureIds &ids = layer->selectedFeatureIds();

// Create our transform
if ( destCRS.isValid() )
ct = QgsCoordinateTransform( layer->crs(), destCRS );
@@ -375,9 +375,6 @@ QgsVectorLayerExporter::exportLayer( QgsVectorLayer *layer,
break;
}

if ( onlySelected && !ids.contains( fet.id() ) )
continue;

if ( shallTransform )
{
try

0 comments on commit 446db28

Please sign in to comment.