File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -1164,11 +1164,12 @@ QgsFeature* SelectionFeature::feature()
1164
1164
void SelectionFeature::createVertexMapPolygon ()
1165
1165
{
1166
1166
int y = 0 ;
1167
- if ( !mFeature ->geometry ()->asPolygon ().empty () )
1167
+ QgsPolygon polygon = mFeature ->geometry ()->asPolygon ();
1168
+ if ( !polygon.empty () )
1168
1169
{ // polygon
1169
- for ( int i2 = 0 ; i2 < mFeature -> geometry ()-> asPolygon () .size (); i2++ )
1170
+ for ( int i2 = 0 ; i2 < polygon .size (); i2++ )
1170
1171
{
1171
- QgsPolyline poly = mFeature -> geometry ()-> asPolygon () [i2];
1172
+ const QgsPolyline& poly = polygon [i2];
1172
1173
int i;
1173
1174
for ( i = 0 ; i < poly.size (); i++ )
1174
1175
{
@@ -1191,12 +1192,13 @@ void SelectionFeature::createVertexMapPolygon()
1191
1192
}
1192
1193
else // multipolygon
1193
1194
{
1194
- for ( int i2 = 0 ; i2 < mFeature ->geometry ()->asMultiPolygon ().size (); i2++ )
1195
+ QgsMultiPolygon multiPolygon = mFeature ->geometry ()->asMultiPolygon ();
1196
+ for ( int i2 = 0 ; i2 < multiPolygon.size (); i2++ )
1195
1197
{ // iterating through polygons
1196
- QgsPolygon poly2 = mFeature -> geometry ()-> asMultiPolygon () [i2];
1198
+ const QgsPolygon& poly2 = multiPolygon [i2];
1197
1199
for ( int i3 = 0 ; i3 < poly2.size (); i3++ )
1198
1200
{ // iterating through polygon rings
1199
- QgsPolyline poly = poly2[i3];
1201
+ const QgsPolyline& poly = poly2[i3];
1200
1202
int i;
1201
1203
for ( i = 0 ; i < poly.size (); i++ )
1202
1204
{
You can’t perform that action at this time.
0 commit comments