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/libnrtype/font-lister.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/libnrtype') diff --git a/src/libnrtype/font-lister.h b/src/libnrtype/font-lister.h index b43395912..fb0810254 100644 --- a/src/libnrtype/font-lister.h +++ b/src/libnrtype/font-lister.h @@ -28,6 +28,13 @@ namespace Inkscape class FontLister { public: + + enum Exceptions + { + FAMILY_NOT_FOUND + }; + + ~FontLister (); /** GtkTreeModelColumnRecord for the font list Gtk::ListStore @@ -75,6 +82,7 @@ namespace Inkscape get_row_for_font (std::string family) { IterMapType::iterator iter = font_list_store_iter_map.find (family); + if (iter == font_list_store_iter_map.end ()) throw FAMILY_NOT_FOUND; return (*iter).second; } -- cgit v1.2.3