File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -1869,7 +1869,20 @@ QgsVectorFileWriter::WriterError QgsVectorFileWriter::writeAsVectorFormat( QgsVe
1869
1869
// Shapefiles might contain multi types although wkbType() only reports singles
1870
1870
if ( layer->storageType () == " ESRI Shapefile" )
1871
1871
{
1872
- wkbType = QGis::multiType ( wkbType );
1872
+ const QgsFeatureIds &ids = layer->selectedFeaturesIds ();
1873
+ QgsFeatureIterator fit = layer->getFeatures ();
1874
+ QgsFeature fet;
1875
+ while ( fit.nextFeature ( fet ) )
1876
+ {
1877
+ if ( onlySelected && !ids.contains ( fet.id () ) )
1878
+ continue ;
1879
+
1880
+ if ( fet.geometry () && fet.geometry ()->wkbType () == QGis::multiType ( wkbType ) )
1881
+ {
1882
+ wkbType = QGis::multiType ( wkbType );
1883
+ break ;
1884
+ }
1885
+ }
1873
1886
}
1874
1887
}
1875
1888
You can’t perform that action at this time.
0 commit comments