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:
committed by
Vadim Zeitlin
parent
e2a846e182
commit
3572c2c654
@@ -124,7 +124,8 @@ bool wxFontEnumerator::EnumerateEncodingsUTF8(const wxString& facename)
|
|||||||
|
|
||||||
for ( size_t n = 0; n < count; n++ )
|
for ( size_t n = 0; n < count; n++ )
|
||||||
{
|
{
|
||||||
OnFontEncoding(facenames[n], utf8);
|
if ( !OnFontEncoding(facenames[n], utf8) )
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@@ -81,7 +81,10 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
const gchar *name = pango_font_family_get_name(families[i]);
|
const gchar *name = pango_font_family_get_name(families[i]);
|
||||||
OnFacename(wxString(name, wxConvUTF8));
|
if ( !OnFacename(wxString(name, wxConvUTF8)) )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_free(families);
|
g_free(families);
|
||||||
|
Reference in New Issue
Block a user