Skip to content
Permalink
Browse files
Fix return value of addTopologicalPoints(QgsGeometry)
  • Loading branch information
gacarrillor authored and github-actions committed Jul 8, 2021
1 parent 3158eb9 commit 5e39ad692a5b239ab0e7125536fc6f8441103d41
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/core/qgsvectorlayereditutils.cpp
@@ -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 )

0 comments on commit 5e39ad6

Please sign in to comment.