From 3574f5d76ead7f8a0b8b536a60611be166d72179 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Mon, 14 Jul 2008 15:52:01 +0000 Subject: [PATCH] use dynamic_cast in favor of typeid. because of derivative classes (in this case actually it is not necessary, because there can be no derivatives of Geom::LineSegment, since they are added explicitly in the same code. However, I think it is good to set good example.) --- src/libnr/n-art-bpath-2geom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libnr/n-art-bpath-2geom.cpp b/src/libnr/n-art-bpath-2geom.cpp index bb88c4f1c..2bd76e623 100644 --- a/src/libnr/n-art-bpath-2geom.cpp +++ b/src/libnr/n-art-bpath-2geom.cpp @@ -34,7 +34,7 @@ BPath_to_2GeomPath(NArtBpath const * bpath) { // about to start a new path, correct the current path: nartbpath manually adds the closing line segment so erase it for closed path. if (current->closed() && !current->empty()) { // but only remove this last segment if it is a *linesegment*: - if ( typeid(current->back()) == typeid(Geom::LineSegment) ) { + if ( dynamic_cast(¤t->back()) ) { current->erase_last(); } } @@ -72,7 +72,7 @@ BPath_to_2GeomPath(NArtBpath const * bpath) if ( current && current->closed() && !current->empty() ) { // correct the current path: nartbpath manually adds the closing line segment so erase it for closed path. // but only remove this last segment if it is a *linesegment*: - if ( typeid(current->back()) == typeid(Geom::LineSegment) ) { + if ( dynamic_cast(¤t->back()) ) { current->erase_last(); } } -- 2.30.2