summaryrefslogtreecommitdiffstats
path: root/src/extension/internal/emf-print.cpp
diff options
context:
space:
mode:
authorkamalpreetgrewal <grewalkamal005@gmail.com>2016-08-15 03:59:18 +0000
committerkamalpreetgrewal <grewalkamal005@gmail.com>2016-08-15 03:59:18 +0000
commit25a9ed4f38121eeb59cf15dbf19391aaef45bba3 (patch)
treee123aeae50d98a52e1ad4575b29bf3c199619e33 /src/extension/internal/emf-print.cpp
parentSolve crash when deleting CSS property (diff)
parentinkview: Convert to ApplicationWindow (diff)
downloadinkscape-25a9ed4f38121eeb59cf15dbf19391aaef45bba3.tar.gz
inkscape-25a9ed4f38121eeb59cf15dbf19391aaef45bba3.zip
Merge changes from trunk
(bzr r14949.1.64)
Diffstat (limited to 'src/extension/internal/emf-print.cpp')
-rw-r--r--src/extension/internal/emf-print.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp
index 9f3b5475f..d4c5d95a3 100644
--- a/src/extension/internal/emf-print.cpp
+++ b/src/extension/internal/emf-print.cpp
@@ -1042,8 +1042,12 @@ void PrintEmf::do_clip_if_present(SPStyle const *style){
/* find the clipping path */
Geom::PathVector combined_pathvector;
Geom::Affine tfc; // clipping transform, generally not the same as item transform
- for(item = SP_ITEM(scp->firstChild()); item; item=SP_ITEM(item->getNext())){
- if (SP_IS_GROUP(item)) { // not implemented
+ for (auto& child: scp->children) {
+ item = SP_ITEM(&child);
+ if (!item) {
+ break;
+ }
+ if (SP_IS_GROUP(item)) { // not implemented
// return sp_group_render(item);
combined_pathvector = merge_PathVector_with_group(combined_pathvector, item, tfc);
} else if (SP_IS_SHAPE(item)) {
@@ -1081,7 +1085,11 @@ Geom::PathVector PrintEmf::merge_PathVector_with_group(Geom::PathVector const &c
new_combined_pathvector = combined_pathvector;
SPGroup *group = SP_GROUP(item);
Geom::Affine tfc = item->transform * transform;
- for(SPItem *item = SP_ITEM(group->firstChild()); item; item=SP_ITEM(item->getNext())){
+ for (auto& child: group->children) {
+ item = SP_ITEM(&child);
+ if (!item) {
+ break;
+ }
if (SP_IS_GROUP(item)) {
new_combined_pathvector = merge_PathVector_with_group(new_combined_pathvector, item, tfc); // could be endlessly recursive on a badly formed SVG
} else if (SP_IS_SHAPE(item)) {