summaryrefslogtreecommitdiffstats
path: root/src/sp-hatch.cpp
diff options
context:
space:
mode:
authorAdrian Boguszewski <adrbogus1@student.pg.gda.pl>2016-07-13 11:36:19 +0000
committerAdrian Boguszewski <adrbogus1@student.pg.gda.pl>2016-07-13 11:36:19 +0000
commitd1947e768272c703674129d5c583204ff2b59251 (patch)
treec1bf1563d0c0837cbab3733c18df0c7c82b18ff4 /src/sp-hatch.cpp
parentMerged trunk (diff)
downloadinkscape-d1947e768272c703674129d5c583204ff2b59251.tar.gz
inkscape-d1947e768272c703674129d5c583204ff2b59251.zip
Second part of new SPObject children list
(bzr r14954.1.19)
Diffstat (limited to 'src/sp-hatch.cpp')
-rw-r--r--src/sp-hatch.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/sp-hatch.cpp b/src/sp-hatch.cpp
index 2d938618c..c06045e8f 100644
--- a/src/sp-hatch.cpp
+++ b/src/sp-hatch.cpp
@@ -233,14 +233,13 @@ void SPHatch::set(unsigned int key, const gchar* value)
bool SPHatch::_hasHatchPatchChildren(SPHatch const *hatch)
{
- bool matched = false;
- for (SPObject const *child = hatch->firstChild(); child && !matched; child = child->getNext() ) {
- SPHatchPath const *hatchPath = dynamic_cast<SPHatchPath const *>(child);
+ for (auto& child: hatch->_children) {
+ SPHatchPath const *hatchPath = dynamic_cast<SPHatchPath const *>(&child);
if (hatchPath) {
- matched = true;
+ return true;
}
}
- return matched;
+ return false;
}
std::vector<SPHatchPath*> SPHatch::hatchPaths()
@@ -249,8 +248,8 @@ std::vector<SPHatchPath*> SPHatch::hatchPaths()
SPHatch *src = chase_hrefs<SPHatch>(this, sigc::ptr_fun(&_hasHatchPatchChildren));
if (src) {
- for (SPObject *child = src->firstChild(); child; child = child->getNext()) {
- SPHatchPath *hatchPath = dynamic_cast<SPHatchPath *>(child);
+ for (auto& child: src->_children) {
+ SPHatchPath *hatchPath = dynamic_cast<SPHatchPath *>(&child);
if (hatchPath) {
list.push_back(hatchPath);
}
@@ -265,8 +264,8 @@ std::vector<SPHatchPath const*> SPHatch::hatchPaths() const
SPHatch const *src = chase_hrefs<SPHatch const>(this, sigc::ptr_fun(&_hasHatchPatchChildren));
if (src) {
- for (SPObject const *child = src->firstChild(); child; child = child->getNext()) {
- SPHatchPath const *hatchPath = dynamic_cast<SPHatchPath const*>(child);
+ for (auto& child: src->_children) {
+ SPHatchPath const *hatchPath = dynamic_cast<SPHatchPath const*>(&child);
if (hatchPath) {
list.push_back(hatchPath);
}