Changeset View
Changeset View
Standalone View
Standalone View
libs/odf/KoOdfNumberStyles.cpp
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
42 | { | 42 | { | ||
43 | 43 | | |||
44 | static bool saveOdfTimeFormat(KoXmlWriter &elementWriter, QString &format, QString &text, bool &antislash); | 44 | static bool saveOdfTimeFormat(KoXmlWriter &elementWriter, QString &format, QString &text, bool &antislash); | ||
45 | static void parseOdfDatelocale(KoXmlWriter &elementWriter, QString &format, QString &text); | 45 | static void parseOdfDatelocale(KoXmlWriter &elementWriter, QString &format, QString &text); | ||
46 | static bool saveOdflocaleTimeFormat(KoXmlWriter &elementWriter, QString &format, QString &text); | 46 | static bool saveOdflocaleTimeFormat(KoXmlWriter &elementWriter, QString &format, QString &text); | ||
47 | static void parseOdfTimelocale(KoXmlWriter &elementWriter, QString &format, QString &text); | 47 | static void parseOdfTimelocale(KoXmlWriter &elementWriter, QString &format, QString &text); | ||
48 | static void addCalligraNumericStyleExtension(KoXmlWriter &elementWriter, const QString &_suffix, const QString &_prefix); | 48 | static void addCalligraNumericStyleExtension(KoXmlWriter &elementWriter, const QString &_suffix, const QString &_prefix); | ||
49 | 49 | | |||
50 | | ||||
50 | QString format(const QString &value, const NumericStyleFormat &format) | 51 | QString format(const QString &value, const NumericStyleFormat &format) | ||
51 | { | 52 | { | ||
52 | switch (format.type) { | 53 | switch (format.type) { | ||
53 | case Number: { | 54 | case Number: { | ||
54 | bool ok; | 55 | bool ok; | ||
55 | qreal v = value.toDouble(&ok); | 56 | qreal v = value.toDouble(&ok); | ||
56 | return ok ? formatNumber(v, format.formatStr, format.precision) : value; | 57 | return ok ? formatNumber(v, format.formatStr, format.precision) : value; | ||
57 | } break; | 58 | } break; | ||
▲ Show 20 Lines • Show All 1316 Lines • Show Last 20 Lines |