summaryrefslogtreecommitdiffstats
path: root/src/livarot
diff options
context:
space:
mode:
authorLiam P. White <inkscapebronyat-signgmaildotcom>2014-06-06 21:01:38 +0000
committerLiam P. White <inkscapebronyat-signgmaildotcom>2014-06-06 21:01:38 +0000
commit1fd57a41383419cbeddbaef27e52d55c0d02400f (patch)
tree72854a0d1dc09bec11e55b28c68ea22dcef5be1b /src/livarot
parentPut lpe-envelope-perspective.cpp in CMakeLists.txt (diff)
downloadinkscape-1fd57a41383419cbeddbaef27e52d55c0d02400f.tar.gz
inkscape-1fd57a41383419cbeddbaef27e52d55c0d02400f.zip
Clean up some unnecessary pointer usage in livarot
(bzr r13341.1.50)
Diffstat (limited to 'src/livarot')
-rw-r--r--src/livarot/Path.h12
-rw-r--r--src/livarot/PathConversion.cpp3
-rw-r--r--src/livarot/PathCutting.cpp7
-rw-r--r--src/livarot/PathOutline.cpp9
-rw-r--r--src/livarot/PathStroke.cpp3
5 files changed, 20 insertions, 14 deletions
diff --git a/src/livarot/Path.h b/src/livarot/Path.h
index 32ee71ffc..5d5a24e5a 100644
--- a/src/livarot/Path.h
+++ b/src/livarot/Path.h
@@ -135,26 +135,26 @@ public:
// closeIfNeeded=false prevent the function from closing the path (resulting in a non-eulerian graph
// pathID is a identification number for the path, and is used for recomposing curves from polylines
// give each different Path a different ID, and feed the appropriate orig[] to the ConvertToForme() function
- void Fill(Shape *dest, int pathID = -1, bool justAdd = false,
+ void Fill(Shape &dest, int pathID = -1, bool justAdd = false,
bool closeIfNeeded = true, bool invert = false);
// - stroke the path; usual parameters: type of cap=butt, type of join=join and miter (see LivarotDefs.h)
// doClose treat the path as closed (ie a loop)
- void Stroke(Shape *dest, bool doClose, double width, JoinType join,
+ void Stroke(Shape &dest, bool doClose, double width, JoinType join,
ButtType butt, double miter, bool justAdd = false);
// build a Path that is the outline of the Path instance's description (the result is stored in dest)
// it doesn't compute the exact offset (it's way too complicated, but an approximation made of cubic bezier patches
// and segments. the algorithm was found in a plugin for Impress (by Chris Cox), but i can't find it back...
- void Outline(Path *dest, double width, JoinType join, ButtType butt,
+ void Outline(Path &dest, double width, JoinType join, ButtType butt,
double miter);
// half outline with edges having the same direction as the original
- void OutsideOutline(Path *dest, double width, JoinType join, ButtType butt,
+ void OutsideOutline(Path &dest, double width, JoinType join, ButtType butt,
double miter);
// half outline with edges having the opposite direction as the original
- void InsideOutline (Path * dest, double width, JoinType join, ButtType butt,
+ void InsideOutline (Path & dest, double width, JoinType join, ButtType butt,
double miter);
// polyline to cubic bezier patches
@@ -184,7 +184,7 @@ public:
void LoadPath(Geom::Path const &path, Geom::Affine const &tr, bool doTransformation, bool append = false);
void LoadPathVector(Geom::PathVector const &pv, Geom::Affine const &tr, bool doTransformation);
void LoadPathVector(Geom::PathVector const &pv);
- Geom::PathVector* MakePathVector();
+ Geom::PathVector MakePathVector();
void Transform(const Geom::Affine &trans);
diff --git a/src/livarot/PathConversion.cpp b/src/livarot/PathConversion.cpp
index 42df898e6..0ef88841a 100644
--- a/src/livarot/PathConversion.cpp
+++ b/src/livarot/PathConversion.cpp
@@ -1269,8 +1269,9 @@ void Path::RecBezierTo(Geom::Point const &iP, Geom::Point const &iS,Geom::Point
* in a path description ( you need to have prepared the back data for that, of course)
*/
-void Path::Fill(Shape* dest, int pathID, bool justAdd, bool closeIfNeeded, bool invert)
+void Path::Fill(Shape& destr, int pathID, bool justAdd, bool closeIfNeeded, bool invert)
{
+ Shape* dest = &destr;
if ( dest == NULL ) {
return;
}
diff --git a/src/livarot/PathCutting.cpp b/src/livarot/PathCutting.cpp
index 49b2c5a78..74653ca06 100644
--- a/src/livarot/PathCutting.cpp
+++ b/src/livarot/PathCutting.cpp
@@ -269,10 +269,11 @@ void Path::DashSubPath(int spL, int spP, std::vector<path_lineto> const &orig_pt
}
}
-Geom::PathVector *
+Geom::PathVector
Path::MakePathVector()
{
- Geom::PathVector *pv = new Geom::PathVector();
+ Geom::PathVector retPv;
+ Geom::PathVector *pv = &retPv;
Geom::Path * currentpath = NULL;
Geom::Point lastP,bezSt,bezEn;
@@ -380,7 +381,7 @@ Path::MakePathVector()
}
}
- return pv;
+ return *pv;
}
void Path::AddCurve(Geom::Curve const &c)
diff --git a/src/livarot/PathOutline.cpp b/src/livarot/PathOutline.cpp
index 211ee31e2..f1978931a 100644
--- a/src/livarot/PathOutline.cpp
+++ b/src/livarot/PathOutline.cpp
@@ -21,8 +21,9 @@
// outline of a path.
// computed by making 2 offsets, one of the "left" side of the path, one of the right side, and then glueing the two
// the left side has to be reversed to make a contour
-void Path::Outline(Path *dest, double width, JoinType join, ButtType butt, double miter)
+void Path::Outline(Path &destr, double width, JoinType join, ButtType butt, double miter)
{
+ ::Path * dest = &destr;
if ( descr_flags & descr_adding_bezier ) {
CancelBezier();
}
@@ -198,9 +199,10 @@ void Path::Outline(Path *dest, double width, JoinType join, ButtType butt, doubl
// versions for outlining closed path: they only make one side of the offset contour
void
-Path::OutsideOutline (Path * dest, double width, JoinType join, ButtType butt,
+Path::OutsideOutline (Path & destr, double width, JoinType join, ButtType butt,
double miter)
{
+ ::Path * dest = &destr;
if (descr_flags & descr_adding_bezier) {
CancelBezier();
}
@@ -223,9 +225,10 @@ Path::OutsideOutline (Path * dest, double width, JoinType join, ButtType butt,
}
void
-Path::InsideOutline (Path * dest, double width, JoinType join, ButtType butt,
+Path::InsideOutline (Path & destr, double width, JoinType join, ButtType butt,
double miter)
{
+ ::Path * dest = &destr;
if ( descr_flags & descr_adding_bezier ) {
CancelBezier();
}
diff --git a/src/livarot/PathStroke.cpp b/src/livarot/PathStroke.cpp
index 50c335176..07ecc8114 100644
--- a/src/livarot/PathStroke.cpp
+++ b/src/livarot/PathStroke.cpp
@@ -38,9 +38,10 @@ static Geom::Point StrokeNormalize(const Geom::Point value, double length) {
}
}
-void Path::Stroke(Shape *dest, bool doClose, double width, JoinType join,
+void Path::Stroke(Shape &destr, bool doClose, double width, JoinType join,
ButtType butt, double miter, bool justAdd)
{
+ ::Shape* dest = &destr;
if (dest == NULL) {
return;
}