X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/35f860fa231822295eced971ea27e3d017623c7c..b796ba39311830b11e375de10ca2378f501c5b8c:/src/xrc/xmlres.cpp?ds=sidebyside diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index c69e3bb24b..c93f2ef023 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -995,7 +995,7 @@ float wxXmlResourceHandler::GetFloat(const wxString& param, float defaultv) { wxString str = GetParamValue(param); -#if wxUSE_LOCALE +#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 @@ -1003,7 +1003,7 @@ float wxXmlResourceHandler::GetFloat(const wxString& param, float defaultv) // TODO: use wxString::ToCDouble() when we have it str.Replace(wxT("."), wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER)); -#endif // wxUSE_LOCALE +#endif // wxUSE_INTL double value; if (!str.ToDouble(&value)) @@ -1440,8 +1440,9 @@ wxFont wxXmlResourceHandler::GetFont(const wxString& param) if (hasFacename) { wxString faces = GetParamValue(wxT("face")); - wxArrayString facenames(wxFontEnumerator::GetFacenames()); wxStringTokenizer tk(faces, wxT(",")); +#if wxUSE_FONTENUM + wxArrayString facenames(wxFontEnumerator::GetFacenames()); while (tk.HasMoreTokens()) { int index = facenames.Index(tk.GetNextToken(), false); @@ -1451,6 +1452,11 @@ wxFont wxXmlResourceHandler::GetFont(const wxString& param) break; } } +#else // !wxUSE_FONTENUM + // just use the first face name if we can't check its availability: + if (tk.HasMoreTokens()) + facename = tk.GetNextToken(); +#endif // wxUSE_FONTENUM/!wxUSE_FONTENUM } // encoding