[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 899
Date       : Wed Apr 26 16:04:11 BST 2006

Changed paths:
   M /Trunk/XaraLX/wxOil/localenv.cpp

Fix localenv not to use locale.h, libiconv directly (hopefully)


Diff:
Index: Trunk/XaraLX/wxOil/localenv.cpp
===================================================================
--- Trunk/XaraLX/wxOil/localenv.cpp	(revision 898)
+++ Trunk/XaraLX/wxOil/localenv.cpp	(revision 899)
@@ -101,8 +101,6 @@
 */
 #include "camtypes.h"
 
-#include <locale.h>
-
 #include "localenv.h"
 
 DECLARE_SOURCE("$Revision$");
@@ -147,18 +145,22 @@
 {
 	TCHAR TS[8];
 
+
 PORTNOTE("other","Removed GetProfileString usage")
-#if defined(__WXGTK__)
+#if defined(__MSW__)
+	GetProfileString("intl", "iDigits", "2", TS, sizeof(TS));
+#else
+#if 0
+// AMB removed libiconv usage
 	struct lconv *lc;
 	lc = localeconv();
 	TRACEUSER( "luke", _T("iDigits = %d
"), lc->frac_digits );
 	*DecimalPlaces = (UINT32)lc->frac_digits;
 	return;
-#elif !defined(EXCLUDE_FROM_XARALX)
-	GetProfileString("intl", "iDigits", "2", TS, sizeof(TS));
-#else
+#else //0
 	TS[0]=_T('2');
 	TS[1]=0;
+#endif //0
 #endif
 
 	// Convert the string into a number that the string represents which we
@@ -184,23 +186,7 @@
 ********************************************************************************************/
 void LocalEnvironment::GetThousandsSeparator(StringBase* String)
 {
-	TCHAR TS[8];
-
-PORTNOTE("other","Removed GetProfileString usage")
-#if defined(__WXGTK__)
-	struct lconv *lc;
-	lc = localeconv();
-	TS[0] = ToUnicode( lc->thousands_sep[0] );
-	TS[1] = 0;
-
-	TRACEUSER( "luke", _T("sThousand = %s
"), TS );
-#elif !defined(EXCLUDE_FROM_XARALX)
-	GetProfileString("intl", "sThousand", ",", TS, sizeof(TS));
-#else
-	TS[0]=_T(',');
-	TS[1]=0;
-#endif
-	*String = TS;
+	*String = wxLocale::GetInfo(wxLOCALE_THOUSANDS_SEP, wxLOCALE_CAT_NUMBER);
 }
 
 /********************************************************************************************
@@ -220,23 +206,7 @@
 ********************************************************************************************/
 void LocalEnvironment::GetDecimalPointChar(StringBase* String)
 {
-	TCHAR TS[8];
-
-PORTNOTE("other","Removed GetProfileString usage")
-#if defined(__WXGTK__)
-	struct lconv *lc;
-	lc = localeconv();
-	TS[0] = ToUnicode( lc->decimal_point[0] );
-	TS[1] = 0;
-
-	TRACEUSER( "luke", _T("sDecimal = %s
"), TS );
-#elif !defined(EXCLUDE_FROM_XARALX)
-	GetProfileString("intl", "sDecimal", ".", TS, sizeof(TS));
-#else
-	TS[0]=_T('.');
-	TS[1]=0;
-#endif
-	*String = TS;
+	*String = wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER);
 }
 
 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)


Xara