summaryrefslogtreecommitdiffstats
path: root/src/gradient-chemistry.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2015-12-07 23:34:32 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2015-12-07 23:34:32 +0000
commit93650897c928bfa9ca9b737cfbff55c25271d5d3 (patch)
tree140edc7a4fdb7f1bc5944842a154681964243494 /src/gradient-chemistry.cpp
parentupdate to trunk (no conflict) (diff)
downloadinkscape-93650897c928bfa9ca9b737cfbff55c25271d5d3.tar.gz
inkscape-93650897c928bfa9ca9b737cfbff55c25271d5d3.zip
cppification : GHashMaps replaced by stl maps. getResouceList now gives a std::set<SPObject *>.
Should give some performance improvements (quite a few linear lookups are now logarithmic) (bzr r14504.1.6)
Diffstat (limited to 'src/gradient-chemistry.cpp')
-rw-r--r--src/gradient-chemistry.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp
index 29522d7b1..9f2d030d4 100644
--- a/src/gradient-chemistry.cpp
+++ b/src/gradient-chemistry.cpp
@@ -1612,9 +1612,9 @@ void sp_gradient_unset_swatch(SPDesktop *desktop, std::string id)
SPDocument *doc = desktop ? desktop->doc() : 0;
if (doc) {
- const GSList *gradients = doc->getResourceList("gradient");
- for (const GSList *item = gradients; item; item = item->next) {
- SPGradient* grad = SP_GRADIENT(item->data);
+ const std::set<SPObject *> gradients = doc->getResourceList("gradient");
+ for (std::set<SPObject *>::const_iterator i = gradients.begin(); i != gradients.end(); ++i) {
+ SPGradient* grad = SP_GRADIENT(*i);
if ( id == grad->getId() ) {
grad->setSwatch(false);
DocumentUndo::done(doc, SP_VERB_CONTEXT_GRADIENT,