Skip to content

Commit

Permalink
Fix return value of addTopologicalPoints(QgsGeometry)
Browse files Browse the repository at this point in the history
  • Loading branch information
gacarrillor authored and nyalldawson committed Jul 22, 2021
1 parent c93bcc1 commit ec13b33
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/qgsvectorlayereditutils.cpp
Expand Up @@ -543,19 +543,19 @@ int QgsVectorLayerEditUtils::addTopologicalPoints( const QgsGeometry &geom )
return 1;
}

int returnVal = 0;
bool pointsAdded = false;

QgsAbstractGeometry::vertex_iterator it = geom.vertices_begin();
while ( it != geom.vertices_end() )
{
if ( addTopologicalPoints( *it ) != 0 )
if ( addTopologicalPoints( *it ) == 0 )
{
returnVal = 2;
pointsAdded = true;
}
++it;
}

return returnVal;
return pointsAdded ? 0 : 2;
}

int QgsVectorLayerEditUtils::addTopologicalPoints( const QgsPoint &p )
Expand Down

0 comments on commit ec13b33

Please sign in to comment.