From f97db2555e82adf7fa98c3d4ac787588e509fc02 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Thu, 5 Apr 2012 02:29:35 +0300 Subject: [PATCH] unite QString::normalized() overloads Change-Id: I27545e599a1831728e491a9fad1e52fa255535fc Reviewed-by: Oswald Buddenhagen --- src/corelib/tools/qstring.cpp | 35 +++++++++++------------------------ src/corelib/tools/qstring.h | 3 +-- 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index bc39eafb6d..f48eaf5721 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -6473,15 +6473,6 @@ QStringList QString::split(const QRegularExpression &re, SplitBehavior behavior) {http://www.unicode.org/reports/tr15/}{Unicode Standard Annex #15} */ -/*! - \fn QString QString::normalized(NormalizationForm mode) const - Returns the string in the given Unicode normalization \a mode. -*/ -QString QString::normalized(QString::NormalizationForm mode) const -{ - return normalized(mode, UNICODE_DATA_VERSION); -} - /*! \since 4.5 @@ -6531,21 +6522,6 @@ QString QString::repeated(int times) const return result; } -void qt_string_normalize(QString *data, QString::NormalizationForm mode, QChar::UnicodeVersion version, int from); -/*! - \overload - \fn QString QString::normalized(NormalizationForm mode, QChar::UnicodeVersion version) const - - Returns the string in the given Unicode normalization \a mode, - according to the given \a version of the Unicode standard. -*/ -QString QString::normalized(QString::NormalizationForm mode, QChar::UnicodeVersion version) const -{ - QString copy = *this; - qt_string_normalize(©, mode, version, 0); - return copy; -} - void qt_string_normalize(QString *data, QString::NormalizationForm mode, QChar::UnicodeVersion version, int from) { bool simple = true; @@ -6606,6 +6582,17 @@ void qt_string_normalize(QString *data, QString::NormalizationForm mode, QChar:: composeHelper(data, version, from); } +/*! + Returns the string in the given Unicode normalization \a mode, + according to the given \a version of the Unicode standard. +*/ +QString QString::normalized(QString::NormalizationForm mode, QChar::UnicodeVersion version) const +{ + QString copy = *this; + qt_string_normalize(©, mode, version, 0); + return copy; +} + struct ArgEscapeData { diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 4936bcec2a..a9f2484de6 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -425,8 +425,7 @@ public: NormalizationForm_KD, NormalizationForm_KC }; - QString normalized(NormalizationForm mode) const Q_REQUIRED_RESULT; - QString normalized(NormalizationForm mode, QChar::UnicodeVersion version) const Q_REQUIRED_RESULT; + QString normalized(NormalizationForm mode, QChar::UnicodeVersion version = QChar::Unicode_Unassigned) const Q_REQUIRED_RESULT; QString repeated(int times) const;