X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Flibnrtype%2Ffont-lister.h;h=13611caf7189bf438ca3006c66e34fe01370e2bb;hb=d1150228ea8064478ea50cd32e99d399b16455e3;hp=fb0810254e4617cd08bc5c25ebd297971620257a;hpb=9bc8c3c5a9c7c7364a767e1209fc44293a444b0b;p=inkscape.git diff --git a/src/libnrtype/font-lister.h b/src/libnrtype/font-lister.h index fb0810254..13611caf7 100644 --- a/src/libnrtype/font-lister.h +++ b/src/libnrtype/font-lister.h @@ -35,7 +35,7 @@ namespace Inkscape }; - ~FontLister (); + virtual ~FontLister (); /** GtkTreeModelColumnRecord for the font list Gtk::ListStore */ @@ -45,7 +45,7 @@ namespace Inkscape public: /** Column containing the family name */ - Gtk::TreeModelColumn font; + Gtk::TreeModelColumn font; /** Column containing an std::vector with style names * for the corresponding family @@ -59,8 +59,22 @@ namespace Inkscape } }; + /* Case-insensitive < compare for standard strings */ + class StringLessThan + { + public: + bool operator () (std::string str1, std::string str2) const + { + std::string s1=str1; // Can't transform the originals! + std::string s2=str2; + std::transform(s1.begin(), s1.end(), s1.begin(), (int(*)(int)) toupper); + std::transform(s2.begin(), s2.end(), s2.begin(), (int(*)(int)) toupper); + return s1 IterMapType; + typedef std::map IterMapType; /** Returns the ListStore with the font names * @@ -79,7 +93,7 @@ namespace Inkscape } Gtk::TreePath - get_row_for_font (std::string family) + get_row_for_font (Glib::ustring family) { IterMapType::iterator iter = font_list_store_iter_map.find (family); if (iter == font_list_store_iter_map.end ()) throw FAMILY_NOT_FOUND;