From d1947e768272c703674129d5c583204ff2b59251 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 13 Jul 2016 13:36:19 +0200 Subject: Second part of new SPObject children list (bzr r14954.1.19) --- src/sp-hatch.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/sp-hatch.cpp') 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(child); + for (auto& child: hatch->_children) { + SPHatchPath const *hatchPath = dynamic_cast(&child); if (hatchPath) { - matched = true; + return true; } } - return matched; + return false; } std::vector SPHatch::hatchPaths() @@ -249,8 +248,8 @@ std::vector SPHatch::hatchPaths() SPHatch *src = chase_hrefs(this, sigc::ptr_fun(&_hasHatchPatchChildren)); if (src) { - for (SPObject *child = src->firstChild(); child; child = child->getNext()) { - SPHatchPath *hatchPath = dynamic_cast(child); + for (auto& child: src->_children) { + SPHatchPath *hatchPath = dynamic_cast(&child); if (hatchPath) { list.push_back(hatchPath); } @@ -265,8 +264,8 @@ std::vector SPHatch::hatchPaths() const SPHatch const *src = chase_hrefs(this, sigc::ptr_fun(&_hasHatchPatchChildren)); if (src) { - for (SPObject const *child = src->firstChild(); child; child = child->getNext()) { - SPHatchPath const *hatchPath = dynamic_cast(child); + for (auto& child: src->_children) { + SPHatchPath const *hatchPath = dynamic_cast(&child); if (hatchPath) { list.push_back(hatchPath); } -- cgit v1.2.3 From 24d3f50003ca3cec6a03a7f5267cc4fe5588c69f Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Jul 2016 13:17:21 +0200 Subject: Renamed children list in SPObject (bzr r14954.1.21) --- src/sp-hatch.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/sp-hatch.cpp') diff --git a/src/sp-hatch.cpp b/src/sp-hatch.cpp index c06045e8f..f667017fa 100644 --- a/src/sp-hatch.cpp +++ b/src/sp-hatch.cpp @@ -233,7 +233,7 @@ void SPHatch::set(unsigned int key, const gchar* value) bool SPHatch::_hasHatchPatchChildren(SPHatch const *hatch) { - for (auto& child: hatch->_children) { + for (auto& child: hatch->children) { SPHatchPath const *hatchPath = dynamic_cast(&child); if (hatchPath) { return true; @@ -248,7 +248,7 @@ std::vector SPHatch::hatchPaths() SPHatch *src = chase_hrefs(this, sigc::ptr_fun(&_hasHatchPatchChildren)); if (src) { - for (auto& child: src->_children) { + for (auto& child: src->children) { SPHatchPath *hatchPath = dynamic_cast(&child); if (hatchPath) { list.push_back(hatchPath); @@ -264,7 +264,7 @@ std::vector SPHatch::hatchPaths() const SPHatch const *src = chase_hrefs(this, sigc::ptr_fun(&_hasHatchPatchChildren)); if (src) { - for (auto& child: src->_children) { + for (auto& child: src->children) { SPHatchPath const *hatchPath = dynamic_cast(&child); if (hatchPath) { list.push_back(hatchPath); -- cgit v1.2.3 From f35bb1f74a0ffeb5c6477a25e3c4cde87a97bcf1 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 28 Jul 2016 12:06:06 +0200 Subject: Removed unused includes, decrease compilation time (bzr r15025) --- src/sp-hatch.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/sp-hatch.cpp') diff --git a/src/sp-hatch.cpp b/src/sp-hatch.cpp index 2d938618c..a17a555b8 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(), -- cgit v1.2.3 From 43b49e325db73cc19b1731db6c69545664ee8fbe Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 28 Jul 2016 13:26:17 +0200 Subject: Reverted changes to r15024 after many building problems (bzr r15027) --- src/sp-hatch.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/sp-hatch.cpp') diff --git a/src/sp-hatch.cpp b/src/sp-hatch.cpp index a17a555b8..2d938618c 100644 --- a/src/sp-hatch.cpp +++ b/src/sp-hatch.cpp @@ -25,8 +25,11 @@ #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(), -- cgit v1.2.3 From 35830f456cadaecf8b8e3944e3031a1a93f6cb41 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 3 Aug 2016 15:29:38 +0200 Subject: Removed unused includes, decreased compilation time. Once again (bzr r15034) --- src/sp-hatch.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/sp-hatch.cpp') diff --git a/src/sp-hatch.cpp b/src/sp-hatch.cpp index 2d938618c..a17a555b8 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(), -- cgit v1.2.3 From 349536d49558ec5841e799eb33a4cbbb3fa9722d Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sun, 5 Feb 2017 16:04:35 +0000 Subject: Fix C++11 errors and warnings with g++-7 Fixed bugs: - https://launchpad.net/bugs/1660992 (bzr r15477) --- src/sp-hatch.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/sp-hatch.cpp') diff --git a/src/sp-hatch.cpp b/src/sp-hatch.cpp index 02d95c75c..f1958a53b 100644 --- a/src/sp-hatch.cpp +++ b/src/sp-hatch.cpp @@ -12,11 +12,15 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include "sp-hatch.h" + #include #include + #include <2geom/transforms.h> #include +#include "bad-uri-exception.h" #include "svg/svg.h" #include "display/cairo-utils.h" #include "display/drawing-context.h" @@ -25,7 +29,6 @@ #include "display/drawing-pattern.h" #include "attributes.h" #include "document-private.h" -#include "sp-hatch.h" #include "sp-hatch-path.h" SPHatch::SPHatch() -- cgit v1.2.3