diff options
| author | Marc Jeanmougin <mc@localhost.localdomain> | 2015-02-21 16:23:30 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <mc@localhost.localdomain> | 2015-02-21 16:23:30 +0000 |
| commit | 47d7675c0ec6a65e27e9ff69a8bfd34b621effab (patch) | |
| tree | 95c42b6faebb24ee00f1255e154c451472a8ef5d /src/sp-item-group.cpp | |
| parent | Fix for bug 469885: Tiled Clones / Trace: Apply to Size skews resulting clone... (diff) | |
| download | inkscape-47d7675c0ec6a65e27e9ff69a8bfd34b621effab.tar.gz inkscape-47d7675c0ec6a65e27e9ff69a8bfd34b621effab.zip | |
Fix for the performance loss in ungrouping observed by Tavmjong in rev 13933
Added std::list<SPObject*> hrefList member to SPObject class.
(bzr r13935)
Diffstat (limited to 'src/sp-item-group.cpp')
| -rw-r--r-- | src/sp-item-group.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 3c2053cb2..0f76051bc 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -399,10 +399,10 @@ void SPGroup::snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape: } } -void sp_item_group_ungroup_handle_clones(SPGroup *group,SPItem *parent, Geom::Affine const g) +void sp_item_group_ungroup_handle_clones(SPItem *parent, Geom::Affine const g) { - for (SPObject *child = group->firstChild() ; child; child = child->getNext() ) { - SPItem *citem = dynamic_cast<SPItem *>(child); + for(std::list<SPObject*>::const_iterator refd=parent->hrefList.begin();refd!=parent->hrefList.end();refd++){ + SPItem *citem = dynamic_cast<SPItem *>(*refd); if (citem) { SPUse *useitem = dynamic_cast<SPUse *>(citem); if (useitem && useitem->get_original() == parent) { @@ -412,10 +412,6 @@ void sp_item_group_ungroup_handle_clones(SPGroup *group,SPItem *parent, Geom::Af citem->setAttribute("transform", affinestr); g_free(affinestr); } - SPGroup *groupitem = dynamic_cast<SPGroup *>(citem); - if (groupitem) { - sp_item_group_ungroup_handle_clones(groupitem,parent,g); - } } } } @@ -459,7 +455,7 @@ sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done) for (SPObject *child = group->firstChild() ; child; child = child->getNext() ) if (SPItem *citem = dynamic_cast<SPItem *>(child)) - sp_item_group_ungroup_handle_clones(root,citem,g); + sp_item_group_ungroup_handle_clones(citem,g); for (SPObject *child = group->firstChild() ; child; child = child->getNext() ) { |
