commit 187c5f0ef593dda3ffad93afcab0142b2909f988 Author: Juergen Spitzmueller <sp...@lyx.org> Date: Sun Mar 15 11:48:36 2015 +0100
Use QLocale::toDouble instead of QString::toDouble in the length validator Fixes: #9214 diff --git a/src/frontends/qt4/Validator.cpp b/src/frontends/qt4/Validator.cpp index 13f813e..4e363ac 100644 --- a/src/frontends/qt4/Validator.cpp +++ b/src/frontends/qt4/Validator.cpp @@ -40,8 +40,15 @@ LengthValidator::LengthValidator(QWidget * parent) QValidator::State LengthValidator::validate(QString & qtext, int &) const { + QLocale loc; bool ok; - qtext.trimmed().toDouble(&ok); + loc.toDouble(qtext.trimmed(), &ok); + if (!ok) { + // Fall back to C + QLocale c(QLocale::C); + c.toDouble(qtext.trimmed(), &ok); + } + if (qtext.isEmpty() || ok) return QValidator::Acceptable;