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)
This commit is contained in:
zhimin.zeng 2022-09-06 18:20:59 +08:00 committed by Lane.Wei
parent 264aad9b4b
commit e5c3127517

View file

@ -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);