mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Localize display of glue lengths in dialogs
This commit is contained in:
parent
60b539e544
commit
079bc8ca40
@ -161,7 +161,7 @@ void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
|
||||
} else if (!isValidLength(len) && !isStrDbl(len)) {
|
||||
// use input field only for gluelengths
|
||||
combo->setCurrentItem(defaultUnit);
|
||||
input->setText(toqstr(len));
|
||||
input->setText(locLengthString(toqstr(len)));
|
||||
} else {
|
||||
lengthToWidgets(input, combo, Length(len), defaultUnit);
|
||||
}
|
||||
@ -214,6 +214,14 @@ QString formatLocFPNumber(double d)
|
||||
}
|
||||
|
||||
|
||||
QString locLengthString(QString const & str)
|
||||
{
|
||||
QLocale loc;
|
||||
QString res = str;
|
||||
return res.replace(QString("."), loc.decimalPoint());
|
||||
}
|
||||
|
||||
|
||||
QString unlocLengthString(QString const & str)
|
||||
{
|
||||
QLocale loc;
|
||||
|
@ -72,7 +72,10 @@ void doubleToWidget(QLineEdit * input, std::string const & value,
|
||||
*/
|
||||
QString formatLocFPNumber(double d);
|
||||
|
||||
// Method to replace localized decimal separator by dot
|
||||
/// Method to replace dot with localized decimal separator
|
||||
QString locLengthString(QString const & str);
|
||||
|
||||
/// Method to replace localized decimal separator by dot
|
||||
QString unlocLengthString(QString const & str);
|
||||
|
||||
/// Method to sort QStrings locale-aware (e.g. in combo widgets)
|
||||
|
Loading…
Reference in New Issue
Block a user