diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2016-10-03 20:51:05 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2016-10-03 20:51:05 +0000 |
| commit | 4db35e8a6706ddece9e977e5f26d4a6867ff8cbe (patch) | |
| tree | f9711f260f694d96e26bf3216fb64f2b38611b2b /src/sp-hatch.cpp | |
| parent | update to trunk (diff) | |
| parent | Merge in jabiertxof's hover information for measure tool (diff) | |
| download | inkscape-4db35e8a6706ddece9e977e5f26d4a6867ff8cbe.tar.gz inkscape-4db35e8a6706ddece9e977e5f26d4a6867ff8cbe.zip | |
Update to trunk
(bzr r15017.1.35)
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); } |
