From a3bf98d9a6053942f735174e8802559eead34cf5 Mon Sep 17 00:00:00 2001 From: Alessandro Pasotti Date: Sat, 6 Oct 2018 11:38:24 +0200 Subject: [PATCH] Do not show the invalid geom warning if not necessary If the geoms where originally invalid, do not show the warning. --- src/app/qgisapp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index 0bc072e6509..13149127759 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -8629,6 +8629,7 @@ void QgisApp::pasteFromClipboard( QgsMapLayer *destinationLayer ) } QgsGeometry geom = featureIt->geometry(); + bool geomWasInvalid = geom.isEmpty() || geom.isNull( ); if ( featureIt->hasGeometry() ) { // convert geometry to match destination layer @@ -8653,7 +8654,7 @@ void QgisApp::pasteFromClipboard( QgsMapLayer *destinationLayer ) // avoid intersection if enabled in digitize settings geom.avoidIntersections( QgsProject::instance()->avoidIntersectionsLayers() ); } - if ( geom.isEmpty() || geom.isNull( ) ) + if ( ! geomWasInvalid && ( geom.isEmpty() || geom.isNull( ) ) ) invalidGeometriesCount++; // now create new feature using pasted feature as a template. This automatically handles default