index fb0810254e4617cd08bc5c25ebd297971620257a..13611caf7189bf438ca3006c66e34fe01370e2bb 100644 (file)
};
};
- ~FontLister ();
+ virtual ~FontLister ();
/** GtkTreeModelColumnRecord for the font list Gtk::ListStore
*/
/** GtkTreeModelColumnRecord for the font list Gtk::ListStore
*/
public:
/** Column containing the family name
*/
public:
/** Column containing the family name
*/
- Gtk::TreeModelColumn<std::string> font;
+ Gtk::TreeModelColumn<Glib::ustring> font;
/** Column containing an std::vector<std::string> with style names
* for the corresponding family
/** Column containing an std::vector<std::string> with style names
* for the corresponding family
}
};
}
};
+ /* 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<s2;
+ }
+ };
+
FontListClass FontList;
FontListClass FontList;
- typedef std::map<std::string, Gtk::TreePath> IterMapType;
+ typedef std::map<Glib::ustring, Gtk::TreePath, StringLessThan> IterMapType;
/** Returns the ListStore with the font names
*
/** Returns the ListStore with the font names
*
}
Gtk::TreePath
}
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;
{
IterMapType::iterator iter = font_list_store_iter_map.find (family);
if (iter == font_list_store_iter_map.end ()) throw FAMILY_NOT_FOUND;