compilation fixes for !wxUSE_FONTMEM case

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53471 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2008-05-06 21:11:59 +00:00
parent 6dd21c5433
commit 63feebce0a
2 changed files with 11 additions and 1 deletions

View File

@@ -18,6 +18,8 @@
#include "wx/fontenum.h" #include "wx/fontenum.h"
#include "wx/private/fontmgr.h" #include "wx/private/fontmgr.h"
#if wxUSE_FONTENUM
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxFontEnumerator // wxFontEnumerator
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -49,3 +51,5 @@ bool wxFontEnumerator::EnumerateEncodings(const wxString& facename)
{ {
return EnumerateEncodingsUTF8(facename); return EnumerateEncodingsUTF8(facename);
} }
#endif // wxUSE_FONTENUM

View File

@@ -1440,8 +1440,9 @@ wxFont wxXmlResourceHandler::GetFont(const wxString& param)
if (hasFacename) if (hasFacename)
{ {
wxString faces = GetParamValue(wxT("face")); wxString faces = GetParamValue(wxT("face"));
wxArrayString facenames(wxFontEnumerator::GetFacenames());
wxStringTokenizer tk(faces, wxT(",")); wxStringTokenizer tk(faces, wxT(","));
#if wxUSE_FONTENUM
wxArrayString facenames(wxFontEnumerator::GetFacenames());
while (tk.HasMoreTokens()) while (tk.HasMoreTokens())
{ {
int index = facenames.Index(tk.GetNextToken(), false); int index = facenames.Index(tk.GetNextToken(), false);
@@ -1451,6 +1452,11 @@ wxFont wxXmlResourceHandler::GetFont(const wxString& param)
break; 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 // encoding