From: Vadim Zeitlin Date: Wed, 16 Jul 2008 15:53:44 +0000 (+0000) Subject: allow using SetFont(wxNullFont) to reset the font as per documented behaviour (#3238) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d8df88930e59bb8bdd5fda45e47c7a30cf2659a9 allow using SetFont(wxNullFont) to reset the font as per documented behaviour (#3238) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54664 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 5b449b2277..7dfd87df99 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -871,7 +871,11 @@ bool wxWindowMSW::SetFont(const wxFont& font) HWND hWnd = GetHwnd(); if ( hWnd != 0 ) { - WXHANDLE hFont = m_font.GetResourceHandle(); + // note the use of GetFont() instead of m_font: our own font could have + // just been reset and in this case we need to change the font used by + // the native window to the default for this class, i.e. exactly what + // GetFont() returns + WXHANDLE hFont = GetFont().GetResourceHandle(); wxASSERT_MSG( hFont, wxT("should have valid font") );