File tree 1 file changed +9
-10
lines changed
1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -619,17 +619,16 @@ QgsRectangle QgsVectorLayer::boundingBoxOfSelected()
619
619
QgsFeature fet;
620
620
if ( mDataProvider ->capabilities () & QgsVectorDataProvider::SelectAtId )
621
621
{
622
- Q_FOREACH ( QgsFeatureId fid, mSelectedFeatureIds )
622
+ QgsFeatureIterator fit = getFeatures ( QgsFeatureRequest ()
623
+ .setFilterFids ( mSelectedFeatureIds )
624
+ .setSubsetOfAttributes ( QgsAttributeList () ) );
625
+
626
+ while ( fit.nextFeature ( fet ) )
623
627
{
624
- if ( getFeatures ( QgsFeatureRequest ()
625
- .setFilterFid ( fid )
626
- .setSubsetOfAttributes ( QgsAttributeList () ) )
627
- .nextFeature ( fet ) &&
628
- fet.constGeometry () )
629
- {
630
- r = fet.constGeometry ()->boundingBox ();
631
- retval.combineExtentWith ( &r );
632
- }
628
+ if ( !fet.constGeometry () || fet.constGeometry ()->isEmpty () )
629
+ continue ;
630
+ r = fet.constGeometry ()->boundingBox ();
631
+ retval.combineExtentWith ( &r );
633
632
}
634
633
}
635
634
else
You can’t perform that action at this time.
0 commit comments