Skip to content

Commit d1910f5

Browse files
committed
Fix vector layer export transform selection choice is ignored
Fixes #21275
1 parent c910bcd commit d1910f5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/app/qgisapp.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -7642,7 +7642,13 @@ void QgisApp::saveAsVectorFileGeneral( QgsVectorLayer *vlayer, bool symbologyOpt
76427642
if ( dlg.availableTransformationCount() > 1 &&
76437643
settings.value( QStringLiteral( "Projections/showDatumTransformDialog" ), false ).toBool() )
76447644
{
7645-
dlg.exec();
7645+
if ( dlg.exec() )
7646+
{
7647+
QPair< QPair<QgsCoordinateReferenceSystem, int>, QPair<QgsCoordinateReferenceSystem, int > > dt = dlg.selectedDatumTransforms();
7648+
QgsCoordinateTransformContext context = QgsProject::instance()->transformContext();
7649+
context.addSourceDestinationDatumTransform( dt.first.first, dt.second.first, dt.first.second, dt.second.second );
7650+
QgsProject::instance()->setTransformContext( context );
7651+
}
76467652
}
76477653
ct = QgsCoordinateTransform( vlayer->crs(), destCRS, QgsProject::instance() );
76487654
}

0 commit comments

Comments
 (0)