Skip to content

Commit

Permalink
Do not show the invalid geom warning if not necessary
Browse files Browse the repository at this point in the history
If the geoms where originally invalid, do not show the
warning.
  • Loading branch information
elpaso committed Oct 6, 2018
1 parent 08b6b60 commit a3bf98d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a3bf98d

Please sign in to comment.