1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +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:
abv
2013-02-01 18:41:16 +04:00
parent 3bea4c165c
commit 91322f44fd
203 changed files with 2707 additions and 2807 deletions

View File

@@ -193,7 +193,7 @@ static Standard_Integer DDocStd_UndoLimit (Draw_Interpretor& di,Standard_Integer
if (!DDocStd::GetDocument(a[1],D)) return 1;
if (n > 2) {
Standard_Integer lim = atoi(a[2]);
Standard_Integer lim = Draw::Atoi(a[2]);
D->SetUndoLimit(lim);
}
@@ -218,7 +218,7 @@ static Standard_Integer DDocStd_Undo (Draw_Interpretor& di,Standard_Integer n, c
Standard_Integer i,step = 1;
if (n > 2) {
step = atoi(a[2]);
step = Draw::Atoi(a[2]);
}
// test if the command was undo or redo

View File

@@ -56,7 +56,7 @@ static int mtmCreate (Draw_Interpretor& /*di*/, int n, const char** a)
sMultiTransactionManager = new TDocStd_MultiTransactionManager();
if(n > 1)
sMultiTransactionManager->SetUndoLimit(atoi(a[1]));
sMultiTransactionManager->SetUndoLimit(Draw::Atoi(a[1]));
return 0;
}
@@ -198,7 +198,7 @@ static int mtmNestedMode (Draw_Interpretor& di, int n, const char** a)
}
Standard_Boolean aMode = Standard_False;
if(n > 1) {
aMode = atoi(a[1]) ? Standard_True : Standard_False;
aMode = Draw::Atoi(a[1]) ? Standard_True : Standard_False;
}
sMultiTransactionManager->SetNestedTransactionMode(aMode);
return 0;
@@ -220,7 +220,7 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
TDF_Tool::Label(browser->Data(),argv[2],lab);
if ( lab.IsNull() ) { di << "ERROR: label is Null: " << argv[2] << "\n"; return 0; }
Standard_Integer num = atoi ( argv[3] );
Standard_Integer num = Draw::Atoi ( argv[3] );
TDF_AttributeIterator itr(lab,Standard_False);
for (Standard_Integer i=1; itr.More() && i < num; i++) itr.Next();