From e5c31275173bb0edaf2b041e368b3a3af2f09d65 Mon Sep 17 00:00:00 2001 From: "zhimin.zeng" Date: Tue, 6 Sep 2022 18:20:59 +0800 Subject: [PATCH] FIX: keep only one repeated opt_key keep only one repeated opt_key when old software open new 3mf file Change-Id: I4f35d2f15e0cb9e5fa4a7523cfcba7b601afd795 (cherry picked from commit a25c42f31437b4562b8fe71a836a421c014c6cf9) --- src/libslic3r/Config.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/Config.cpp b/src/libslic3r/Config.cpp index 2b98ddff6..3800aefb8 100644 --- a/src/libslic3r/Config.cpp +++ b/src/libslic3r/Config.cpp @@ -534,8 +534,10 @@ bool ConfigBase::set_deserialize_nothrow(const t_config_option_key &opt_key_src, this->handle_legacy(opt_key, value); if (opt_key.empty()) { // Ignore the option. - //BBS: record these options - substitutions_ctxt.unrecogized_keys.push_back(opt_key_src); + //BBS: record these options, keep only one repeated opt_key + auto iter = std::find(substitutions_ctxt.unrecogized_keys.begin(), substitutions_ctxt.unrecogized_keys.end(), opt_key_src); + if (iter == substitutions_ctxt.unrecogized_keys.end()) + substitutions_ctxt.unrecogized_keys.push_back(opt_key_src); return true; } return this->set_deserialize_raw(opt_key, value, substitutions_ctxt, append);