Use wxString::ToCDouble() instead of emulating it.
No real changes, just replace the code which was working around the absence of a wxString::ToCDouble() with the call to the real thing now that we have it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64204 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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 so make sure to use the
|
||||||
// strings in XRC always use C locale but wxString::ToDouble() uses the
|
// locale-independent wxString::ToCDouble() and not ToDouble() which uses
|
||||||
// current one, so transform the string to it supposing that the only
|
// the current locale with a potentially different decimal point character
|
||||||
// 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
|
|
||||||
|
|
||||||
double value;
|
double value;
|
||||||
if (!str.ToDouble(&value))
|
if (!str.ToCDouble(&value))
|
||||||
value = defaultv;
|
value = defaultv;
|
||||||
|
|
||||||
return wx_truncate_cast(float, value);
|
return wx_truncate_cast(float, value);
|
||||||
|
Reference in New Issue
Block a user