@@ -374,13 +374,12 @@ void QgsSelectedFeature::createVertexMapPolygon()
374374 for ( int i2 = 0 ; i2 < polygon.size (); i2++ )
375375 {
376376 const QgsPolyline& poly = polygon[i2];
377- int i;
378- for ( i = 0 ; i < poly.size (); i++ )
377+ for ( int i = 0 ; i < poly.size (); i++ )
379378 {
380379 mVertexMap .insert ( y + i, new QgsVertexEntry ( mCanvas , mVlayer , poly[i], i, tr ( " ring %1, vertex %2" ).arg ( i2 ).arg ( i ) ) );
381380 }
382- mVertexMap [y + i - 1 ]->setEqual ( y );
383- mVertexMap [y]->setEqual ( y + i - 1 );
381+ mVertexMap [y + poly. size () - 1 ]->setEqual ( y );
382+ mVertexMap [y]->setEqual ( y + poly. size () - 1 );
384383 y += poly.size ();
385384 }
386385 }
@@ -395,13 +394,12 @@ void QgsSelectedFeature::createVertexMapPolygon()
395394 {
396395 // iterating through polygon rings
397396 const QgsPolyline& poly = poly2[i3];
398- int i;
399- for ( i = 0 ; i < poly.size (); i++ )
397+ for ( int i = 0 ; i < poly.size (); i++ )
400398 {
401399 mVertexMap .insert ( y + i, new QgsVertexEntry ( mCanvas , mVlayer , poly[i], y + i - 1 , tr ( " polygon %1, ring %2, vertex %3" ).arg ( i2 ).arg ( i3 ).arg ( i ) ) );
402400 }
403- mVertexMap [y + i - 1 ]->setEqual ( y );
404- mVertexMap [y]->setEqual ( y + i - 1 );
401+ mVertexMap [y + poly. size () - 1 ]->setEqual ( y );
402+ mVertexMap [y]->setEqual ( y + poly. size () - 1 );
405403 y += poly.size ();
406404 }
407405 }
@@ -420,8 +418,7 @@ void QgsSelectedFeature::createVertexMapLine()
420418 {
421419 // iterating through polylines
422420 QgsPolyline poly = mLine [i2];
423- int i;
424- for ( i = 0 ; i < poly.size (); i++ )
421+ for ( int i = 0 ; i < poly.size (); i++ )
425422 {
426423 mVertexMap .insert ( y + i, new QgsVertexEntry ( mCanvas , mVlayer , poly[i], i, tr ( " polyline %1, vertex %2" ).arg ( i2 ).arg ( i ) ) );
427424 }
@@ -431,8 +428,7 @@ void QgsSelectedFeature::createVertexMapLine()
431428 else
432429 {
433430 QgsPolyline poly = mGeometry ->asPolyline ();
434- int i;
435- for ( i = 0 ; i < poly.size (); i++ )
431+ for ( int i = 0 ; i < poly.size (); i++ )
436432 {
437433 mVertexMap .insert ( i, new QgsVertexEntry ( mCanvas , mVlayer , poly[i], i, tr ( " vertex %1" ).arg ( i ) ) );
438434 }
@@ -447,10 +443,9 @@ void QgsSelectedFeature::createVertexMapPoint()
447443 {
448444 // multipoint
449445 QgsMultiPoint poly = mGeometry ->asMultiPoint ();
450- int i;
451- for ( i = 0 ; i < poly.size (); i++ )
446+ for ( int i = 0 ; i < poly.size (); i++ )
452447 {
453- mVertexMap .insert ( i, new QgsVertexEntry ( mCanvas , mVlayer , poly[i], 1 , tr ( " point %1" ).arg ( i ) ) );
448+ mVertexMap .insert ( i, new QgsVertexEntry ( mCanvas , mVlayer , poly[i], 1 , tr ( " point %1" ).arg ( i ) ) );
454449 }
455450 }
456451 else
0 commit comments