From a7f2b2ba3f13ceb60376802f4a31e104153839e8 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 17 Feb 2015 03:00:37 +0100 Subject: At first, I was thinking "I just have to go to the selection file, and change that GSList* with a std::list, then resolve the few problems" So, i tried that. And I will continue tomorrow, and the days after, on and on. (bzr r13922.1.1) --- src/removeoverlap.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/removeoverlap.cpp') diff --git a/src/removeoverlap.cpp b/src/removeoverlap.cpp index ba5740e55..9009de5e9 100644 --- a/src/removeoverlap.cpp +++ b/src/removeoverlap.cpp @@ -38,20 +38,20 @@ namespace { * such that rectangular bounding boxes are separated by at least xGap * horizontally and yGap vertically */ -void removeoverlap(GSList const *const items, double const xGap, double const yGap) { +void removeoverlap(SelContainer const &items, double const xGap, double const yGap) { using Inkscape::Util::GSListConstIterator; - std::list selected; - selected.insert >(selected.end(), items, NULL); + SelContainer selected(items); std::vector records; std::vector rs; Geom::Point const gap(xGap, yGap); - for (std::list::iterator it(selected.begin()); + for (SelContainer::iterator it(selected.begin()); it != selected.end(); ++it) { + SPItem* item=static_cast(*it); using Geom::X; using Geom::Y; - Geom::OptRect item_box((*it)->desktopVisualBounds()); + Geom::OptRect item_box((item)->desktopVisualBounds()); if (item_box) { Geom::Point min(item_box->min() - .5*gap); Geom::Point max(item_box->max() + .5*gap); @@ -67,7 +67,7 @@ void removeoverlap(GSList const *const items, double const xGap, double const yG min[Y] = max[Y] = (min[Y] + max[Y])/2; } Rectangle *vspc_rect = new Rectangle(min[X], max[X], min[Y], max[Y]); - records.push_back(Record(*it, item_box->midpoint(), vspc_rect)); + records.push_back(Record(item, item_box->midpoint(), vspc_rect)); rs.push_back(vspc_rect); } } -- cgit v1.2.3 From 5fd00cab14d48beaf2279a2b8f3ad5b02b76c87b Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Thu, 19 Feb 2015 04:25:21 +0100 Subject: Put a few std::vector (bzr r13922.1.5) --- src/removeoverlap.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/removeoverlap.cpp') diff --git a/src/removeoverlap.cpp b/src/removeoverlap.cpp index 9009de5e9..7cb1694e3 100644 --- a/src/removeoverlap.cpp +++ b/src/removeoverlap.cpp @@ -38,14 +38,14 @@ namespace { * such that rectangular bounding boxes are separated by at least xGap * horizontally and yGap vertically */ -void removeoverlap(SelContainer const &items, double const xGap, double const yGap) { +void removeoverlap(std::vector const &items, double const xGap, double const yGap) { using Inkscape::Util::GSListConstIterator; - SelContainer selected(items); + std::vector selected(items); std::vector records; std::vector rs; Geom::Point const gap(xGap, yGap); - for (SelContainer::iterator it(selected.begin()); + for (std::vector::iterator it(selected.begin()); it != selected.end(); ++it) { -- cgit v1.2.3 From 9a7fa4d1899d30ec745107823f307b2a0bf3172f Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Fri, 27 Feb 2015 03:10:36 +0100 Subject: corrected the casts (hopefully) (bzr r13922.1.10) --- src/removeoverlap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/removeoverlap.cpp') diff --git a/src/removeoverlap.cpp b/src/removeoverlap.cpp index 7cb1694e3..01ce2c47e 100644 --- a/src/removeoverlap.cpp +++ b/src/removeoverlap.cpp @@ -49,7 +49,7 @@ void removeoverlap(std::vector const &items, double const xGap, double it != selected.end(); ++it) { - SPItem* item=static_cast(*it); + SPItem* item = *it; using Geom::X; using Geom::Y; Geom::OptRect item_box((item)->desktopVisualBounds()); if (item_box) { -- cgit v1.2.3 From 4bd4a89e23064b6782728d7965b12443978dcd29 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 28 Apr 2015 00:56:20 +0200 Subject: removed a few "using Inkscape::Util::GSListConstIterator" (bzr r13922.1.16) --- src/removeoverlap.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/removeoverlap.cpp') diff --git a/src/removeoverlap.cpp b/src/removeoverlap.cpp index 01ce2c47e..9ea75de0d 100644 --- a/src/removeoverlap.cpp +++ b/src/removeoverlap.cpp @@ -39,7 +39,6 @@ namespace { * horizontally and yGap vertically */ void removeoverlap(std::vector const &items, double const xGap, double const yGap) { - using Inkscape::Util::GSListConstIterator; std::vector selected(items); std::vector records; std::vector rs; -- cgit v1.2.3