summaryrefslogtreecommitdiffstats
path: root/src/display/curve.cpp
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2017-11-03 00:10:02 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2017-11-03 00:10:02 +0000
commitd2df0412f728dd5bb54537dfdfe7c35b34d40e0e (patch)
treee2703384779e83312c456399999997fcc289c5cf /src/display/curve.cpp
parentMerge branch 'master' into powerpencil (diff)
parentchange assignment to equality (diff)
downloadinkscape-d2df0412f728dd5bb54537dfdfe7c35b34d40e0e.tar.gz
inkscape-d2df0412f728dd5bb54537dfdfe7c35b34d40e0e.zip
Merge branch 'master' into powerpencil
Diffstat (limited to 'src/display/curve.cpp')
-rw-r--r--src/display/curve.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index 6e662b17b..1115978e9 100644
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
@@ -38,6 +38,15 @@ SPCurve::SPCurve(Geom::PathVector const& pathv)
_pathv(pathv)
{}
+//concat constructor
+SPCurve::SPCurve(std::list<SPCurve *> const& l) : _refcount(1)
+{
+ for (auto c:l) {
+ _pathv.insert( _pathv.end(), c->get_pathvector().begin(), c->get_pathvector().end() );
+ }
+}
+
+
SPCurve *
SPCurve::new_from_rect(Geom::Rect const &rect, bool all_four_sides)
{
@@ -134,32 +143,24 @@ SPCurve::copy() const
* Return new curve that is the concatenation of all curves in list.
*/
SPCurve *
-SPCurve::concat(GSList const *list)
-{
- SPCurve *new_curve = new SPCurve();
-
- for (GSList const *l = list; l != NULL; l = l->next) {
- SPCurve *c = static_cast<SPCurve *>(l->data);
- new_curve->_pathv.insert( new_curve->_pathv.end(), c->get_pathvector().begin(), c->get_pathvector().end() );
- }
-
- return new_curve;
-}
+SPCurve::concat(std::list<SPCurve *> l){
+ return new SPCurve(l);
+};
/**
* Returns a list of new curves corresponding to the subpaths in \a curve.
* 2geomified
*/
-GSList *
+std::list<SPCurve *>
SPCurve::split() const
{
- GSList *l = NULL;
+ std::list<SPCurve *> l;
for (Geom::PathVector::const_iterator path_it = _pathv.begin(); path_it != _pathv.end(); ++path_it) {
Geom::PathVector newpathv;
newpathv.push_back(*path_it);
SPCurve * newcurve = new SPCurve(newpathv);
- l = g_slist_prepend(l, newcurve);
+ l.push_back(newcurve);
}
return l;