@@ -171,7 +171,7 @@ void QgsMapToolNodeTool::createMovingRubberBands()
171
171
rb->addPoint ( toMapCoordinates ( mCanvas ->currentLayer (), vertexMap[beforeVertex].point ), false );
172
172
mSelectionFeature ->setRubberBandValues ( beforeVertex, true , lastRubberBand, index );
173
173
vertexMap[beforeVertex].inRubberBand = true ;
174
- index ++;
174
+ index++;
175
175
}
176
176
while ( vertex != -1 && vertexMap[vertex].selected && !vertexMap[vertex].inRubberBand )
177
177
{
@@ -185,18 +185,18 @@ void QgsMapToolNodeTool::createMovingRubberBands()
185
185
// setting values about added vertex
186
186
mSelectionFeature ->setRubberBandValues ( vertex, true , lastRubberBand, index );
187
187
vertexMap[vertex].inRubberBand = true ;
188
- index ++;
188
+ index++;
189
189
geometry->adjacentVertices ( vertex, beforeVertex, vertex );
190
190
}
191
191
if ( vertex != -1 && !vertexMap[vertex].selected ) // add last point not moving if exists
192
192
{
193
193
rb->addPoint ( toMapCoordinates ( mCanvas ->currentLayer (), vertexMap[vertex].point ), true );
194
194
mSelectionFeature ->setRubberBandValues ( vertex, true , lastRubberBand, index );
195
195
vertexMap[vertex].inRubberBand = true ;
196
- index ++;
196
+ index++;
197
197
}
198
198
mQgsRubberBands .append ( rb );
199
- lastRubberBand ++;
199
+ lastRubberBand++;
200
200
}
201
201
}
202
202
}
@@ -392,7 +392,7 @@ void QgsMapToolNodeTool::canvasMoveEvent( QMouseEvent * e )
392
392
double x = mapCoords.x () + posMapCoord.x () - firstCoords.x ();
393
393
double y = mapCoords.y () + posMapCoord.y () - firstCoords.y ();
394
394
395
- mQgsRubberBands [vertexMap[i].rubberBandNr ]->movePoint ( vertexMap[i].index + 1 , QgsPoint ( x, y ) );
395
+ mQgsRubberBands [vertexMap[i].rubberBandNr ]->movePoint ( vertexMap[i].index , QgsPoint ( x, y ) );
396
396
if ( vertexMap[i].index == 0 )
397
397
{
398
398
mQgsRubberBands [vertexMap[i].rubberBandNr ]->movePoint ( 0 , QgsPoint ( x, y ) );
@@ -405,16 +405,16 @@ void QgsMapToolNodeTool::canvasMoveEvent( QMouseEvent * e )
405
405
double offsetY = posMapCoord.y () - mPosMapCoordBackup .y ();
406
406
for ( int i = 0 ; i < mTopologyRubberBand .size (); i++ )
407
407
{
408
- for ( int pointIndex = 0 ; pointIndex < mTopologyRubberBand [i]->numberOfVertices () - 1 ; pointIndex ++ )
408
+ for ( int pointIndex = 0 ; pointIndex < mTopologyRubberBand [i]->numberOfVertices () - 1 ; pointIndex++ )
409
409
{
410
410
if ( mTopologyRubberBandVertexes [i]->contains ( pointIndex ) )
411
411
{
412
- const QgsPoint* point = mTopologyRubberBand [i]->getPoint ( 0 , pointIndex + 1 );
412
+ const QgsPoint* point = mTopologyRubberBand [i]->getPoint ( 0 , pointIndex );
413
413
if ( point == 0 )
414
414
{
415
415
break ;
416
416
}
417
- mTopologyRubberBand [i]->movePoint ( pointIndex + 1 , QgsPoint ( point->x () + offsetX, point->y () + offsetY ) );
417
+ mTopologyRubberBand [i]->movePoint ( pointIndex, QgsPoint ( point->x () + offsetX, point->y () + offsetY ) );
418
418
if ( pointIndex == 0 )
419
419
{
420
420
mTopologyRubberBand [i]->movePoint ( pointIndex , QgsPoint ( point->x () + offsetX, point->y () + offsetY ) );
@@ -548,7 +548,7 @@ void QgsMapToolNodeTool::canvasPressEvent( QMouseEvent * e )
548
548
mSelectAnother = true ;
549
549
QList<QgsSnappingResult>::iterator it = snapResults.begin ();
550
550
QgsSnappingResult snapResult;
551
- for ( ; it != snapResults.end () ; ++it )
551
+ for ( ; it != snapResults.end (); ++it )
552
552
{
553
553
if ( it->snappedAtGeometry == mSelectionFeature ->featureId () )
554
554
{
@@ -985,7 +985,7 @@ void SelectionFeature::deleteSelectedVertexes()
985
985
QMultiMap<double , QgsSnappingResult> currentResultList;
986
986
mVlayer ->beginEditCommand ( QObject::tr ( " Deleted vertices" ) );
987
987
int count = 0 ;
988
- for ( int i = mVertexMap .size () - 1 ; i > -1 ; i-- )
988
+ for ( int i = mVertexMap .size () - 1 ; i > -1 ; i-- )
989
989
{
990
990
if ( mVertexMap [i].selected )
991
991
{
@@ -1053,7 +1053,7 @@ void SelectionFeature::moveSelectedVertexes( double changeX, double changeY )
1053
1053
mVlayer ->beginEditCommand ( QObject::tr ( " Moved vertices" ) );
1054
1054
int topologicalEditing = QgsProject::instance ()->readNumEntry ( " Digitizing" , " /TopologicalEditing" , 0 );
1055
1055
QMultiMap<double , QgsSnappingResult> currentResultList;
1056
- for ( int i = mVertexMap .size () - 1 ; i > -1 ; i-- )
1056
+ for ( int i = mVertexMap .size () - 1 ; i > -1 ; i-- )
1057
1057
{
1058
1058
if ( mVertexMap [i].selected )
1059
1059
{
@@ -1191,7 +1191,7 @@ void SelectionFeature::createVertexMapPolygon()
1191
1191
}
1192
1192
else // multipolygon
1193
1193
{
1194
- for ( int i2 = 0 ; i2 < mFeature ->geometry ()->asMultiPolygon ().size (); i2++ )
1194
+ for ( int i2 = 0 ; i2 < mFeature ->geometry ()->asMultiPolygon ().size (); i2++ )
1195
1195
{ // iterating through polygons
1196
1196
QgsPolygon poly2 = mFeature ->geometry ()->asMultiPolygon ()[i2];
1197
1197
for ( int i3 = 0 ; i3 < poly2.size (); i3++ )
@@ -1357,7 +1357,7 @@ void SelectionFeature::deselectVertex( int vertexNr )
1357
1357
1358
1358
void SelectionFeature::deselectAllVertexes ()
1359
1359
{
1360
- for ( int i = 0 ; i < mVertexMap .size () ; i++ )
1360
+ for ( int i = 0 ; i < mVertexMap .size (); i++ )
1361
1361
{
1362
1362
mVertexMap [i].selected = false ;
1363
1363
mVertexMap [i].vertexMarker ->setColor ( Qt::red );
@@ -1400,7 +1400,7 @@ void SelectionFeature::invertVertexSelection( int vertexNr, bool invert )
1400
1400
void SelectionFeature::updateVertexMarkersPosition ( QgsMapCanvas* canvas )
1401
1401
{
1402
1402
// function for on-line updating vertex markers without refresh of canvas
1403
- for ( int i = 0 ; i < mVertexMap .size () ; i++ )
1403
+ for ( int i = 0 ; i < mVertexMap .size (); i++ )
1404
1404
{
1405
1405
mVertexMap [i].vertexMarker ->setCenter ( mCanvas ->mapRenderer ()->layerToMapCoordinates ( mVlayer , mVertexMap [i].point ) );
1406
1406
mVertexMap [i].vertexMarker ->update ();
0 commit comments