Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jun 11, 2019
1 parent 3fcb085 commit ddc9341
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/app/qgsmaptooladdfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,11 @@ void QgsMapToolAddFeature::digitized( QgsFeature &f )

//use always topological editing for avoidIntersection.
//Otherwise, no way to guarantee the geometries don't have a small gap in between.
QList<QgsVectorLayer *> intersectionLayers = QgsProject::instance()->avoidIntersectionsLayers();
bool avoidIntersection = !intersectionLayers.isEmpty();
if ( avoidIntersection ) //try to add topological points also to background layers
const QList<QgsVectorLayer *> intersectionLayers = QgsProject::instance()->avoidIntersectionsLayers();

if ( !intersectionLayers.isEmpty() ) //try to add topological points also to background layers
{
const auto constIntersectionLayers = intersectionLayers;
for ( QgsVectorLayer *vl : constIntersectionLayers )
for ( QgsVectorLayer *vl : intersectionLayers )
{
//can only add topological points if background layer is editable...
if ( vl->geometryType() == QgsWkbTypes::PolygonGeometry && vl->isEditable() )
Expand Down

0 comments on commit ddc9341

Please sign in to comment.