summaryrefslogtreecommitdiffstats
path: root/src/extension/internal/metafile-print.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/extension/internal/metafile-print.cpp')
-rw-r--r--src/extension/internal/metafile-print.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/extension/internal/metafile-print.cpp b/src/extension/internal/metafile-print.cpp
index 47ba5971c..061eb634d 100644
--- a/src/extension/internal/metafile-print.cpp
+++ b/src/extension/internal/metafile-print.cpp
@@ -293,20 +293,22 @@ void PrintMetafile::brush_classify(SPObject *parent, int depth, Inkscape::Pixbuf
}
// still looking? Look at this pattern's children, if there are any
- SPObject *child = pat_i->firstChild();
- while (child && !(*epixbuf) && (*hatchType == -1)) {
- brush_classify(child, depth, epixbuf, hatchType, hatchColor, bkColor);
- child = child->getNext();
+ for (auto& child: pat_i->children) {
+ if (*epixbuf || *hatchType != -1) {
+ break;
+ }
+ brush_classify(&child, depth, epixbuf, hatchType, hatchColor, bkColor);
}
}
} else if (SP_IS_IMAGE(parent)) {
*epixbuf = ((SPImage *)parent)->pixbuf;
return;
} else { // some inkscape rearrangements pass through nodes between pattern and image which are not classified as either.
- SPObject *child = parent->firstChild();
- while (child && !(*epixbuf) && (*hatchType == -1)) {
- brush_classify(child, depth, epixbuf, hatchType, hatchColor, bkColor);
- child = child->getNext();
+ for (auto& child: parent->children) {
+ if (*epixbuf || *hatchType != -1) {
+ break;
+ }
+ brush_classify(&child, depth, epixbuf, hatchType, hatchColor, bkColor);
}
}
}