X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c45c32033d2b711fc62a2c3a85b500983c43ead0..256e97fb7d55aba8fe10c4c375a0228cbbdb7d86:/src/msw/fontenum.cpp diff --git a/src/msw/fontenum.cpp b/src/msw/fontenum.cpp index 852ffea56d..27c2832868 100644 --- a/src/msw/fontenum.cpp +++ b/src/msw/fontenum.cpp @@ -24,12 +24,13 @@ #pragma hdrstop #endif -#if wxUSE_FONTMAP +#if wxUSE_FONTENUM #ifndef WX_PRECOMP #include "wx/gdicmn.h" #include "wx/font.h" #include "wx/encinfo.h" + #include "wx/dynarray.h" #endif #include "wx/msw/private.h" @@ -89,7 +90,7 @@ private: // the list of facenames we already found while enumerating facenames wxArrayString m_facenames; - DECLARE_NO_COPY_CLASS(wxFontEnumeratorHelper) + wxDECLARE_NO_COPY_CLASS(wxFontEnumeratorHelper); }; // ---------------------------------------------------------------------------- @@ -98,7 +99,7 @@ private: #ifndef __WXMICROWIN__ int CALLBACK wxFontEnumeratorProc(LPLOGFONT lplf, LPTEXTMETRIC lptm, - DWORD dwStyle, LONG lParam); + DWORD dwStyle, LPARAM lParam); #endif // ============================================================================ @@ -159,13 +160,13 @@ void wxFontEnumeratorHelper::DoEnumerate() #ifdef __WXWINCE__ ::EnumFontFamilies(hDC, - m_facename.empty() ? NULL : m_facename.c_str(), + m_facename.empty() ? NULL : m_facename.wx_str(), (wxFONTENUMPROC)wxFontEnumeratorProc, (LPARAM)this) ; #else // __WIN32__ LOGFONT lf; lf.lfCharSet = (BYTE)m_charset; - wxStrncpy(lf.lfFaceName, m_facename, WXSIZEOF(lf.lfFaceName)); + wxStrlcpy(lf.lfFaceName, m_facename.c_str(), WXSIZEOF(lf.lfFaceName)); lf.lfPitchAndFamily = 0; ::EnumFontFamiliesEx(hDC, &lf, (wxFONTENUMPROC)wxFontEnumeratorProc, (LPARAM)this, 0 /* reserved */) ; @@ -268,7 +269,7 @@ bool wxFontEnumerator::EnumerateEncodings(const wxString& family) #ifndef __WXMICROWIN__ int CALLBACK wxFontEnumeratorProc(LPLOGFONT lplf, LPTEXTMETRIC lptm, - DWORD WXUNUSED(dwStyle), LONG lParam) + DWORD WXUNUSED(dwStyle), LPARAM lParam) { // we used to process TrueType fonts only, but there doesn't seem to be any @@ -288,4 +289,4 @@ int CALLBACK wxFontEnumeratorProc(LPLOGFONT lplf, LPTEXTMETRIC lptm, } #endif -#endif // wxUSE_FONTMAP +#endif // wxUSE_FONTENUM