#else
// The string is internally stored as UTF-8, we have to convert
// it into system's default encoding so that it can be displayed:
- return wxString(str2.mb_str(wxConvUTF8), wxConvLocal);
+ return wxString(str2.wc_str(wxConvUTF8), wxConvLocal);
#endif
}
}
{
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
double value;
if (!str.ToDouble(&value))
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);
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
// --------------- module and globals -----------------------------
+// normally we would do the cleanup from wxXmlResourceModule::OnExit() but it
+// can happen that some XRC records have been created because of the use of
+// XRCID() in event tables, which happens during static objects initialization,
+// but then the application initialization failed and so the wx modules were
+// neither initialized nor cleaned up -- this static object does the cleanup in
+// this case
+static struct wxXRCStaticCleanup
+{
+ ~wxXRCStaticCleanup() { CleanXRCID_Records(); }
+} s_staticCleanup;
+
class wxXmlResourceModule: public wxModule
{
DECLARE_DYNAMIC_CLASS(wxXmlResourceModule)