}
-QString locLengthString(QString const & str)
-{
- QLocale loc;
- QString res = str;
- return res.replace(QString("."), loc.decimalPoint());
-}
-
-
-QString unlocLengthString(QString const & str)
-{
- QLocale loc;
- QString res = str;
- return res.replace(loc.decimalPoint(), QString("."));
-}
-
-
bool SortLocaleAware(QString const & lhs, QString const & rhs)
{
return QString::localeAwareCompare(lhs, rhs) < 0;
*/
QString formatLocFPNumber(double d);
-/// 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)
bool SortLocaleAware(QString const & lhs, QString const & rhs);
#include "support/qstring_helpers.h"
#include <QRegExp>
+#include <QLocale>
#include <QString>
#include <QVector>
return re + ")";
}
+QString locLengthString(QString const & str)
+{
+ QLocale loc;
+ QString res = str;
+ return res.replace(QString("."), loc.decimalPoint());
+}
+
+
+docstring locLengthDocString(docstring const str)
+{
+ return qstring_to_ucs4(locLengthString(toqstr(str)));
+}
+
+
+QString unlocLengthString(QString const & str)
+{
+ QLocale loc;
+ QString res = str;
+ return res.replace(loc.decimalPoint(), QString("."));
+}
} // namespace lyx
*/
QString charFilterRegExpC(QString const & filter);
+/// Method to replace dot with localized decimal separator
+QString locLengthString(QString const & str);
+
+/// Same for doscstring
+docstring locLengthDocString(docstring const str);
+
+/// Method to replace localized decimal separator by dot
+QString unlocLengthString(QString const & str);
+
} // namespace lyx
#endif // QSTRING_HELPERS_H