diff options
author | Matthias Clasen <mclasen@redhat.com> | 2005-09-09 19:01:02 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2005-09-09 19:01:02 +0000 |
commit | ca53272b7fbad798531027ced630d56109e938b0 (patch) | |
tree | 97fb5e7bfbb7ca8cfa46a02aeb3df59131f57444 /gtk/gtkfontsel.c | |
parent | 5c0d5d0b331cf1454863dd22db01d78092f28fe7 (diff) | |
download | gtk+-ca53272b7fbad798531027ced630d56109e938b0.tar.gz |
Handle invalid fontnames better. (#136926, Michael R. Walton)
2005-09-09 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfontsel.c (gtk_font_selection_set_font_name): Handle
invalid fontnames better. (#136926, Michael R. Walton)
Diffstat (limited to 'gtk/gtkfontsel.c')
-rw-r--r-- | gtk/gtkfontsel.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gtk/gtkfontsel.c b/gtk/gtkfontsel.c index 4b50089500..7e83cc45d3 100644 --- a/gtk/gtkfontsel.c +++ b/gtk/gtkfontsel.c @@ -1198,13 +1198,18 @@ gtk_font_selection_set_font_name (GtkFontSelection *fontsel, GtkTreeIter iter; GtkTreeIter match_iter; gboolean valid; + const gchar *new_family_name; g_return_val_if_fail (GTK_IS_FONT_SELECTION (fontsel), FALSE); new_desc = pango_font_description_from_string (fontname); + new_family_name = pango_font_description_get_family (new_desc); - /* Check to make sure that this is in the list of allowed fonts */ + if (!new_family_name) + return FALSE; + /* Check to make sure that this is in the list of allowed fonts + */ model = gtk_tree_view_get_model (GTK_TREE_VIEW (fontsel->family_list)); for (valid = gtk_tree_model_get_iter_first (model, &iter); valid; @@ -1215,7 +1220,7 @@ gtk_font_selection_set_font_name (GtkFontSelection *fontsel, gtk_tree_model_get (model, &iter, FAMILY_COLUMN, &family, -1); if (g_ascii_strcasecmp (pango_font_family_get_name (family), - pango_font_description_get_family (new_desc)) == 0) + new_family_name) == 0) new_family = family; g_object_unref (family); |