Skip to content

Commit e880db5

Browse files
backporting[bot]nyalldawson
authored andcommittedMar 22, 2019
Add missing bracket to formula generated by data defined override
Refs #21617
1 parent 3adb617 commit e880db5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎src/core/qgspropertytransformer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ QString QgsColorRampTransformer::toExpression( const QString &baseExpression ) c
619619
QString maxValueString = QString::number( mMaxValue );
620620
QString nullColorString = mNullColor.name();
621621

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

‎tests/src/core/testqgsproperty.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,9 +1252,9 @@ void TestQgsProperty::colorRampTransformer()
12521252
25,
12531253
new QgsGradientColorRamp( QColor( 10, 20, 30 ), QColor( 200, 190, 180 ) ),
12541254
QColor( 100, 150, 200 ) );
1255-
QCOMPARE( t5.toExpression( "5+6" ), QStringLiteral( "coalesce(ramp_color('custom ramp',scale_linear(5+6, 15, 25, 0, 1), '#6496c8')" ) );
1255+
QCOMPARE( t5.toExpression( "5+6" ), QStringLiteral( "coalesce(ramp_color('custom ramp',scale_linear(5+6, 15, 25, 0, 1)), '#6496c8')" ) );
12561256
t5.setRampName( QStringLiteral( "my ramp" ) );
1257-
QCOMPARE( t5.toExpression( "5+6" ), QStringLiteral( "coalesce(ramp_color('my ramp',scale_linear(5+6, 15, 25, 0, 1), '#6496c8')" ) );
1257+
QCOMPARE( t5.toExpression( "5+6" ), QStringLiteral( "coalesce(ramp_color('my ramp',scale_linear(5+6, 15, 25, 0, 1)), '#6496c8')" ) );
12581258
}
12591259

12601260
void TestQgsProperty::propertyToTransformer()

0 commit comments

Comments
 (0)
Please sign in to comment.