Skip to content

Commit

Permalink
Fix #9148 (data-defined label positions with postgis)
Browse files Browse the repository at this point in the history
A bit strangely, conversion of null variant with double type
to a double value is considered ok by QVariant
  • Loading branch information
wonder-sk committed Jun 11, 2014
1 parent 54e6716 commit 863a83b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/qgspallabeling.cpp
Expand Up @@ -2113,13 +2113,15 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, const QgsRenderContext

if ( dataDefinedEvaluate( QgsPalLayerSettings::PositionX, exprVal ) )
{
xPos = exprVal.toDouble( &ddXPos );
if ( !exprVal.isNull() )
xPos = exprVal.toDouble( &ddXPos );
QgsDebugMsgLevel( QString( "exprVal PositionX:%1" ).arg( xPos ), 4 );

if ( dataDefinedEvaluate( QgsPalLayerSettings::PositionY, exprVal ) )
{
//data defined position. But field values could be NULL -> positions will be generated by PAL
yPos = exprVal.toDouble( &ddYPos );
if ( !exprVal.isNull() )
yPos = exprVal.toDouble( &ddYPos );
QgsDebugMsgLevel( QString( "exprVal PositionY:%1" ).arg( yPos ), 4 );

if ( ddXPos && ddYPos )
Expand Down

0 comments on commit 863a83b

Please sign in to comment.