Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2017-12-21 21:19:07 +0300
committerbubnikv <bubnikv@gmail.com>2017-12-21 21:19:07 +0300
commit3addeb57b43a38cdf765abb2bf9147f3fdc034d0 (patch)
tree12623a6fbb6e1073d928a46d029f56a107432ee6
parent9d3ade81fa140d898a01fffac2a7ec06f022aef6 (diff)
Fix of "Program crashes when [Suppress "- default -" presets:] is DISABLED"
https://github.com/prusa3d/Slic3r/issues/643
-rw-r--r--lib/Slic3r/GUI/MainFrame.pm2
-rw-r--r--xs/src/slic3r/GUI/Preset.hpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/Slic3r/GUI/MainFrame.pm b/lib/Slic3r/GUI/MainFrame.pm
index 6b07d761d..c91c59ea7 100644
--- a/lib/Slic3r/GUI/MainFrame.pm
+++ b/lib/Slic3r/GUI/MainFrame.pm
@@ -596,7 +596,7 @@ sub load_configbundle {
wxTheApp->{app_config}->update_config_dir(dirname($file));
my $presets_imported = 0;
- eval { $presets_imported = wxTheApp->{preset_bundle}->load_configbundle($file, $reset_user_profile ? 1 : 0); };
+ eval { $presets_imported = wxTheApp->{preset_bundle}->load_configbundle($file); };
Slic3r::GUI::catch_error($self) and return;
# Load the currently selected preset into the GUI, update the preset selection box.
diff --git a/xs/src/slic3r/GUI/Preset.hpp b/xs/src/slic3r/GUI/Preset.hpp
index 1f6a90595..c1d85833b 100644
--- a/xs/src/slic3r/GUI/Preset.hpp
+++ b/xs/src/slic3r/GUI/Preset.hpp
@@ -226,7 +226,7 @@ private:
{
Preset key(m_type, name);
auto it = std::lower_bound(m_presets.begin() + 1, m_presets.end(), key);
- return (it == m_presets.end() && m_presets.front().name == name) ? m_presets.begin() : it;
+ return ((it == m_presets.end() || it->name != name) && m_presets.front().name == name) ? m_presets.begin() : it;
}
std::deque<Preset>::const_iterator find_preset_internal(const std::string &name) const
{ return const_cast<PresetCollection*>(this)->find_preset_internal(name); }