Skip to content

Commit

Permalink
Show an empty string if precision is 0 or not valid
Browse files Browse the repository at this point in the history
Backported from master
  • Loading branch information
elpaso committed Oct 30, 2018
1 parent 344a5a6 commit 24eaea5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/app/qgsvectorlayerproperties.cpp
Expand Up @@ -408,11 +408,12 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
mGeometryPrecisionLineEdit->setValidator( new QDoubleValidator( mGeometryPrecisionLineEdit ) );

mRemoveDuplicateNodesCheckbox->setChecked( mLayer->geometryOptions()->removeDuplicateNodes() );
double precision( mLayer->geometryOptions()->geometryPrecision() );
bool ok = true;
QString precision( QLocale().toString( mLayer->geometryOptions()->geometryPrecision(), ok ) );
if ( ! ok )
precision = 0.0;
mGeometryPrecisionLineEdit->setText( precision );
QString precisionStr( QLocale().toString( precision, ok ) );
if ( precision == 0.0 || ! ok )
precisionStr = QString();
mGeometryPrecisionLineEdit->setText( precisionStr );

mPrecisionUnitsLabel->setText( QStringLiteral( "[%1]" ).arg( QgsUnitTypes::toAbbreviatedString( mLayer->crs().mapUnits() ) ) );

Expand Down

0 comments on commit 24eaea5

Please sign in to comment.