From 94006657e905936368c389b11920ba00cf9e70ea Mon Sep 17 00:00:00 2001 From: dmv Date: Thu, 22 Oct 2009 14:04:02 +0000 Subject: [PATCH] IPAL21434 TC5.1.3 Export creates incorrent shape in .step, .iges formats if "locale" gets different values. --- src/STEPExport/STEPExport.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; } -- 2.39.2