From: dmv Date: Thu, 22 Oct 2009 14:04:02 +0000 (+0000) Subject: IPAL21434 TC5.1.3 Export creates incorrent shape in .step, .iges formats if "locale... X-Git-Tag: RELIQUAT_5x_30102009~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=94006657e905936368c389b11920ba00cf9e70ea;p=modules%2Fgeom.git IPAL21434 TC5.1.3 Export creates incorrent shape in .step, .iges formats if "locale" gets different values. --- diff --git a/src/STEPExport/STEPExport.cxx b/src/STEPExport/STEPExport.cxx index 75fd79cfe..eaff4f68e 100644 --- a/src/STEPExport/STEPExport.cxx +++ b/src/STEPExport/STEPExport.cxx @@ -67,6 +67,10 @@ STEPEXPORT_EXPORT try { + // Set "C" numeric locale to save numbers correctly + std::string aCurLocale = setlocale(LC_NUMERIC, 0); + setlocale(LC_NUMERIC, "C"); + IFSelect_ReturnStatus status ; //VRV: OCC 4.0 migration STEPControl_Writer aWriter; @@ -76,7 +80,10 @@ STEPEXPORT_EXPORT status = aWriter.Transfer( theShape, STEPControl_AsIs ); //VRV: OCC 4.0 migration if ( status == IFSelect_RetDone ) - status = aWriter.Write( theFileName.ToCString() ) ; + status = aWriter.Write( theFileName.ToCString() ); + + // Return previous locale + setlocale(LC_NUMERIC, aCurLocale.data()); if ( status == IFSelect_RetDone ) return 1; }