From 93650897c928bfa9ca9b737cfbff55c25271d5d3 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 8 Dec 2015 00:34:32 +0100 Subject: cppification : GHashMaps replaced by stl maps. getResouceList now gives a std::set. Should give some performance improvements (quite a few linear lookups are now logarithmic) (bzr r14504.1.6) --- src/color-profile.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/color-profile.cpp') diff --git a/src/color-profile.cpp b/src/color-profile.cpp index 690a72654..34f1b0155 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -488,18 +488,17 @@ static int getLcmsIntent( guint svgIntent ) static SPObject* bruteFind( SPDocument* document, gchar const* name ) { SPObject* result = 0; - const GSList * current = document->getResourceList("iccprofile"); - while ( current && !result ) { - if ( IS_COLORPROFILE(current->data) ) { - ColorProfile* prof = COLORPROFILE(current->data); + std::set current = document->getResourceList("iccprofile"); + for (std::set::const_iterator it = current.begin(); (!result) && (it != current.end()); ++it) { + if ( IS_COLORPROFILE(*it) ) { + ColorProfile* prof = COLORPROFILE(*it); if ( prof ) { if ( prof->name && (strcmp(prof->name, name) == 0) ) { - result = SP_OBJECT(current->data); + result = SP_OBJECT(*it); break; } } } - current = g_slist_next(current); } return result; -- cgit v1.2.3 From 38f4e0e9aeb0696939475ce9450a20b281144d27 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Fri, 18 Dec 2015 23:31:07 +0100 Subject: brings back CMS tab Fixed bugs: - https://launchpad.net/bugs/1504612 (bzr r14537) --- src/color-profile.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/color-profile.cpp') diff --git a/src/color-profile.cpp b/src/color-profile.cpp index 34f1b0155..bcefe994a 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -271,6 +271,7 @@ void ColorProfile::build(SPDocument *document, Inkscape::XML::Node *repr) { SPObject::build(document, repr); this->readAttr( "xlink:href" ); + this->readAttr( "id" ); this->readAttr( "local" ); this->readAttr( "name" ); this->readAttr( "rendering-intent" ); -- cgit v1.2.3