From 10c15ac1c2a3450c3f180aa1d599fb64767f4654 Mon Sep 17 00:00:00 2001 From: dmv Date: Tue, 3 Nov 2009 07:48:31 +0000 Subject: [PATCH] 0020569: EDF 1158 SMESH: Bad interpretation of analytical density function in 1D distribution hypothesis --- src/StdMeshers/StdMeshers_NumberOfSegments.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx index e03a921e8..59fb46a81 100644 --- a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx @@ -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 ); } -- 2.30.2