merged wxFont related fix (operator==) and optimization (cache default GUI font)

from 2.2


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9827 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-04-21 16:03:10 +00:00
parent f4929e864e
commit 8bf30fe9b0
9 changed files with 138 additions and 50 deletions

View File

@@ -130,8 +130,12 @@ void wxWindowBase::InitBase()
m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNFACE);
m_foregroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOWTEXT);
// GRG, changed Mar/2000
// don't set the font here for wxMSW as we don't call WM_SETFONT here and
// so the font is *not* really set - but calls to SetFont() later won't do
// anything because m_font appears to be already set!
#ifndef __WXMSW__
m_font = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
#endif // __WXMSW__
// no style bits
m_exStyle =
@@ -642,7 +646,7 @@ bool wxWindowBase::SetFont(const wxFont& font)
// don't try to set invalid font, always fall back to the default
const wxFont& fontOk = font.Ok() ? font : *wxSWISS_FONT;
if ( (wxFont&)fontOk == m_font )
if ( fontOk == m_font )
{
// no change
return FALSE;