diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-07-14 15:52:01 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-07-14 15:52:01 +0000 |
| commit | 97103da597d84ee333e03d8dc67fb9693cf8dd52 (patch) | |
| tree | c7919cd854b0e8a143b08b404b94bab487bba03e /src | |
| parent | 2geomify snappoint finding for SPShapes. (diff) | |
| download | inkscape-97103da597d84ee333e03d8dc67fb9693cf8dd52.tar.gz inkscape-97103da597d84ee333e03d8dc67fb9693cf8dd52.zip | |
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.)
(bzr r6297)
Diffstat (limited to 'src')
| -rw-r--r-- | src/libnr/n-art-bpath-2geom.cpp | 4 |
1 files 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<Geom::LineSegment const *>(¤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<Geom::LineSegment const *>(¤t->back()) ) { current->erase_last(); } } |
