X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/98ecc3aa689e1671e2771d773af66913cc54b959..76e7cfab8fdb0c7862fd07e427af54181717fc62:/src/os2/font.cpp diff --git a/src/os2/font.cpp b/src/os2/font.cpp index 6089595493..7cbe615bbb 100644 --- a/src/os2/font.cpp +++ b/src/os2/font.cpp @@ -4,7 +4,6 @@ // Author: David Webster // Modified by: // Created: 10/06/99 -// RCS-ID: $Id$ // Copyright: (c) David Webster // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -40,8 +39,6 @@ #include -IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) - // ---------------------------------------------------------------------------- // wxFontRefData - the internal description of the font // ---------------------------------------------------------------------------- @@ -249,9 +246,9 @@ protected: // Common part of all ctors // void Init( int nSize - ,int nFamily - ,int nStyle - ,int nWeight + ,wxFontFamily nFamily + ,wxFontStyle nStyle + ,wxFontWeight nWeight ,bool bUnderlined ,const wxString& rsFaceName ,wxFontEncoding vEncoding @@ -648,7 +645,7 @@ void wxNativeFontInfo::SetStyle( switch (eStyle) { default: - wxFAIL_MSG( _T("unknown font style") ); + wxFAIL_MSG( wxT("unknown font style") ); // fall through case wxFONTSTYLE_NORMAL: @@ -668,7 +665,7 @@ void wxNativeFontInfo::SetWeight( switch (eWeight) { default: - wxFAIL_MSG( _T("unknown font weight") ); + wxFAIL_MSG( wxT("unknown font weight") ); // fall through case wxFONTWEIGHT_NORMAL: @@ -697,7 +694,7 @@ bool wxNativeFontInfo::SetFaceName( const wxString& sFacename ) { - wxStrncpy((wxChar*)fa.szFacename, sFacename, WXSIZEOF(fa.szFacename)); + wxStrlcpy((wxChar*)fa.szFacename, sFacename, WXSIZEOF(fa.szFacename)); return true; } // end of wxNativeFontInfo::SetFaceName @@ -779,14 +776,14 @@ bool wxNativeFontInfo::FromString( const wxString& rsStr ) { long lVal; - wxStringTokenizer vTokenizer(rsStr, _T(";")); + wxStringTokenizer vTokenizer(rsStr, wxT(";")); // // First the version // wxString sToken = vTokenizer.GetNextToken(); - if (sToken != _T('0')) + if (sToken != wxT('0')) return false; sToken = vTokenizer.GetNextToken(); @@ -845,7 +842,7 @@ wxString wxNativeFontInfo::ToString() const { wxString sStr; - sStr.Printf(_T("%d;%ld;%ld;%ld;%d;%d;%d;%d;%d;%ld;%d;%s"), + sStr.Printf(wxT("%d;%ld;%ld;%ld;%d;%d;%d;%d;%d;%ld;%d;%s"), 0, // version, in case we want to change the format later fm.lEmHeight, fa.lAveCharWidth, @@ -927,7 +924,7 @@ wxFont::~wxFont() // ---------------------------------------------------------------------------- // real implementation // Boris' Kovalenko comments: -// Because OS/2 fonts are associated with PS we can not create the font +// Because OS/2 fonts are associated with PS we cannot create the font // here, but we may check that font definition is true // ---------------------------------------------------------------------------- @@ -1077,49 +1074,47 @@ void wxFont::DoSetNativeFontInfo( int wxFont::GetPointSize() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid font") ); return M_FONTDATA->GetPointSize(); } // end of wxFont::GetPointSize -wxFontFamily wxFont::GetFamily() const +wxFontFamily wxFont::DoGetFamily() const { - wxCHECK_MSG( Ok(), wxFONTFAMILY_MAX, wxT("invalid font") ); - return M_FONTDATA->GetFamily(); -} // end of wxFont::GetFamily +} // end of wxFont::DoGetFamily wxFontStyle wxFont::GetStyle() const { - wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTSTYLE_MAX, wxT("invalid font") ); return M_FONTDATA->GetStyle(); } // end of wxFont::GetStyle wxFontWeight wxFont::GetWeight() const { - wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, wxT("invalid font") ); return M_FONTDATA->GetWeight(); } bool wxFont::GetUnderlined() const { - wxCHECK_MSG( Ok(), false, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid font") ); return M_FONTDATA->GetUnderlined(); } // end of wxFont::GetUnderlined wxString wxFont::GetFaceName() const { - wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") ); return M_FONTDATA->GetFaceName(); } // end of wxFont::GetFaceName wxFontEncoding wxFont::GetEncoding() const { - wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); return M_FONTDATA->GetEncoding(); } // end of wxFont::GetEncoding