diff options
Diffstat (limited to 'src/display')
| -rw-r--r-- | src/display/inkscape-cairo.cpp | 7 | ||||
| -rw-r--r-- | src/display/nr-arena-shape.cpp | 12 |
2 files changed, 9 insertions, 10 deletions
diff --git a/src/display/inkscape-cairo.cpp b/src/display/inkscape-cairo.cpp index 9a114f48e..b67ac1311 100644 --- a/src/display/inkscape-cairo.cpp +++ b/src/display/inkscape-cairo.cpp @@ -10,7 +10,6 @@ #include <cairo.h> -#include <typeinfo> #ifdef HAVE_CONFIG_H # include <config.h> #endif @@ -160,9 +159,9 @@ feed_curve_to_cairo (cairo_t *ct, NArtBpath const *bpath, NR::Matrix trans, NR:: static void feed_curve_to_cairo(cairo_t *cr, Geom::Curve const &c, Geom::Matrix & trans, Geom::Rect view, bool optimize_stroke) { - if( typeid(c) == typeid(Geom::LineSegment) || - typeid(c) == typeid(Geom::HLineSegment) || - typeid(c) == typeid(Geom::VLineSegment) ) + if( dynamic_cast<Geom::LineSegment const*>(&c) || + dynamic_cast<Geom::HLineSegment const*>(&c) || + dynamic_cast<Geom::VLineSegment const*>(&c) ) { Geom::Point end_tr = c.finalPoint() * trans; if (!optimize_stroke) { diff --git a/src/display/nr-arena-shape.cpp b/src/display/nr-arena-shape.cpp index 6974b0008..23bf70be5 100644 --- a/src/display/nr-arena-shape.cpp +++ b/src/display/nr-arena-shape.cpp @@ -426,13 +426,13 @@ static bool has_inner_area(Geom::PathVector const & pv) { if ( (pv.size() == 1) && (pv.front().size() <= 1) ) { // vector has only one path with only one segment, see if that's a non-curve segment: that would mean no internal region - Geom::Curve const & c = pv.front().front(); - if ( typeid(c) == typeid(Geom::LineSegment) ) - return false; - if ( typeid(c) == typeid(Geom::HLineSegment) ) - return false; - if ( typeid(c) == typeid(Geom::VLineSegment) ) + Geom::Curve const * c = & pv.front().front(); + if ( dynamic_cast<Geom::LineSegment const*>(c) || + dynamic_cast<Geom::HLineSegment const*>(c) || + dynamic_cast<Geom::VLineSegment const*>(c) ) + { return false; + } } return true; //too costly to see if it has region to be filled, so return true. |
