Skip to content
Permalink
Browse files
Fix return value of addTopologicalPoints(QgsGeometry)
  • Loading branch information
gacarrillor committed Jul 5, 2021
1 parent f0dc0d9 commit 966ac4c8246d7b61df538bb710e0ab29ca81505d
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/core/vector/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 966ac4c

Please sign in to comment.