From: Vadim Zeitlin Date: Fri, 16 Sep 2011 22:44:04 +0000 (+0000) Subject: Fix wxFont::GetFaceName() for not realized yet fonts in wxMSW. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/792339b9639e9b42ce9c3af13244ab6b0f282ba1 Fix wxFont::GetFaceName() for not realized yet fonts in wxMSW. GetFaceName() could be called for a font that hadn't been really used yet and hence its wxFontRefData::m_hFont could be 0 and couldn't be used in GetMSWFaceName(). Fix this by using GetHFONT() accessor instead of m_hFont directly to create the font if necessary. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69106 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/font.cpp b/src/msw/font.cpp index d995db91ac..376b8b3b87 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -279,7 +279,7 @@ protected: wxString GetMSWFaceName() const { ScreenHDC hdc; - SelectInHDC selectFont(hdc, m_hFont); + SelectInHDC selectFont(hdc, (HFONT)GetHFONT()); UINT otmSize = GetOutlineTextMetrics(hdc, 0, NULL); if ( !otmSize )