@@ -722,7 +722,7 @@ QRectF QgsComposerItem::evalItemRect( const QRectF &newRect )
722722 bool ok;
723723 double width = exprVal.toDouble ( &ok );
724724 QgsDebugMsg ( QString ( " exprVal Width:%1" ).arg ( width ) );
725- if ( ok )
725+ if ( ok && !exprVal. isNull () )
726726 {
727727 result.setWidth ( width );
728728 }
@@ -732,7 +732,7 @@ QRectF QgsComposerItem::evalItemRect( const QRectF &newRect )
732732 bool ok;
733733 double height = exprVal.toDouble ( &ok );
734734 QgsDebugMsg ( QString ( " exprVal Height:%1" ).arg ( height ) );
735- if ( ok )
735+ if ( ok && !exprVal. isNull () )
736736 {
737737 result.setHeight ( height );
738738 }
@@ -753,7 +753,7 @@ QRectF QgsComposerItem::evalItemRect( const QRectF &newRect )
753753 bool ok;
754754 double positionX = exprVal.toDouble ( &ok );
755755 QgsDebugMsg ( QString ( " exprVal Position X:%1" ).arg ( positionX ) );
756- if ( ok )
756+ if ( ok && !exprVal. isNull () )
757757 {
758758 x = positionX;
759759 }
@@ -775,7 +775,7 @@ QRectF QgsComposerItem::evalItemRect( const QRectF &newRect )
775775 bool ok;
776776 double positionY = exprVal.toDouble ( &ok );
777777 QgsDebugMsg ( QString ( " exprVal Position Y:%1" ).arg ( positionY ) );
778- if ( ok )
778+ if ( ok && !exprVal. isNull () )
779779 {
780780 y = positionY;
781781 }
@@ -861,7 +861,7 @@ void QgsComposerItem::refreshBlendMode()
861861
862862 // data defined blend mode set?
863863 QVariant exprVal;
864- if ( dataDefinedEvaluate ( QgsComposerObject::BlendMode, exprVal ) )
864+ if ( dataDefinedEvaluate ( QgsComposerObject::BlendMode, exprVal ) && !exprVal. isNull () )
865865 {
866866 QString blendstr = exprVal.toString ().trimmed ();
867867 QPainter::CompositionMode blendModeD = QgsSymbolLayerV2Utils::decodeBlendMode ( blendstr );
@@ -891,7 +891,7 @@ void QgsComposerItem::refreshTransparency( const bool updateItem )
891891 bool ok;
892892 int transparencyD = exprVal.toInt ( &ok );
893893 QgsDebugMsg ( QString ( " exprVal Transparency:%1" ).arg ( transparencyD ) );
894- if ( ok )
894+ if ( ok && !exprVal. isNull () )
895895 {
896896 transparency = transparencyD;
897897 }
@@ -1041,7 +1041,7 @@ void QgsComposerItem::refreshRotation( const bool updateItem , const bool adjust
10411041 bool ok;
10421042 double rotD = exprVal.toDouble ( &ok );
10431043 QgsDebugMsg ( QString ( " exprVal Rotation:%1" ).arg ( rotD ) );
1044- if ( ok )
1044+ if ( ok && !exprVal. isNull () )
10451045 {
10461046 rotation = rotD;
10471047 }
@@ -1332,7 +1332,7 @@ void QgsComposerItem::refreshDataDefinedProperty( const QgsComposerObject::DataD
13321332 bool exclude = mExcludeFromExports ;
13331333 // data defined exclude from exports set?
13341334 QVariant exprVal;
1335- if ( dataDefinedEvaluate ( QgsComposerObject::ExcludeFromExports, exprVal ) )
1335+ if ( dataDefinedEvaluate ( QgsComposerObject::ExcludeFromExports, exprVal ) && !exprVal. isNull () )
13361336 {
13371337 exclude = exprVal.toBool ();
13381338 }
0 commit comments