diff --git a/src/libslic3r/Config.hpp b/src/libslic3r/Config.hpp index 7f826109a..e0544b153 100644 --- a/src/libslic3r/Config.hpp +++ b/src/libslic3r/Config.hpp @@ -218,7 +218,7 @@ public: const T& get_at(size_t i) const { return const_cast*>(this)->get_at(i); } - // Resize this vector by duplicating the last value. + // Resize this vector by duplicating the /*last*/first value. // If the current vector is empty, the default value is used instead. void resize(size_t n, const ConfigOption *opt_default = nullptr) override { @@ -238,7 +238,7 @@ public: this->values.resize(n, static_cast*>(opt_default)->values.front()); } else { // Resize by duplicating the last value. - this->values.resize(n, this->values.back()); + this->values.resize(n, this->values./*back*/front()); } } } diff --git a/src/slic3r/GUI/GUI.cpp b/src/slic3r/GUI/GUI.cpp index df5c1d407..0a27af9fa 100644 --- a/src/slic3r/GUI/GUI.cpp +++ b/src/slic3r/GUI/GUI.cpp @@ -154,13 +154,15 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt } else if (config.def()->get(opt_key)->gui_flags.compare("serialized") == 0) { std::string str = boost::any_cast(value); - if (str.back() == ';') str.pop_back(); - // Split a string to multiple strings by a semi - colon.This is the old way of storing multi - string values. - // Currently used for the post_process config value only. - std::vector values; - boost::split(values, str, boost::is_any_of(";")); - if (values.size() == 1 && values[0] == "") - values.resize(0);//break; + std::vector values {}; + if (!str.empty()) { + if (str.back() == ';') str.pop_back(); + // Split a string to multiple strings by a semi - colon.This is the old way of storing multi - string values. + // Currently used for the post_process config value only. + boost::split(values, str, boost::is_any_of(";")); + if (values.size() == 1 && values[0] == "") + values.resize(0); + } config.option(opt_key)->values = values; } else{ diff --git a/src/slic3r/GUI/Preset.cpp b/src/slic3r/GUI/Preset.cpp index fd2b26458..112a579b0 100644 --- a/src/slic3r/GUI/Preset.cpp +++ b/src/slic3r/GUI/Preset.cpp @@ -1053,7 +1053,7 @@ std::vector PresetCollection::dirty_options(const Preset *edited, c std::vector changed; if (edited != nullptr && reference != nullptr) { changed = deep_compare ? - deep_diff(reference->config, edited->config) : + deep_diff(edited->config, reference->config) : reference->config.diff(edited->config); // The "compatible_printers" option key is handled differently from the others: // It is not mandatory. If the key is missing, it means it is compatible with any printer.