diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2015-12-07 23:34:32 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2015-12-07 23:34:32 +0000 |
| commit | 93650897c928bfa9ca9b737cfbff55c25271d5d3 (patch) | |
| tree | 140edc7a4fdb7f1bc5944842a154681964243494 /src/resource-manager.cpp | |
| parent | update to trunk (no conflict) (diff) | |
| download | inkscape-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/resource-manager.cpp')
| -rw-r--r-- | src/resource-manager.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/resource-manager.cpp b/src/resource-manager.cpp index dbff27827..18d7c6ba2 100644 --- a/src/resource-manager.cpp +++ b/src/resource-manager.cpp @@ -179,9 +179,9 @@ std::vector<Glib::ustring> ResourceManagerImpl::findBrokenLinks( SPDocument *doc std::set<Glib::ustring> uniques; if ( doc ) { - GSList const *images = doc->getResourceList("image"); - for (GSList const *it = images; it; it = it->next) { - Inkscape::XML::Node *ir = static_cast<SPObject *>(it->data)->getRepr(); + std::set<SPObject *> images = doc->getResourceList("image"); + for (std::set<SPObject *>::const_iterator it = images.begin(); it != images.end(); ++it) { + Inkscape::XML::Node *ir = (*it)->getRepr(); gchar const *href = ir->attribute("xlink:href"); if ( href && ( uniques.find(href) == uniques.end() ) ) { @@ -305,10 +305,10 @@ bool ResourceManagerImpl::fixupBrokenLinks(SPDocument *doc) bool savedUndoState = DocumentUndo::getUndoSensitive(doc); DocumentUndo::setUndoSensitive(doc, true); - - GSList const *images = doc->getResourceList("image"); - for (GSList const *it = images; it; it = it->next) { - Inkscape::XML::Node *ir = static_cast<SPObject *>(it->data)->getRepr(); + + std::set<SPObject *> images = doc->getResourceList("image"); + for (std::set<SPObject *>::const_iterator it = images.begin(); it != images.end(); ++it) { + Inkscape::XML::Node *ir = (*it)->getRepr(); gchar const *href = ir->attribute("xlink:href"); if ( href ) { |
