diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2016-06-11 15:34:03 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2016-06-11 15:34:03 +0000 |
| commit | d6b2e2cdeb563026cc9f4633e687a607b095da87 (patch) | |
| tree | b25e3e95e5e96782232e65d0d9889fcb12c2f285 /src/ui/widget | |
| parent | Fixing satellites bug on erase (diff) | |
| parent | A little cleaning up of attributes. (diff) | |
| download | inkscape-d6b2e2cdeb563026cc9f4633e687a607b095da87.tar.gz inkscape-d6b2e2cdeb563026cc9f4633e687a607b095da87.zip | |
update to trunk
(bzr r13645.1.147)
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); |
