mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Simplify code
This commit is contained in:
parent
3fcb085c49
commit
ddc93419df
@ -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() )
|
||||
|
Loading…
x
Reference in New Issue
Block a user