]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xmlres.cpp
Provide a task-dialog based wxMSW wxMessageDialog implementation.
[wxWidgets.git] / src / xrc / xmlres.cpp
index 88fa86ab4ac56e28626e4d72173eea07a6ec8609..cd053af857c9c73fde49a6de1bf8be62b53ec814 100644 (file)
@@ -1189,18 +1189,11 @@ float wxXmlResourceHandler::GetFloat(const wxString& param, float defaultv)
 {
     wxString str = GetParamValue(param);
 
 {
     wxString str = GetParamValue(param);
 
-#if wxUSE_INTL
-    // strings in XRC always use C locale but wxString::ToDouble() uses the
-    // current one, so transform the string to it supposing that the only
-    // difference between them is the decimal separator
-    //
-    // TODO: use wxString::ToCDouble() when we have it
-    str.Replace(wxT("."), wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT,
-                                            wxLOCALE_CAT_NUMBER));
-#endif // wxUSE_INTL
-
+    // strings in XRC always use C locale so make sure to use the
+    // locale-independent wxString::ToCDouble() and not ToDouble() which uses
+    // the current locale with a potentially different decimal point character
     double value;
     double value;
-    if (!str.ToDouble(&value))
+    if (!str.ToCDouble(&value))
         value = defaultv;
 
     return wx_truncate_cast(float, value);
         value = defaultv;
 
     return wx_truncate_cast(float, value);