summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlocale.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qlocale.cpp')
-rw-r--r--src/corelib/tools/qlocale.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 0a573e77dc..5557b5af2d 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -3226,14 +3226,18 @@ QString QLocaleData::unsLongLongToString(const QChar zero, const QChar group,
int base, int width,
unsigned flags)
{
+ const QChar resultZero = base == 10 ? zero : QChar(QLatin1Char('0'));
+ QString num_str = l ? qulltoa(l, base, zero) : QString(resultZero);
+
bool precision_not_specified = false;
if (precision == -1) {
+ if (flags == NoFlags)
+ return num_str; // fast-path: nothing below applies, so we're done.
+
precision_not_specified = true;
precision = 1;
}
- QString num_str = qulltoa(l, base, zero);
-
uint cnt_thousand_sep = 0;
if (flags & ThousandsGroup && base == 10) {
for (int i = num_str.length() - 3; i > 0; i -=3) {
@@ -3242,7 +3246,6 @@ QString QLocaleData::unsLongLongToString(const QChar zero, const QChar group,
}
}
- const QChar resultZero = base == 10 ? zero : QChar(QLatin1Char('0'));
const int zeroPadding = precision - num_str.length()/* + cnt_thousand_sep*/;
if (zeroPadding > 0)
num_str.prepend(QString(zeroPadding, resultZero));
@@ -3873,3 +3876,7 @@ QDebug operator<<(QDebug dbg, const QLocale &l)
}
#endif
QT_END_NAMESPACE
+
+#ifndef QT_NO_QOBJECT
+#include "moc_qlocale.cpp"
+#endif