Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Sep 25, 2023
1 parent d29c219 commit 0d1e390
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/app/qgsmaptoolmovefeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ void QgsMapToolMoveFeature::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
}
case CopyMove:
QgsFeatureRequest request;
qDebug() << mMovedFeatures;
request.setFilterFids( mMovedFeatures );
QString errorMsg;
QString childrenInfoMsg;
Expand Down
14 changes: 13 additions & 1 deletion src/core/vector/qgsvectorlayertools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ bool QgsVectorLayerTools::copyMoveFeatures( QgsVectorLayer *layer, QgsFeatureReq
if ( mProject )
{
newFeature = QgsVectorLayerUtils::duplicateFeature( layer, f, mProject, duplicateFeatureContext );
if ( !newFeature.isValid() )
{
couldNotWriteCount++;
QgsDebugError( QStringLiteral( "Could not add new feature. Original copied feature id: %1" ).arg( f.id() ) );
}
else
{
fidList.insert( newFeature.id() );
}

const auto duplicateFeatureContextLayers = duplicateFeatureContext.layers();
for ( QgsVectorLayer *chl : duplicateFeatureContextLayers )
Expand All @@ -81,13 +90,16 @@ bool QgsVectorLayerTools::copyMoveFeatures( QgsVectorLayer *layer, QgsFeatureReq
couldNotWriteCount++;
QgsDebugError( QStringLiteral( "Could not add new feature. Original copied feature id: %1" ).arg( f.id() ) );
}
else
{
fidList.insert( newFeature.id() );
}
}

// translate
if ( newFeature.hasGeometry() )
{
QgsGeometry geom = newFeature.geometry();
fidList.insert( newFeature.id() );
if ( topologicalEditing )
{
if ( topologicalLayer )
Expand Down

0 comments on commit 0d1e390

Please sign in to comment.