diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2011-03-29 13:44:38 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2011-03-29 15:18:08 (GMT) |
commit | 213609fa5c8b4e701115cfbb117559bc5dba4a54 (patch) | |
tree | ba88361a014890526313cdd67a9a32e41f3cacc8 | |
parent | a60a0ac6629c06f9e6a8199000bc6cd49190afe0 (diff) | |
download | Qt-213609fa5c8b4e701115cfbb117559bc5dba4a54.zip Qt-213609fa5c8b4e701115cfbb117559bc5dba4a54.tar.gz Qt-213609fa5c8b4e701115cfbb117559bc5dba4a54.tar.bz2 |
Fixed checking for default arguments in QLocale::toCurrencyString()
We should check whether we got the default argument or the empty string that
was provided by the user as toCurrencyString(123, QString(""))
Reviewed-by: Zeno Albisser
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 197c742..d986b9b 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -3130,7 +3130,7 @@ QString QLocale::toCurrencyString(qlonglong value, const QString &symbol) const value = -value; } QString str = d->longLongToString(value); - QString sym = symbol.isEmpty() ? currencySymbol() : symbol; + QString sym = symbol.isNull() ? currencySymbol() : symbol; if (sym.isEmpty()) sym = currencySymbol(QLocale::CurrencyIsoCode); QString format = getLocaleData(currency_format_data + idx, size); @@ -3155,7 +3155,7 @@ QString QLocale::toCurrencyString(qulonglong value, const QString &symbol) const quint8 idx = d->m_currency_format_idx; quint8 size = d->m_currency_format_size; QString str = d->unsLongLongToString(value); - QString sym = symbol.isEmpty() ? currencySymbol() : symbol; + QString sym = symbol.isNull() ? currencySymbol() : symbol; if (sym.isEmpty()) sym = currencySymbol(QLocale::CurrencyIsoCode); QString format = getLocaleData(currency_format_data + idx, size); @@ -3186,7 +3186,7 @@ QString QLocale::toCurrencyString(double value, const QString &symbol) const } QString str = d->doubleToString(value, d->m_currency_digits, QLocalePrivate::DFDecimal); - QString sym = symbol.isEmpty() ? currencySymbol() : symbol; + QString sym = symbol.isNull() ? currencySymbol() : symbol; if (sym.isEmpty()) sym = currencySymbol(QLocale::CurrencyIsoCode); QString format = getLocaleData(currency_format_data + idx, size); |