summaryrefslogtreecommitdiffstats
path: root/src/sp-clippath.cpp
diff options
context:
space:
mode:
authorAdrian Boguszewski <adrbogus1@student.pg.gda.pl>2016-08-09 09:58:51 +0000
committerAdrian Boguszewski <adrbogus1@student.pg.gda.pl>2016-08-09 09:58:51 +0000
commite5143d65bb57d4ce623e6220585b099e6d2ee453 (patch)
tree4ff78f6fa8f0c1b740fd43b0ade2b91dbf9226d0 /src/sp-clippath.cpp
parentRemove deprecated Autotools and btool files. Please use CMake instead (diff)
parentMerged trunk (diff)
downloadinkscape-e5143d65bb57d4ce623e6220585b099e6d2ee453.tar.gz
inkscape-e5143d65bb57d4ce623e6220585b099e6d2ee453.zip
Merged gsoc work. Created better data structure for selections, replaced SPObject children list, improved spray tool, split tests to separate executables
(bzr r15047)
Diffstat (limited to 'src/sp-clippath.cpp')
-rw-r--r--src/sp-clippath.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp
index 915c57e45..b371e15b2 100644
--- a/src/sp-clippath.cpp
+++ b/src/sp-clippath.cpp
@@ -127,9 +127,9 @@ void SPClipPath::update(SPCtx* ctx, unsigned int flags) {
flags &= SP_OBJECT_MODIFIED_CASCADE;
GSList *l = NULL;
- for ( SPObject *child = this->firstChild(); child; child = child->getNext()) {
- sp_object_ref(child);
- l = g_slist_prepend(l, child);
+ for (auto& child: children) {
+ sp_object_ref(&child);
+ l = g_slist_prepend(l, &child);
}
l = g_slist_reverse(l);
@@ -166,9 +166,9 @@ void SPClipPath::modified(unsigned int flags) {
flags &= SP_OBJECT_MODIFIED_CASCADE;
GSList *l = NULL;
- for (SPObject *child = this->firstChild(); child; child = child->getNext()) {
- sp_object_ref(child);
- l = g_slist_prepend(l, child);
+ for (auto& child: children) {
+ sp_object_ref(&child);
+ l = g_slist_prepend(l, &child);
}
l = g_slist_reverse(l);
@@ -199,9 +199,9 @@ Inkscape::DrawingItem *SPClipPath::show(Inkscape::Drawing &drawing, unsigned int
Inkscape::DrawingGroup *ai = new Inkscape::DrawingGroup(drawing);
display = sp_clippath_view_new_prepend(display, key, ai);
- for ( SPObject *child = firstChild() ; child ; child = child->getNext() ) {
- if (SP_IS_ITEM(child)) {
- Inkscape::DrawingItem *ac = SP_ITEM(child)->invoke_show(drawing, key, SP_ITEM_REFERENCE_FLAGS);
+ for (auto& child: children) {
+ if (SP_IS_ITEM(&child)) {
+ Inkscape::DrawingItem *ac = SP_ITEM(&child)->invoke_show(drawing, key, SP_ITEM_REFERENCE_FLAGS);
if (ac) {
/* The order is not important in clippath */
@@ -222,9 +222,9 @@ Inkscape::DrawingItem *SPClipPath::show(Inkscape::Drawing &drawing, unsigned int
}
void SPClipPath::hide(unsigned int key) {
- for ( SPObject *child = firstChild() ; child; child = child->getNext() ) {
- if (SP_IS_ITEM(child)) {
- SP_ITEM(child)->invoke_hide(key);
+ for (auto& child: children) {
+ if (SP_IS_ITEM(&child)) {
+ SP_ITEM(&child)->invoke_hide(key);
}
}
@@ -251,9 +251,9 @@ void SPClipPath::setBBox(unsigned int key, Geom::OptRect const &bbox) {
Geom::OptRect SPClipPath::geometricBounds(Geom::Affine const &transform) {
Geom::OptRect bbox;
- for (SPObject *i = firstChild(); i; i = i->getNext()) {
- if (SP_IS_ITEM(i)) {
- Geom::OptRect tmp = SP_ITEM(i)->geometricBounds(Geom::Affine(SP_ITEM(i)->transform) * transform);
+ for (auto& i: children) {
+ if (SP_IS_ITEM(&i)) {
+ Geom::OptRect tmp = SP_ITEM(&i)->geometricBounds(Geom::Affine(SP_ITEM(&i)->transform) * transform);
bbox.unionWith(tmp);
}
}