X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/19193a2c85987b595932957e73013e7ea100f0e8..b2447e8408982b9a2528a56ec00010458e70f4db:/src/os2/fontenum.cpp diff --git a/src/os2/fontenum.cpp b/src/os2/fontenum.cpp index 476798911f..fdb1f4af11 100644 --- a/src/os2/fontenum.cpp +++ b/src/os2/fontenum.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: msw/fontenum.cpp +// Name: src/os2/fontenum.cpp // Purpose: wxFontEnumerator class for Windows // Author: Julian Smart // Modified by: David Webster to add support for font encodings @@ -17,21 +17,19 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ - #pragma implementation "fontenum.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #if wxUSE_FONTMAP +#include "wx/fontenum.h" + #ifndef WX_PRECOMP - #include "wx/font.h" + #include "wx/font.h" #endif -#include "wx/fontenum.h" #include "wx/fontmap.h" +#include "wx/encinfo.h" #include "wx/os2/private.h" @@ -65,7 +63,7 @@ private: // if not empty, enum only the fonts with this facename wxString m_facename; - // if TRUE, enum only fixed fonts + // if true, enum only fixed fonts bool m_fixedOnly; }; @@ -99,7 +97,7 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding) wxNativeEncodingInfo info; if ( !wxGetNativeFontEncoding(encoding, &info) ) { - if ( !wxTheFontMapper->GetAltForEncoding(encoding, &info) ) + if ( !wxFontMapper::Get()->GetAltForEncoding(encoding, &info) ) { // no such encodings at all return FALSE; @@ -108,7 +106,7 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding) m_charset = info.charset; m_facename = info.facename; - return TRUE; + return true; } #define wxFONTENUMPROC FONTENUMPROC @@ -122,7 +120,7 @@ void wxFontEnumeratorHelper::DoEnumerate() #ifdef __WIN32__ LOGFONT lf; lf.lfCharSet = m_charset; - wxStrncpy(lf.lfFaceName, m_facename, WXSIZEOF(lf.lfFaceName)); + wxStrlcpy(lf.lfFaceName, m_facename, WXSIZEOF(lf.lfFaceName)); lf.lfPitchAndFamily = 0; ::EnumFontFamiliesEx(hDC, &lf, (wxFONTENUMPROC)wxFontEnumeratorProc, (LPARAM)this, 0) ; @@ -152,7 +150,7 @@ bool wxFontEnumeratorHelper::OnFont(/*const LPLOGFONT lf, if ( tm->tmPitchAndFamily & TMPF_FIXED_PITCH ) { // not a fixed pitch font - return TRUE; + return true; } } @@ -161,13 +159,13 @@ bool wxFontEnumeratorHelper::OnFont(/*const LPLOGFONT lf, // check that we have the right encoding if ( lf->lfCharSet != m_charset ) { - return TRUE; + return true; } } return m_fontEnum->OnFacename(lf->lfFaceName); */ - return TRUE; + return true; } // ---------------------------------------------------------------------------- @@ -186,14 +184,14 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, } // else: no such fonts, unknown encoding - return TRUE; + return true; } -bool wxFontEnumerator::EnumerateEncodings(const wxString& family) +bool wxFontEnumerator::EnumerateEncodings(const wxString& WXUNUSED(family)) { wxFAIL_MSG(wxT("TODO")); - return TRUE; + return true; } // ----------------------------------------------------------------------------