]> git.saurik.com Git - wxWidgets.git/commitdiff
Return face name from wxFont::GetNativeFontInfo() under MSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 26 Nov 2009 02:33:53 +0000 (02:33 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 26 Nov 2009 02:33:53 +0000 (02:33 +0000)
Retrieve the face name from the system if we don't have it already before
returning the native font info.

This fixes the currently failing font unit tests.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62716 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/font.cpp

index ac1a4d3cce6e0f8e609b52af1658a4c1bcb0cdc9..f22d5aefdf7450e37ff29df1cbac73167cb8c758 100644 (file)
@@ -289,7 +289,14 @@ public:
     }
 
     const wxNativeFontInfo& GetNativeFontInfo() const
     }
 
     const wxNativeFontInfo& GetNativeFontInfo() const
-        { return m_nativeFontInfo; }
+    {
+        // ensure that we have a valid face name in our font information:
+        // GetFaceName() will try to retrieve it from our HFONT and save it if
+        // it was successful
+        (void)GetFaceName();
+
+        return m_nativeFontInfo;
+    }
 
     void SetNativeFontInfo(const wxNativeFontInfo& nativeFontInfo)
     {
 
     void SetNativeFontInfo(const wxNativeFontInfo& nativeFontInfo)
     {