Skip to content

Commit

Permalink
Merge pull request #8358 from elpaso/bugfix-20255
Browse files Browse the repository at this point in the history
Fix geometry precision input in vector layer properties and not-dot l…
  • Loading branch information
elpaso committed Oct 29, 2018
2 parents 8fc4378 + ac54e96 commit b00b3f6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/app/qgsvectorlayerproperties.cpp
Expand Up @@ -408,7 +408,12 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
mGeometryPrecisionLineEdit->setValidator( new QDoubleValidator( mGeometryPrecisionLineEdit ) );

mRemoveDuplicateNodesCheckbox->setChecked( mLayer->geometryOptions()->removeDuplicateNodes() );
mGeometryPrecisionLineEdit->setText( QString::number( mLayer->geometryOptions()->geometryPrecision() ) );
double precision( mLayer->geometryOptions()->geometryPrecision() );
bool ok = true;
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 Expand Up @@ -782,7 +787,11 @@ void QgsVectorLayerProperties::apply()
#endif

mLayer->geometryOptions()->setRemoveDuplicateNodes( mRemoveDuplicateNodesCheckbox->isChecked() );
mLayer->geometryOptions()->setGeometryPrecision( mGeometryPrecisionLineEdit->text().toDouble() );
bool ok = true;
double precision( QLocale().toDouble( mGeometryPrecisionLineEdit->text(), &ok ) );
if ( ! ok )
precision = 0.0;
mLayer->geometryOptions()->setGeometryPrecision( precision );

QStringList activeChecks;
QHash<QCheckBox *, QString>::const_iterator it;
Expand Down

0 comments on commit b00b3f6

Please sign in to comment.