From e5deaaa6ab843913bdf3ade47611f61f968db130 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Mon, 7 Mar 2011 14:18:52 +0100 Subject: Improved QLocale::quoteString. Whenever the system locale doesn't return the proper alternate quotes we should try the standard quotes before falling back to the CLDR data. Reviewed-by: trustme --- src/corelib/tools/qlocale.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 5b25c97..4c0b154 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -803,11 +803,10 @@ QString QLocale::quoteString(const QStringRef &str, QuotationStyle style) const #ifndef QT_NO_SYSTEMLOCALE if (d() == systemPrivate()) { QVariant res; - if (style == QLocale::StandardQuotation) - res = systemLocale()->query(QSystemLocale::StringToStandardQuotation, QVariant::fromValue(str)); - else + if (style == QLocale::AlternateQuotation) res = systemLocale()->query(QSystemLocale::StringToAlternateQuotation, QVariant::fromValue(str)); - + if (res.isNull() || style == QLocale::StandardQuotation) + res = systemLocale()->query(QSystemLocale::StringToStandardQuotation, QVariant::fromValue(str)); if (!res.isNull()) return res.toString(); } -- cgit v0.12