Skip to content
Permalink
Browse files

Fix data defined buttons sometimes incorrectly show error state

(cherry-picked from 7d27b43)
  • Loading branch information
nyalldawson committed Oct 6, 2016
1 parent 4d45218 commit d4eada7cdf73777d7bf21f4fbc7a1cfcc512045d
Showing with 38 additions and 41 deletions.
  1. +38 −41 src/gui/qgshighlight.cpp
@@ -280,65 +280,62 @@ void QgsHighlight::paint( QPainter* p )
p->setPen( mPen );
p->setBrush( mBrush );

switch ( mGeometry->wkbType() )
switch ( mGeometry->type() )
{
case QGis::WKBPoint:
case QGis::WKBPoint25D:
case QGis::PointGeometry:
{
paintPoint( p, mGeometry->asPoint() );
}
break;

case QGis::WKBMultiPoint:
case QGis::WKBMultiPoint25D:
{
QgsMultiPoint m = mGeometry->asMultiPoint();
for ( int i = 0; i < m.size(); i++ )
if ( !mGeometry->isMultipart() )
{
paintPoint( p, m[i] );
paintPoint( p, mGeometry->asPoint() );
}
else
{
QgsMultiPoint m = mGeometry->asMultiPoint();
for ( int i = 0; i < m.size(); i++ )
{
paintPoint( p, m[i] );
}
}
}
break;

case QGis::WKBLineString:
case QGis::WKBLineString25D:
{
paintLine( p, mGeometry->asPolyline() );
}
break;

case QGis::WKBMultiLineString:
case QGis::WKBMultiLineString25D:
case QGis::LineGeometry:
{
QgsMultiPolyline m = mGeometry->asMultiPolyline();

for ( int i = 0; i < m.size(); i++ )
if ( !mGeometry->isMultipart() )
{
paintLine( p, m[i] );
paintLine( p, mGeometry->asPolyline() );
}
}
break;
else
{
QgsMultiPolyline m = mGeometry->asMultiPolyline();

case QGis::WKBPolygon:
case QGis::WKBPolygon25D:
{
paintPolygon( p, mGeometry->asPolygon() );
for ( int i = 0; i < m.size(); i++ )
{
paintLine( p, m[i] );
}
}
break;
}
break;

case QGis::WKBMultiPolygon:
case QGis::WKBMultiPolygon25D:
case QGis::PolygonGeometry:
{
QgsMultiPolygon m = mGeometry->asMultiPolygon();
for ( int i = 0; i < m.size(); i++ )
if ( !mGeometry->isMultipart() )
{
paintPolygon( p, mGeometry->asPolygon() );
}
else
{
paintPolygon( p, m[i] );
QgsMultiPolygon m = mGeometry->asMultiPolygon();
for ( int i = 0; i < m.size(); i++ )
{
paintPolygon( p, m[i] );
}
}
break;
}
break;

case QGis::WKBUnknown:
default:
case QGis::UnknownGeometry:
case QGis::NullGeometry:
return;
}
}

0 comments on commit d4eada7

Please sign in to comment.
You can’t perform that action at this time.