Skip to content

Commit

Permalink
Use qgsgeometry_cast rather than dynamic_cast
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 15, 2018
1 parent f82970d commit e300387
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -302,12 +302,12 @@ QList<const QgsLineString *> QgsGeometryCheckerUtils::polygonRings( const QgsPol

void QgsGeometryCheckerUtils::filter1DTypes( QgsAbstractGeometry *geom )
{
if ( dynamic_cast<QgsGeometryCollection *>( geom ) )
if ( qgsgeometry_cast<QgsGeometryCollection *>( geom ) )
{
QgsGeometryCollection *geomCollection = static_cast<QgsGeometryCollection *>( geom );
for ( int nParts = geom->partCount(), iPart = nParts - 1; iPart >= 0; --iPart )
{
if ( !dynamic_cast<QgsSurface *>( geomCollection->geometryN( iPart ) ) )
if ( !qgsgeometry_cast<QgsSurface *>( geomCollection->geometryN( iPart ) ) )
{
geomCollection->removeGeometry( iPart );
}
Expand Down

0 comments on commit e300387

Please sign in to comment.