From 07e4d24b988174de16965d26bf0fe3641963ac80 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 22 Jan 2025 15:19:21 -0500 Subject: [PATCH] Enforce layout settings for duplicate maps --- src/ui/newmapdialog.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ui/newmapdialog.cpp b/src/ui/newmapdialog.cpp index 521878c5..d54e85be 100644 --- a/src/ui/newmapdialog.cpp +++ b/src/ui/newmapdialog.cpp @@ -213,6 +213,12 @@ void NewMapDialog::on_comboBox_LayoutID_currentTextChanged(const QString &text) // Changing the layout ID to an existing layout updates the layout settings to match. const Layout *layout = this->project->mapLayouts.value(text); + if (!layout && this->mapToCopy) { + // When duplicating a map, if a new layout ID is specified the settings will be updated + // to match the layout of the map we're duplicating. + layout = this->mapToCopy->layout(); + } + if (layout) { ui->newLayoutForm->setSettings(layout->settings()); ui->newLayoutForm->setDisabled(true);