Skip to content

Commit 181c0c4

Browse files
author
Hugo Mercier
committedApr 25, 2016
Minor fixes in intersection removal for the reshape tool
1 parent 44cccfc commit 181c0c4

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed
 

‎src/app/qgsmaptoolreshape.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,21 @@ void QgsMapToolReshape::cadCanvasReleaseEvent( QgsMapMouseEvent * e )
103103
//avoid intersections on polygon layers
104104
if ( vlayer->geometryType() == QGis::Polygon )
105105
{
106-
107106
//ignore all current layer features as they should be reshaped too
108107
QMap<QgsVectorLayer*, QSet<QgsFeatureId>> ignoreFeatures;
109108
ignoreFeatures.insert( vlayer, vlayer->allFeatureIds() );
110109

111-
int avoidIntersectionsReturn = geom->avoidIntersections( ignoreFeatures );
112-
if ( avoidIntersectionsReturn == 1 )
110+
if ( geom->avoidIntersections( ignoreFeatures ) != 0 )
113111
{
114-
//not a polygon type. Impossible to get there
112+
emit messageEmitted( tr( "An error was reported during intersection removal" ), QgsMessageBar::CRITICAL );
113+
vlayer->destroyEditCommand();
114+
stopCapturing();
115+
return;
115116
}
116-
if ( geom->isGeosEmpty() ) //avoid intersection might have removed the whole geometry
117+
118+
if ( geom->isGeosEmpty() ) //intersection removal might have removed the whole geometry
117119
{
118-
emit messageEmitted( tr( "The feature cannot be reshaped because resulting geometry is empty" ), QgsMessageBar::CRITICAL );
120+
emit messageEmitted( tr( "The feature cannot be reshaped because the resulting geometry is empty" ), QgsMessageBar::CRITICAL );
119121
vlayer->destroyEditCommand();
120122
stopCapturing();
121123
return;

0 commit comments

Comments
 (0)
Please sign in to comment.