Fix identify menu highlight only works with simple geometry types

Fix #15625
This commit is contained in:
Nyall Dawson 2016-10-03 15:15:12 +10:00
parent 7d27b43e79
commit 5b3f10a531

View File

@ -282,17 +282,15 @@ void QgsHighlight::paint( QPainter* p )
p->setPen( mPen );
p->setBrush( mBrush );
switch ( mGeometry->wkbType() )
switch ( mGeometry->type() )
{
case QgsWkbTypes::Point:
case QgsWkbTypes::Point25D:
case QgsWkbTypes::PointGeometry:
{
if ( !mGeometry->isMultipart() )
{
paintPoint( p, mGeometry->asPoint() );
}
break;
case QgsWkbTypes::MultiPoint:
case QgsWkbTypes::MultiPoint25D:
else
{
QgsMultiPoint m = mGeometry->asMultiPoint();
for ( int i = 0; i < m.size(); i++ )
@ -300,17 +298,16 @@ void QgsHighlight::paint( QPainter* p )
paintPoint( p, m[i] );
}
}
break;
case QgsWkbTypes::LineString:
case QgsWkbTypes::LineString25D:
{
paintLine( p, mGeometry->asPolyline() );
}
break;
case QgsWkbTypes::MultiLineString:
case QgsWkbTypes::MultiLineString25D:
case QgsWkbTypes::LineGeometry:
{
if ( !mGeometry->isMultipart() )
{
paintLine( p, mGeometry->asPolyline() );
}
else
{
QgsMultiPolyline m = mGeometry->asMultiPolyline();
@ -320,16 +317,15 @@ void QgsHighlight::paint( QPainter* p )
}
}
break;
}
case QgsWkbTypes::Polygon:
case QgsWkbTypes::Polygon25D:
case QgsWkbTypes::PolygonGeometry:
{
if ( !mGeometry->isMultipart() )
{
paintPolygon( p, mGeometry->asPolygon() );
}
break;
case QgsWkbTypes::MultiPolygon:
case QgsWkbTypes::MultiPolygon25D:
else
{
QgsMultiPolygon m = mGeometry->asMultiPolygon();
for ( int i = 0; i < m.size(); i++ )
@ -338,9 +334,10 @@ void QgsHighlight::paint( QPainter* p )
}
}
break;
}
case QgsWkbTypes::Unknown:
default:
case QgsWkbTypes::UnknownGeometry:
case QgsWkbTypes::NullGeometry:
return;
}
}