summaryrefslogtreecommitdiffstats
path: root/src/widgets/font-selector.cpp
diff options
context:
space:
mode:
authorMilosz Derezynski <mderezynski@gmail.com>2006-05-18 18:58:55 +0000
committermderezynski <mderezynski@users.sourceforge.net>2006-05-18 18:58:55 +0000
commit271df93cb3f417955a3637ca7e170b897ae81c32 (patch)
tree65e2348d78c08302cf74a42ef7039c15efb6bbd2 /src/widgets/font-selector.cpp
parent* Use query api for text toolbar (diff)
downloadinkscape-271df93cb3f417955a3637ca7e170b897ae81c32.tar.gz
inkscape-271df93cb3f417955a3637ca7e170b897ae81c32.zip
* 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)
Diffstat (limited to 'src/widgets/font-selector.cpp')
-rw-r--r--src/widgets/font-selector.cpp9
1 files changed, 7 insertions, 2 deletions
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());