Skip to content

Commit

Permalink
Add missing bracket to formula generated by data defined override.
Browse files Browse the repository at this point in the history
  • Loading branch information
backporting[bot] authored and nyalldawson committed Mar 22, 2019
1 parent 1a40699 commit 5dd29ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/qgspropertytransformer.cpp
Expand Up @@ -619,7 +619,7 @@ QString QgsColorRampTransformer::toExpression( const QString &baseExpression ) c
QString maxValueString = QString::number( mMaxValue );
QString nullColorString = mNullColor.name();

return QStringLiteral( "coalesce(ramp_color('%1',scale_linear(%2, %3, %4, 0, 1), '%5')" ).arg( !mRampName.isEmpty() ? mRampName : QStringLiteral( "custom ramp" ),
return QStringLiteral( "coalesce(ramp_color('%1',scale_linear(%2, %3, %4, 0, 1)), '%5')" ).arg( !mRampName.isEmpty() ? mRampName : QStringLiteral( "custom ramp" ),
baseExpression, minValueString, maxValueString, nullColorString );
}

Expand Down
4 changes: 2 additions & 2 deletions tests/src/core/testqgsproperty.cpp
Expand Up @@ -1251,9 +1251,9 @@ void TestQgsProperty::colorRampTransformer()
25,
new QgsGradientColorRamp( QColor( 10, 20, 30 ), QColor( 200, 190, 180 ) ),
QColor( 100, 150, 200 ) );
QCOMPARE( t5.toExpression( "5+6" ), QStringLiteral( "coalesce(ramp_color('custom ramp',scale_linear(5+6, 15, 25, 0, 1), '#6496c8')" ) );
QCOMPARE( t5.toExpression( "5+6" ), QStringLiteral( "coalesce(ramp_color('custom ramp',scale_linear(5+6, 15, 25, 0, 1)), '#6496c8')" ) );
t5.setRampName( QStringLiteral( "my ramp" ) );
QCOMPARE( t5.toExpression( "5+6" ), QStringLiteral( "coalesce(ramp_color('my ramp',scale_linear(5+6, 15, 25, 0, 1), '#6496c8')" ) );
QCOMPARE( t5.toExpression( "5+6" ), QStringLiteral( "coalesce(ramp_color('my ramp',scale_linear(5+6, 15, 25, 0, 1)), '#6496c8')" ) );
}

void TestQgsProperty::propertyToTransformer()
Expand Down

0 comments on commit 5dd29ee

Please sign in to comment.