Fix the stop function of wxFontEnumerator for wxGTK

In a wxFontEnumerator, if false is returned from OnFacename() or
OnFontEncoding(), the enumeration is supposed to stop.  This was not happening
on wxGTK.

Closes https://github.com/wxWidgets/wxWidgets/pull/311
This commit is contained in:
Scott Talbert 2016-08-07 23:15:41 -04:00 committed by Vadim Zeitlin
parent e2a846e182
commit 3572c2c654
2 changed files with 6 additions and 2 deletions

View File

@ -124,7 +124,8 @@ bool wxFontEnumerator::EnumerateEncodingsUTF8(const wxString& facename)
for ( size_t n = 0; n < count; n++ )
{
OnFontEncoding(facenames[n], utf8);
if ( !OnFontEncoding(facenames[n], utf8) )
break;
}
return true;

View File

@ -81,7 +81,10 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
#endif
{
const gchar *name = pango_font_family_get_name(families[i]);
OnFacename(wxString(name, wxConvUTF8));
if ( !OnFacename(wxString(name, wxConvUTF8)) )
{
break;
}
}
}
g_free(families);