diff options
| author | Ted Gould <ted@gould.cx> | 2016-08-12 04:11:03 +0000 |
|---|---|---|
| committer | Ted Gould <ted@gould.cx> | 2016-08-12 04:11:03 +0000 |
| commit | ff848ebc9919d158c3ec3d7420e72b6aca99a3ea (patch) | |
| tree | 030ab171865d0ed7f6bae3ef68315639cdb2622b /src/sp-hatch.cpp | |
| parent | Merging 0.92.x branch (diff) | |
| parent | CloneTiler: Further C++ification (diff) | |
| download | inkscape-ff848ebc9919d158c3ec3d7420e72b6aca99a3ea.tar.gz inkscape-ff848ebc9919d158c3ec3d7420e72b6aca99a3ea.zip | |
Merge trunk
(bzr r14950.1.20)
Diffstat (limited to 'src/sp-hatch.cpp')
| -rw-r--r-- | src/sp-hatch.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/sp-hatch.cpp b/src/sp-hatch.cpp index 2d938618c..02d95c75c 100644 --- a/src/sp-hatch.cpp +++ b/src/sp-hatch.cpp @@ -25,11 +25,8 @@ #include "display/drawing-pattern.h" #include "attributes.h" #include "document-private.h" -#include "uri.h" -#include "style.h" #include "sp-hatch.h" #include "sp-hatch-path.h" -#include "xml/repr.h" SPHatch::SPHatch() : SPPaintServer(), @@ -233,14 +230,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 +245,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 +261,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); } |
