diff options
| author | houz <houz@gmx.de> | 2016-06-02 13:12:07 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2016-06-02 13:12:07 +0000 |
| commit | 86a74b4a93ab62c8ef7819dc549fe7b3ace24916 (patch) | |
| tree | 26e362218ea55b81ca775b05b7acd0d8587ea16f /src/ui/widget | |
| parent | Translations. Updating all translation files. (diff) | |
| download | inkscape-86a74b4a93ab62c8ef7819dc549fe7b3ace24916.tar.gz inkscape-86a74b4a93ab62c8ef7819dc549fe7b3ace24916.zip | |
Sort color profile lists
Fixed bugs:
- https://launchpad.net/bugs/1457126
(bzr r14946)
Diffstat (limited to 'src/ui/widget')
| -rw-r--r-- | src/ui/widget/color-icc-selector.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ui/widget/color-icc-selector.cpp b/src/ui/widget/color-icc-selector.cpp index 2e30a48b5..b422892fe 100644 --- a/src/ui/widget/color-icc-selector.cpp +++ b/src/ui/widget/color-icc-selector.cpp @@ -671,6 +671,20 @@ void ColorICCSelectorImpl::_switchToProfile(gchar const *name) #endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) #if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +struct _cmp { + bool operator()(const SPObject * const & a, const SPObject * const & b) + { + const Inkscape::ColorProfile &a_prof = reinterpret_cast<const Inkscape::ColorProfile &>(*a); + const Inkscape::ColorProfile &b_prof = reinterpret_cast<const Inkscape::ColorProfile &>(*b); + gchar *a_name_casefold = g_utf8_casefold(a_prof.name, -1 ); + gchar *b_name_casefold = g_utf8_casefold(b_prof.name, -1 ); + int result = g_strcmp0(a_name_casefold, b_name_casefold); + g_free(a_name_casefold); + g_free(b_name_casefold); + return result < 0; + } +}; + void ColorICCSelectorImpl::_profilesChanged(std::string const &name) { GtkComboBox *combo = GTK_COMBO_BOX(_profileSel); @@ -688,7 +702,8 @@ void ColorICCSelectorImpl::_profilesChanged(std::string const &name) int index = 1; std::vector<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList("iccprofile"); - for (std::vector<SPObject *>::const_iterator it = current.begin(); it != current.end(); ++it) { + std::set<SPObject *, _cmp> _current(current.begin(), current.end()); + for (std::set<SPObject *, _cmp>::const_iterator it = _current.begin(); it != _current.end(); ++it) { SPObject *obj = *it; Inkscape::ColorProfile *prof = reinterpret_cast<Inkscape::ColorProfile *>(obj); |
