mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 15:13:58 -06:00
Fix preset transfer crash (#8744)
Fix preset transfer crash (SoftFever/OrcaSlicer#7991)
This commit is contained in:
parent
bc698a88df
commit
1d71ed5ade
1 changed files with 6 additions and 2 deletions
|
@ -2383,13 +2383,17 @@ void DiffPresetDialog::button_event(Action act)
|
||||||
|
|
||||||
std::string DiffPresetDialog::get_left_preset_name(Preset::Type type)
|
std::string DiffPresetDialog::get_left_preset_name(Preset::Type type)
|
||||||
{
|
{
|
||||||
PresetComboBox* cb = m_preset_combos[int(type - Preset::TYPE_PRINT)].presets_left;
|
PresetComboBox* cb = std::find_if(m_preset_combos.begin(), m_preset_combos.end(), [type](const DiffPresets& p) {
|
||||||
|
return p.presets_left->get_type() == type;
|
||||||
|
})->presets_left;
|
||||||
return Preset::remove_suffix_modified(get_selection(cb));
|
return Preset::remove_suffix_modified(get_selection(cb));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string DiffPresetDialog::get_right_preset_name(Preset::Type type)
|
std::string DiffPresetDialog::get_right_preset_name(Preset::Type type)
|
||||||
{
|
{
|
||||||
PresetComboBox* cb = m_preset_combos[int(type - Preset::TYPE_PRINT)].presets_right;
|
PresetComboBox* cb = std::find_if(m_preset_combos.begin(), m_preset_combos.end(), [type](const DiffPresets& p) {
|
||||||
|
return p.presets_right->get_type() == type;
|
||||||
|
})->presets_right;
|
||||||
return Preset::remove_suffix_modified(get_selection(cb));
|
return Preset::remove_suffix_modified(get_selection(cb));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue