From: dmv Date: Tue, 3 Nov 2009 07:48:31 +0000 (+0000) Subject: 0020569: EDF 1158 SMESH: Bad interpretation of analytical density function in 1D... X-Git-Tag: V5_1_3rc2~28 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=10c15ac1c2a3450c3f180aa1d599fb64767f4654;p=modules%2Fsmesh.git 0020569: EDF 1158 SMESH: Bad interpretation of analytical density function in 1D distribution hypothesis --- 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 ); }