]> SALOME platform Git repositories - plugins/blsurfplugin.git/commitdiff
Salome HOME
Forces C locale to be able to define advanced option with digits
authorChristophe Bourcier <christophe.bourcier@cea.fr>
Tue, 26 Jan 2021 16:26:47 +0000 (17:26 +0100)
committerChristophe Bourcier <christophe.bourcier@cea.fr>
Tue, 26 Jan 2021 16:26:47 +0000 (17:26 +0100)
For instance, periodic_tolerance 0.001 in advanced tab was set as 0 before this fix

src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx

index db551c4dfb3640e72925dd8156a2c4434ce22fba..038b59ba0191e4750a852d9e23ca82169cf1c34a 100644 (file)
@@ -32,6 +32,8 @@
 #include <iostream>
 #include <sstream>
 
+#include <Basics_Utils.hxx>
+
 // cascade include
 #include "ShapeAnalysis.hxx"
 
@@ -3665,6 +3667,9 @@ double BLSURFPlugin_Hypothesis::ToDbl(const std::string& str, bool* isOk )
 {
   if ( str.empty() ) throw std::invalid_argument("Empty value provided");
 
+  // Forces "C" locale to be set as LC_NUMERIC
+  Kernel_Utils::Localizer loc;
+
   char * endPtr;
   double val = strtod(&str[0], &endPtr);
   bool ok = (&str[0] != endPtr);