From f691e7e28d39607074af3a30c34e1caf46de4ee0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 17 Jul 2015 16:10:20 +0200 Subject: [PATCH] Fix wxMSW wxFontEnumerator::EnumerateEncodings() parameter handling. This parameter is a face name, not a family name, and should be handled as such, it was totally broken before due to a lot of confusion between face names and family names in the code. Closes #4715. --- src/msw/fontenum.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/msw/fontenum.cpp b/src/msw/fontenum.cpp index 3c7d503d61..b8c707ab32 100644 --- a/src/msw/fontenum.cpp +++ b/src/msw/fontenum.cpp @@ -51,12 +51,12 @@ public: wxFontEnumeratorHelper(wxFontEnumerator *fontEnum); // control what exactly are we enumerating - // we enumerate fonts with given enocding + // we enumerate fonts with the given encoding bool SetEncoding(wxFontEncoding encoding); // we enumerate fixed-width fonts void SetFixedOnly(bool fixedOnly) { m_fixedOnly = fixedOnly; } - // we enumerate the encodings available in this family - void SetFamily(const wxString& family); + // we enumerate the encodings this font face is available in + void SetFaceName(const wxString& facename); // call to start enumeration void DoEnumerate(); @@ -74,9 +74,6 @@ private: // if not empty, enum only the fonts with this facename wxString m_facename; - // if not empty, enum only the fonts in this family - wxString m_family; - // if true, enum only fixed fonts bool m_fixedOnly; @@ -117,10 +114,10 @@ wxFontEnumeratorHelper::wxFontEnumeratorHelper(wxFontEnumerator *fontEnum) m_enumEncodings = false; } -void wxFontEnumeratorHelper::SetFamily(const wxString& family) +void wxFontEnumeratorHelper::SetFaceName(const wxString& facename) { m_enumEncodings = true; - m_family = family; + m_facename = facename; } bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding) @@ -256,10 +253,10 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, return true; } -bool wxFontEnumerator::EnumerateEncodings(const wxString& family) +bool wxFontEnumerator::EnumerateEncodings(const wxString& facename) { wxFontEnumeratorHelper fe(this); - fe.SetFamily(family); + fe.SetFaceName(facename); fe.DoEnumerate(); return true;