From ad1c029935ecc322a3ab21b07490abda1d5318be Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 21 Sep 2022 12:53:28 +0200 Subject: [PATCH] Refactoring into DiffPresetDialog::is_save_confirmed() to fix build using VisualStudio 2022 --- src/slic3r/GUI/UnsavedChangesDialog.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index 5d04c19622..73d4b767ad 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -2016,12 +2016,15 @@ bool DiffPresetDialog::is_save_confirmed() std::vector types_for_save; - for (const Preset::Type& type : m_pr_technology == ptFFF ? std::initializer_list{Preset::TYPE_PRINTER, Preset::TYPE_PRINT, Preset::TYPE_FILAMENT} : - std::initializer_list{Preset::TYPE_PRINTER, Preset::TYPE_SLA_PRINT, Preset::TYPE_SLA_MATERIAL }) + const auto list = m_pr_technology == ptFFF ? std::initializer_list{Preset::TYPE_PRINTER, Preset::TYPE_PRINT, Preset::TYPE_FILAMENT} : + std::initializer_list{ Preset::TYPE_PRINTER, Preset::TYPE_SLA_PRINT, Preset::TYPE_SLA_MATERIAL }; + + for (const Preset::Type& type : list) { if (!m_tree->options(type, true).empty()) { types_for_save.emplace_back(type); presets_to_save.emplace_back(PresetToSave{ type, get_left_preset_name(type), get_right_preset_name(type), get_right_preset_name(type) }); } + } if (!types_for_save.empty()) { SavePresetDialog save_dlg(this, types_for_save, _u8L("Modified"), m_preset_bundle_right.get());