Skip to content
Permalink
Browse files

fixed misleading error return code in addPart

  • Loading branch information
luipir committed Sep 26, 2017
1 parent 8a4d32f commit 45f041d22572dffbc787f214bfc274d1b6428611
Showing with 6 additions and 2 deletions.
  1. +4 −0 src/app/qgsmaptooladdpart.cpp
  2. +2 −2 src/core/qgsvectorlayereditutils.cpp
@@ -219,6 +219,10 @@ void QgsMapToolAddPart::cadCanvasReleaseEvent( QgsMapMouseEvent * e )
case 6:
errorMessage = tr( "Selected geometry could not be found" );
break;

case 7:
errorMessage = tr( "Update geometry error" );
break;
}

emit messageEmitted( errorMessage, QgsMessageBar::WARNING );
@@ -228,7 +228,7 @@ int QgsVectorLayerEditUtils::addPart( const QgsPointSequenceV2 &points, QgsFeatu
geometry.convertToSingleType();
}
if ( !L->editBuffer()->changeGeometry( featureId, &geometry ) )
errorCode = 2; // ring is not a valid geometry
errorCode = 7; // update geometry error
}
return errorCode;
}
@@ -268,7 +268,7 @@ int QgsVectorLayerEditUtils::addPart( QgsCurveV2* ring, QgsFeatureId featureId )
geometry.convertToSingleType();
}
if ( !L->editBuffer()->changeGeometry( featureId, &geometry ) )
errorCode = 2; // ring is not a valid geometry
errorCode = 7; // update geometry error
}
return errorCode;
}

0 comments on commit 45f041d

Please sign in to comment.
You can’t perform that action at this time.