mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0022898: IGES import fails in german environment
Added DRAW command dlocale to set and query current locale of the C subsystem Equivalents of C functions working with conversions of strings to/from reals added in Standard_CString, providing locale-independent behavior (using always "C" locale) In DRAW packages, calls to atof() and atoi() are replaced by direct calls to Draw::Atof() and Draw::Atoi(), respectively, instead of substituting by #define Use of atof(), strtod(), and *scanf() involving floating point conversions in OCCT code replaced by locale-independent Atof() and Strtod() Calls to sprintf() involving floating point in OCCT code are replaced by call to locale-independent Sprintf(), except a few places where converted strings are used immediately for display in the 3d viewer Changes of global locale are eliminated throughout OCCT code Proposed correction for GNU libC where v*printf_l functions are absent Added test case (bugs xde bug22898) for data exchange operations with non-standard locale Use xlocale on Mac OS X and within glibc Corrected strtod_l wrapper Generate error rather than warning Introduce Standard_CLocaleSentry replacement for removed OSD_Localizer Standard_CLocaleSentry - copy locale string Standard_CLocaleSentry - use _configthreadlocale on Windows Standard_CLocaleSentry::GetCLocale() - return locale_t rather than void* Corrected misprint in ~Standard_CLocaleSentry() Use French locale in bug22898 test case Mark test case as skipped if locale is unavailable on tested system. Use fr_FR locale for tests on Mac OS X
This commit is contained in:
@@ -88,7 +88,7 @@ static Standard_Integer Ascendants (Draw_Interpretor& di, Standard_Integer n, co
|
||||
|
||||
Standard_Integer T;
|
||||
|
||||
if (n > 3) T = atoi(a[3]);
|
||||
if (n > 3) T = Draw::Atoi(a[3]);
|
||||
else T = ND->Transaction ();
|
||||
|
||||
//TNaming_OldShapeIterator it (S, T, US);
|
||||
@@ -97,7 +97,7 @@ static Standard_Integer Ascendants (Draw_Interpretor& di, Standard_Integer n, co
|
||||
TCollection_AsciiString entry;
|
||||
for (;it.More (); it.Next ()) {
|
||||
S = it.Shape ();
|
||||
sprintf (name,"%s_%s_%d",a[2],"old", i++);
|
||||
Sprintf (name,"%s_%s_%d",a[2],"old", i++);
|
||||
DBRep::Set (name,it.Shape());
|
||||
TDF_Label Label = it.Label ();
|
||||
TDF_Tool::Entry(Label,entry);
|
||||
@@ -128,7 +128,7 @@ static Standard_Integer Descendants (Draw_Interpretor& di, Standard_Integer n, c
|
||||
|
||||
Standard_Integer T;
|
||||
|
||||
if (n > 3) T = atoi(a[3]);
|
||||
if (n > 3) T = Draw::Atoi(a[3]);
|
||||
else T = ND->Transaction ();
|
||||
|
||||
TNaming_NewShapeIterator it (S, T, ND->Root());
|
||||
@@ -136,7 +136,7 @@ static Standard_Integer Descendants (Draw_Interpretor& di, Standard_Integer n, c
|
||||
TCollection_AsciiString entry;
|
||||
for (;it.More (); it.Next ()) {
|
||||
S = it.Shape ();
|
||||
sprintf (name,"%s_%s_%d",a[2],"new", i++);
|
||||
Sprintf (name,"%s_%s_%d",a[2],"new", i++);
|
||||
DBRep::Set (name,it.Shape ());
|
||||
TDF_Label Label = it.Label ();
|
||||
TDF_Tool::Entry(Label,entry);
|
||||
@@ -281,7 +281,7 @@ static Standard_Integer Exploreshape (Draw_Interpretor& di, Standard_Integer n,
|
||||
// ND->Root().FindAttribute(TNaming_UsedShapes::GetID(),US);
|
||||
|
||||
Standard_Integer Trans = ND->Transaction();
|
||||
if (n == 5) { Trans = (Standard_Integer ) atof(a[4]);}
|
||||
if (n == 5) { Trans = (Standard_Integer ) Draw::Atof(a[4]);}
|
||||
|
||||
TDF_Label Lab;
|
||||
DDF::FindLabel(ND,a[2],Lab);
|
||||
@@ -300,11 +300,11 @@ static Standard_Integer Exploreshape (Draw_Interpretor& di, Standard_Integer n,
|
||||
|
||||
for (TNaming_Iterator itL(Lab,Trans) ; itL.More(); itL.Next()) {
|
||||
if (!itL.OldShape().IsNull()) {
|
||||
sprintf(name,"%s%s_%d","old",a[3],NbShapes);
|
||||
Sprintf(name,"%s%s_%d","old",a[3],NbShapes);
|
||||
DBRep::Set (name,itL.OldShape());
|
||||
}
|
||||
if (!itL.NewShape().IsNull()) {
|
||||
sprintf(name,"%s_%d",a[3],NbShapes);
|
||||
Sprintf(name,"%s_%d",a[3],NbShapes);
|
||||
DBRep::Set (name,itL.NewShape());
|
||||
}
|
||||
NbShapes++;
|
||||
@@ -388,7 +388,7 @@ static Standard_Integer Collect (Draw_Interpretor& di,
|
||||
if (!DDF::GetDF(arg[1],DF)) return 1;
|
||||
if (!DDF::Find(DF,arg[2],TNaming_NamedShape::GetID(),A)) return 1;
|
||||
if (nb >= 4) {
|
||||
OnlyModif = atoi(arg[3]);
|
||||
OnlyModif = Draw::Atoi(arg[3]);
|
||||
}
|
||||
TNaming_Tool::Collect(A,MNS,OnlyModif);
|
||||
for (TNaming_MapIteratorOfMapOfNamedShape it(MNS); it.More(); it.Next()) {
|
||||
|
Reference in New Issue
Block a user