Skip to content

Commit

Permalink
Reinstate the geometry change verification which is the return code 2…
Browse files Browse the repository at this point in the history
… used by the gps module (qgsgpsinformationwidget.cpp)
  • Loading branch information
lbartoletti authored and nyalldawson committed Feb 12, 2021
1 parent 7e77322 commit fc70957
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/geometry/qgsgeometry.cpp
Expand Up @@ -2602,6 +2602,8 @@ int QgsGeometry::avoidIntersections( const QList<QgsVectorLayer *> &avoidInterse
return 1;
}

QgsWkbTypes::Type geomTypeBeforeModification = wkbType();

bool haveGeometryError = false;
bool hadInvalidGeometry = false;
std::unique_ptr< QgsAbstractGeometry > diffGeom = QgsGeometryEditUtils::avoidIntersections( *( d->geometry ), avoidIntersectionsLayers, hadInvalidGeometry, haveGeometryError, ignoreFeatures );
Expand All @@ -2610,6 +2612,8 @@ int QgsGeometry::avoidIntersections( const QList<QgsVectorLayer *> &avoidInterse
reset( std::move( diffGeom ) );
}

if ( geomTypeBeforeModification != wkbType() )
return 2;
if ( haveGeometryError )
return 3;
if ( hadInvalidGeometry )
Expand Down

0 comments on commit fc70957

Please sign in to comment.