Skip to content

Commit

Permalink
fixed misleading error return code in addPart
Browse files Browse the repository at this point in the history
  • Loading branch information
luipir committed Sep 26, 2017
1 parent 8a4d32f commit 45f041d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/app/qgsmaptooladdpart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsvectorlayereditutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 45f041d

Please sign in to comment.