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.
See https://github.com/wxWidgets/wxWidgets/pull/311
(cherry picked from commit 3572c2c654
)
This commit is contained in:
committed by
Vadim Zeitlin
parent
b4e2f93248
commit
a19e512e80
@@ -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;
|
||||
|
@@ -89,7 +89,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);
|
||||
|
Reference in New Issue
Block a user