OSDN Git Service

remove unused QString::normalized() overload
authorIvailo Monev <xakepa10@gmail.com>
Sun, 13 Sep 2020 14:14:28 +0000 (17:14 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Sun, 13 Sep 2020 14:14:28 +0000 (17:14 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/tools/qstring.cpp
src/core/tools/qstring.h
tests/auto/qchar/tst_qchar.cpp

index 3247c91..5e1b865 100644 (file)
@@ -5657,65 +5657,6 @@ QStringList QString::split(const QRegExp &rx, SplitBehavior behavior) const
 */
 QString QString::normalized(QString::NormalizationForm mode) const
 {
-    return normalized(mode, QChar::Unicode_Last);
-}
-
-/*!
-    \since 4.5
-
-    Returns a copy of this string repeated the specified number of \a times.
-
-    If \a times is less than 1, an empty string is returned.
-
-    Example:
-
-    \code
-        QString str("ab");
-        str.repeated(4);            // returns "abababab"
-    \endcode
-*/
-QString QString::repeated(int times) const
-{
-    if (d->size == 0 || times == 1)
-        return *this;
-
-    if (times < 1) {
-        return QString();
-    }
-
-    const int resultSize = times * d->size;
-
-    QString result(resultSize, Qt::Uninitialized);
-    if (result.d->alloc != resultSize)
-        return QString(); // not enough memory
-
-    memcpy(result.d->data, d->data, d->size * sizeof(ushort));
-
-    int sizeSoFar = d->size;
-    ushort *end = result.d->data + sizeSoFar;
-
-    const int halfResultSize = resultSize >> 1;
-    while (sizeSoFar <= halfResultSize) {
-        memcpy(end, result.d->data, sizeSoFar * sizeof(ushort));
-        end += sizeSoFar;
-        sizeSoFar <<= 1;
-    }
-    memcpy(end, result.d->data, (resultSize - sizeSoFar) * sizeof(ushort));
-    result.d->data[resultSize] = '\0';
-    result.d->size = resultSize;
-    return result;
-}
-
-/*!
-    \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
-{
-    Q_UNUSED(version);
     UErrorCode error = U_ZERO_ERROR;
     const UNormalizer2 *normalizer = Q_NULLPTR;
     switch (mode) {
@@ -5766,6 +5707,52 @@ QString QString::normalized(QString::NormalizationForm mode, QChar::UnicodeVersi
     return result;
 }
 
+/*!
+    \since 4.5
+
+    Returns a copy of this string repeated the specified number of \a times.
+
+    If \a times is less than 1, an empty string is returned.
+
+    Example:
+
+    \code
+        QString str("ab");
+        str.repeated(4);            // returns "abababab"
+    \endcode
+*/
+QString QString::repeated(int times) const
+{
+    if (d->size == 0 || times == 1)
+        return *this;
+
+    if (times < 1) {
+        return QString();
+    }
+
+    const int resultSize = times * d->size;
+
+    QString result(resultSize, Qt::Uninitialized);
+    if (result.d->alloc != resultSize)
+        return QString(); // not enough memory
+
+    memcpy(result.d->data, d->data, d->size * sizeof(ushort));
+
+    int sizeSoFar = d->size;
+    ushort *end = result.d->data + sizeSoFar;
+
+    const int halfResultSize = resultSize >> 1;
+    while (sizeSoFar <= halfResultSize) {
+        memcpy(end, result.d->data, sizeSoFar * sizeof(ushort));
+        end += sizeSoFar;
+        sizeSoFar <<= 1;
+    }
+    memcpy(end, result.d->data, (resultSize - sizeSoFar) * sizeof(ushort));
+    result.d->data[resultSize] = '\0';
+    result.d->size = resultSize;
+    return result;
+}
+
 struct ArgEscapeData
 {
     int min_escape;            // lowest escape sequence number
index 0cacf37..6ef19b1 100644 (file)
@@ -296,7 +296,6 @@ public:
         NormalizationForm_KC
     };
     QString normalized(NormalizationForm mode) const Q_REQUIRED_RESULT;
-    QString normalized(NormalizationForm mode, QChar::UnicodeVersion version) const Q_REQUIRED_RESULT;
 
     QString repeated(int times) const;
 
index 1ce6435..b3e6058 100644 (file)
@@ -600,7 +600,7 @@ void tst_QChar::normalization_manual()
         decomposed += QChar(0x0221); // assigned in 4.0
         decomposed += QChar(0x300);
 
-        QVERIFY(decomposed.normalized(QString::NormalizationForm_C, QChar::Unicode_3_2) == decomposed);
+        QVERIFY(decomposed.normalized(QString::NormalizationForm_C) == decomposed);
 
         decomposed[1] = QChar(0x037f); // unassigned in 6.1