Salome HOME
Bug IPAL21432 - TC5.1.3 Load script doesn't work with Notebook in scenario PROD-009. RELIQUAT_5x_30102009
authorouv <ouv@opencascade.com>
Mon, 26 Oct 2009 10:41:22 +0000 (10:41 +0000)
committerouv <ouv@opencascade.com>
Mon, 26 Oct 2009 10:41:22 +0000 (10:41 +0000)
src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx

index 373058472710933333441384371f53071930159a..ccde0d3efdfc6e044ca8635dbb39619c9e4d108d 100644 (file)
@@ -48,6 +48,23 @@ using namespace std;
 #define VARIABLE_SEPARATOR  ':'
 #define OPERATION_SEPARATOR '|'
 
+// auxilary class intended to fix problems with locales
+class Localizer
+{
+public:
+  Localizer()
+  {
+    myCurLocale = setlocale(LC_NUMERIC, 0);
+    setlocale(LC_NUMERIC, "C");
+  }
+  ~Localizer()
+  {
+    setlocale(LC_NUMERIC, myCurLocale.c_str());
+  }
+private:
+  std::string myCurLocale;
+};
+
 //============================================================================
 /*! Function : SALOMEDSImpl_Study
  *  Purpose  : SALOMEDSImpl_Study constructor
@@ -904,6 +921,8 @@ string SALOMEDSImpl_Study::_GetStudyVariablesScript()
   
   if(myNoteBookVars.empty())
     return dump;
+
+  Localizer loc;
   
   dump += "####################################################\n";
   dump += "##       Begin of NoteBook variables section      ##\n";