Code

simplify pathv_to_linear_and_cubic_beziers a bit
authorjohanengelen <johanengelen@users.sourceforge.net>
Sat, 2 Aug 2008 22:52:40 +0000 (22:52 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Sat, 2 Aug 2008 22:52:40 +0000 (22:52 +0000)
src/helper/geom.cpp

index dcb7b3eb49a014a21cf03b356532b93fe676964e..ac8930412a62cb53c45c241ee477ef3557532850 100644 (file)
@@ -509,23 +509,17 @@ pathv_to_linear_and_cubic_beziers( Geom::PathVector const &pathv )
         output.back().close( pit->closed() );
 
         for (Geom::Path::const_iterator cit = pit->begin(); cit != pit->end_open(); ++cit) {
-            if( dynamic_cast<Geom::LineSegment const*>(&*cit) ||
+            if( dynamic_cast<Geom::CubicBezier const*>(&*cit) ||
+                dynamic_cast<Geom::LineSegment const*>(&*cit) ||
                 dynamic_cast<Geom::HLineSegment const*>(&*cit) ||
                 dynamic_cast<Geom::VLineSegment const*>(&*cit) )
             {
                 output.back().append(*cit);
             }
-            else if(Geom::CubicBezier const *cubic_bezier = dynamic_cast<Geom::CubicBezier const*>(&*cit)) {
-                (void)cubic_bezier;
-                output.back().append(*cit);
-            }
             else {
                 // convert all other curve types to cubicbeziers
                 Geom::Path cubicbezier_path = Geom::cubicbezierpath_from_sbasis(cit->toSBasis(), 0.1);
-
-                for(Geom::Path::iterator iter = cubicbezier_path.begin(); iter != cubicbezier_path.end(); ++iter) {
-                    output.back().append(*iter);
-                }
+                output.back().append(cubicbezier_path);
             }
         }
     }