diff options
Diffstat (limited to 'src/ui/widget')
| -rw-r--r-- | src/ui/widget/color-icc-selector.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ui/widget/color-icc-selector.cpp b/src/ui/widget/color-icc-selector.cpp index 7928311d5..f1dd92746 100644 --- a/src/ui/widget/color-icc-selector.cpp +++ b/src/ui/widget/color-icc-selector.cpp @@ -663,6 +663,9 @@ struct _cmp { } }; +template <typename From, typename To> +struct static_caster { To * operator () (From * value) const { return static_cast<To *>(value); } }; + void ColorICCSelectorImpl::_profilesChanged(std::string const &name) { GtkComboBox *combo = GTK_COMBO_BOX(_profileSel); @@ -682,11 +685,10 @@ void ColorICCSelectorImpl::_profilesChanged(std::string const &name) std::vector<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList("iccprofile"); std::set<Inkscape::ColorProfile *, Inkscape::ColorProfile::pointerComparator> _current; - for (auto &it: current) { - SPObject* obj = it; - Inkscape::ColorProfile* prof = reinterpret_cast<Inkscape::ColorProfile*>(obj); - _current.insert(prof); - } + std::transform(current.begin(), + current.end(), + std::inserter(_current, _current.begin()), + static_caster<SPObject, Inkscape::ColorProfile>()); for (auto &it: _current) { Inkscape::ColorProfile *prof = it; |
