Salome HOME
0020569: EDF 1158 SMESH: Bad interpretation of analytical density function in 1D...
authordmv <dmv@opencascade.com>
Tue, 3 Nov 2009 07:48:31 +0000 (07:48 +0000)
committerdmv <dmv@opencascade.com>
Tue, 3 Nov 2009 07:48:31 +0000 (07:48 +0000)
src/StdMeshers/StdMeshers_NumberOfSegments.cxx

index e03a921e85db59d00dd55e409503ec1082e36980..59fb46a815b1cc1d27a404621ff477421095560c 100644 (file)
@@ -321,6 +321,10 @@ bool process( const TCollection_AsciiString& str, int convMode,
              bool& non_neg, bool& non_zero,
              bool& singulars, double& sing_point )
 {
+  // Set "C" numeric locale to save numbers correctly
+  std::string aCurLocale = setlocale(LC_NUMERIC, 0);
+  setlocale(LC_NUMERIC, "C");
+
   bool parsed_ok = true;
   Handle( ExprIntrp_GenExp ) myExpr;
   try {
@@ -372,6 +376,10 @@ bool process( const TCollection_AsciiString& str, int convMode,
        non_zero = true;
     }
   }
+
+  // Return previous locale
+  setlocale(LC_NUMERIC, aCurLocale.data());
+
   return res && non_neg && non_zero && ( !singulars );
 }