From 271df93cb3f417955a3637ca7e170b897ae81c32 Mon Sep 17 00:00:00 2001 From: Milosz Derezynski Date: Thu, 18 May 2006 18:58:55 +0000 Subject: * Check for a valid font family in the text toolbox's selection_changed callback * Throw an exception if no TreePath can be found in the map (as in "no such family exists") (bzr r879) --- src/widgets/font-selector.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/widgets/font-selector.cpp') diff --git a/src/widgets/font-selector.cpp b/src/widgets/font-selector.cpp index ec619c50c..51f706d4b 100644 --- a/src/widgets/font-selector.cpp +++ b/src/widgets/font-selector.cpp @@ -383,13 +383,18 @@ GtkWidget *sp_font_selector_new() void sp_font_selector_set_font (SPFontSelector *fsel, font_instance *font, double size) { - if (font && (fsel->font != font || size != fsel->fontsize)) { gchar family[256]; font->Family (family, 256); + + Gtk::TreePath path; - Gtk::TreePath path = Inkscape::FontLister::get_instance()->get_row_for_font (family); + try { + path = Inkscape::FontLister::get_instance()->get_row_for_font (family); + } catch (...) { + return; + } fsel->block_emit = TRUE; gtk_tree_selection_select_path (gtk_tree_view_get_selection (GTK_TREE_VIEW (fsel->family_treeview)), path.gobj()); -- cgit v1.2.3