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:
parent
e2a846e182
commit
3572c2c654
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user