diff options
| author | bulia byak <buliabyak@gmail.com> | 2008-08-11 00:14:32 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2008-08-11 00:14:32 +0000 |
| commit | 9bb3dac067eec3752ba52849cdad47dbdce824af (patch) | |
| tree | e51334d75ff3b1de345d85b4d99e57e3c049300f /src/libnrtype | |
| parent | clean up code slightly (diff) | |
| download | inkscape-9bb3dac067eec3752ba52849cdad47dbdce824af.tar.gz inkscape-9bb3dac067eec3752ba52849cdad47dbdce824af.zip | |
patch from bug 169004
(bzr r6605)
Diffstat (limited to 'src/libnrtype')
| -rw-r--r-- | src/libnrtype/font-lister.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/libnrtype/font-lister.h b/src/libnrtype/font-lister.h index b2d2a3ecf..13611caf7 100644 --- a/src/libnrtype/font-lister.h +++ b/src/libnrtype/font-lister.h @@ -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<s2; + } + }; + FontListClass FontList; - typedef std::map<Glib::ustring, Gtk::TreePath> IterMapType; + typedef std::map<Glib::ustring, Gtk::TreePath, StringLessThan> IterMapType; /** Returns the ListStore with the font names * |
