Skip to content

Commit 24eaea5

Browse files
committed
Show an empty string if precision is 0 or not valid
Backported from master
1 parent 344a5a6 commit 24eaea5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/app/qgsvectorlayerproperties.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -408,11 +408,12 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
408408
mGeometryPrecisionLineEdit->setValidator( new QDoubleValidator( mGeometryPrecisionLineEdit ) );
409409

410410
mRemoveDuplicateNodesCheckbox->setChecked( mLayer->geometryOptions()->removeDuplicateNodes() );
411+
double precision( mLayer->geometryOptions()->geometryPrecision() );
411412
bool ok = true;
412-
QString precision( QLocale().toString( mLayer->geometryOptions()->geometryPrecision(), ok ) );
413-
if ( ! ok )
414-
precision = 0.0;
415-
mGeometryPrecisionLineEdit->setText( precision );
413+
QString precisionStr( QLocale().toString( precision, ok ) );
414+
if ( precision == 0.0 || ! ok )
415+
precisionStr = QString();
416+
mGeometryPrecisionLineEdit->setText( precisionStr );
416417

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

0 commit comments

Comments
 (0)