Skip to content
Permalink
Browse files
Fix #9148 (data-defined label positions with postgis)
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 863a83b3077ce6cf5c12086a95e4f4b10fd83dcb
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/core/qgspallabeling.cpp
@@ -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 )

0 comments on commit 863a83b

Please sign in to comment.