summaryrefslogtreecommitdiffstats
path: root/src/sp-polygon.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2008-08-05 14:33:46 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2008-08-05 14:33:46 +0000
commit0651eb9e41d0e6680126456d6b7b665154ab7660 (patch)
tree794a0b30225009643ef882d51010bce5c8ae9cf8 /src/sp-polygon.cpp
parentmore mockup on svgfonts dialog (diff)
downloadinkscape-0651eb9e41d0e6680126456d6b7b665154ab7660.tar.gz
inkscape-0651eb9e41d0e6680126456d6b7b665154ab7660.zip
Use is_straight_curve() instead of three separate dynamic casts
(bzr r6564)
Diffstat (limited to 'src/sp-polygon.cpp')
-rw-r--r--src/sp-polygon.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/sp-polygon.cpp b/src/sp-polygon.cpp
index fddc9d1db..014c68c9b 100644
--- a/src/sp-polygon.cpp
+++ b/src/sp-polygon.cpp
@@ -21,6 +21,7 @@
#include <2geom/pathvector.h>
#include <2geom/bezier-curve.h>
#include <2geom/hvlinesegment.h>
+#include "helper/geom-curves.h"
#include "svg/stringstream.h"
#include "xml/repr.h"
#include "document.h"
@@ -98,9 +99,7 @@ static gchar *sp_svg_write_polygon(Geom::PathVector const & pathv)
for (Geom::PathVector::const_iterator pit = pathv.begin(); pit != pathv.end(); ++pit) {
for (Geom::Path::const_iterator cit = pit->begin(); cit != pit->end_default(); ++cit) {
- if ( dynamic_cast<Geom::LineSegment const *>(&*cit) ||
- dynamic_cast<Geom::HLineSegment const *>(&*cit) ||
- dynamic_cast<Geom::VLineSegment const *>(&*cit) )
+ if ( is_straight_curve(*cit) )
{
os << cit->finalPoint()[0] << "," << cit->finalPoint()[1] << " ";
} else {