From 53c5b0331ebff1446c9cda5ccbf66c68fdfcce6d Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Thu, 18 Nov 2021 12:07:21 +0100 Subject: [PATCH] Fix issue with corrupted sl1 import with substituted profile. fixes SPE-1119 --- src/libslic3r/Format/SL1.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/Format/SL1.cpp b/src/libslic3r/Format/SL1.cpp index a8f920ae2..9e271238e 100644 --- a/src/libslic3r/Format/SL1.cpp +++ b/src/libslic3r/Format/SL1.cpp @@ -19,6 +19,7 @@ #include "libslic3r/SLA/RasterBase.hpp" #include "libslic3r/miniz_extension.hpp" #include "libslic3r/PNGReadWrite.hpp" +#include "libslic3r/LocalesUtils.hpp" #include #include @@ -321,11 +322,13 @@ ConfigSubstitutions import_sla_archive( lh_opt != arch.config.not_found()) { auto lh_str = lh_opt->second.data(); - try { - double lh = std::stod(lh_str); // TODO replace with std::from_chars + + size_t pos; + double lh = string_to_double_decimal_point(lh_str, &pos); + if (pos) { // TODO: verify that pos is 0 when parsing fails profile_out.set("layer_height", lh); profile_out.set("initial_layer_height", lh); - } catch(...) {} + } } }