Skip to content

Commit

Permalink
Get config from arguments instead of querying fields
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Feb 2, 2018
1 parent 29f6484 commit 37f31dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/fieldformatter/qgsrangefieldformatter.cpp
Expand Up @@ -53,14 +53,14 @@ QString QgsRangeFieldFormatter::representValue( QgsVectorLayer *layer, int field
const QgsField field = layer->fields().at( fieldIndex );

if ( field.type() == QVariant::Double &&
field.editorWidgetSetup().config().contains( QStringLiteral( "Precision" ) ) &&
config.contains( QStringLiteral( "Precision" ) ) &&
value.isValid( ) )
{
bool ok;
double val( value.toDouble( &ok ) );
if ( ok )
{
int precision( field.editorWidgetSetup().config()[ QStringLiteral( "Precision" ) ].toInt( &ok ) );
int precision( config[ QStringLiteral( "Precision" ) ].toInt( &ok ) );
if ( ok )
{
// TODO: make the format configurable!
Expand Down

0 comments on commit 37f31dd

Please sign in to comment.