summaryrefslogtreecommitdiffstats
path: root/src/ui/widget
diff options
context:
space:
mode:
authorMichael Soegtrop <MSoegtrop@yahoo.de>2016-06-12 10:52:33 +0000
committerMichael Soegtrop <MSoegtrop@yahoo.de>2016-06-12 10:52:33 +0000
commit013ba80c5b0115dbb0f6da01e1f42806a4037eb8 (patch)
treefe8d764a8e808c2084df8ace149d472109f3ae25 /src/ui/widget
parentFixed Bool LPE review issues (diff)
parentOptionally sort attributes and properties into a canonical order. (diff)
downloadinkscape-013ba80c5b0115dbb0f6da01e1f42806a4037eb8.tar.gz
inkscape-013ba80c5b0115dbb0f6da01e1f42806a4037eb8.zip
updated to latest trunk
(bzr r14876.2.3)
Diffstat (limited to 'src/ui/widget')
-rw-r--r--src/ui/widget/color-icc-selector.cpp17
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);