summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/doc/snippets/code/doc_src_containers.cpp7
-rw-r--r--src/corelib/doc/src/containers.qdoc4
-rw-r--r--src/corelib/global/qcompilerdetection.h8
-rw-r--r--src/corelib/global/qversiontagging.h12
-rw-r--r--src/corelib/io/qdir.cpp11
-rw-r--r--src/corelib/io/qfileinfo.cpp2
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp33
-rw-r--r--src/corelib/io/qfilesystementry.cpp10
-rw-r--r--src/corelib/io/qfilesystemiterator_win.cpp3
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp2
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp16
-rw-r--r--src/corelib/tools/qdatetime.cpp22
-rw-r--r--src/corelib/tools/qstring.cpp54
13 files changed, 116 insertions, 68 deletions
diff --git a/src/corelib/doc/snippets/code/doc_src_containers.cpp b/src/corelib/doc/snippets/code/doc_src_containers.cpp
index 395e48bc89..5b0d829367 100644
--- a/src/corelib/doc/snippets/code/doc_src_containers.cpp
+++ b/src/corelib/doc/snippets/code/doc_src_containers.cpp
@@ -156,10 +156,9 @@ for (i = list.begin(); i != list.end(); ++i)
QList<QString> list;
list << "A" << "B" << "C" << "D";
-QList<QString>::iterator i = list.end();
-while (i != list.begin()) {
- --i;
- *i = (*i).toLower();
+QList<QString>::reverse_iterator i;
+for (i = list.rbegin(); i != list.rend(); ++i)
+ *i = i->toLower();
}
//! [11]
diff --git a/src/corelib/doc/src/containers.qdoc b/src/corelib/doc/src/containers.qdoc
index 0ae3817ac7..988f728946 100644
--- a/src/corelib/doc/src/containers.qdoc
+++ b/src/corelib/doc/src/containers.qdoc
@@ -472,9 +472,7 @@
\image stliterators1.png
- Iterating backward with an STL-style iterator requires us to
- decrement the iterator \e before we access the item. This
- requires a \c while loop:
+ Iterating backward with an STL-style iterator is done with reverse iterators:
\snippet code/doc_src_containers.cpp 11
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index eec8b5223b..e655aace32 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -937,8 +937,8 @@
// Older versions (QNX 650) do not support C++11 features
// _HAS_* macros are set to 1 by toolchains that actually include
// Dinkum C++11 libcpp.
-# if !__GLIBCXX__
-# if !_HAS_CPP0X
+# if !defined(__GLIBCXX__)
+# if !defined(_HAS_CPP0X) || !_HAS_CPP0X
// Disable C++11 features that depend on library support
# undef Q_COMPILER_INITIALIZER_LISTS
# undef Q_COMPILER_RVALUE_REFS
@@ -946,10 +946,10 @@
# undef Q_COMPILER_UNICODE_STRINGS
# undef Q_COMPILER_NOEXCEPT
# endif // !_HAS_CPP0X
-# if !_HAS_NULLPTR_T
+# if !defined(_HAS_NULLPTR_T) || !_HAS_NULLPTR_T
# undef Q_COMPILER_NULLPTR
# endif //!_HAS_NULLPTR_T
-# if !_HAS_CONSTEXPR
+# if !defined(_HAS_CONSTEXPR) || !_HAS_CONSTEXPR
// The libcpp is missing constexpr keywords on important functions like std::numeric_limits<>::min()
// Disable constexpr support on QNX even if the compiler supports it
# undef Q_COMPILER_CONSTEXPR
diff --git a/src/corelib/global/qversiontagging.h b/src/corelib/global/qversiontagging.h
index 706e7e07ff..f9062a98fb 100644
--- a/src/corelib/global/qversiontagging.h
+++ b/src/corelib/global/qversiontagging.h
@@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE
* qt_version_tag symbol that is present in QtCore. Such symbol is versioned,
* so the linker will automatically pull the current Qt version and add it to
* the ELF header of the library/application. The assembly produces one section
- * called ".qtversion" containing two pointer-sized values. The first is a
+ * called ".qtversion" containing two 32-bit values. The first is a
* relocation to the qt_version_tag symbol (which is what causes the ELF
* version to get used). The second value is the current Qt version at the time
* of compilation.
@@ -64,10 +64,12 @@ QT_BEGIN_NAMESPACE
// don't make tags in QtCore, bootstrapped systems or if the user asked not to
#elif defined(Q_CC_GNU) && !defined(Q_OS_ANDROID)
# if defined(Q_PROCESSOR_X86) && (defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD_KERNEL))
-# ifdef __LP64__
-# define QT_VERSION_TAG_RELOC(sym) ".quad " QT_STRINGIFY(QT_MANGLE_NAMESPACE(sym)) "@GOTPCREL\n"
-# elif defined(Q_PROCESSOR_X86_64) // x32
-# define QT_VERSION_TAG_RELOC(sym) ".long " QT_STRINGIFY(QT_MANGLE_NAMESPACE(sym)) "@GOTPCREL\n"
+# if defined(Q_PROCESSOR_X86_64) // x86-64 or x32
+# if defined(__code_model_large__)
+# define QT_VERSION_TAG_RELOC(sym) ".quad " QT_STRINGIFY(QT_MANGLE_NAMESPACE(sym)) "@GOT\n"
+# else
+# define QT_VERSION_TAG_RELOC(sym) ".long " QT_STRINGIFY(QT_MANGLE_NAMESPACE(sym)) "@GOTPCREL\n"
+# endif
# else // x86
# define QT_VERSION_TAG_RELOC(sym) ".long " QT_STRINGIFY(QT_MANGLE_NAMESPACE(sym)) "@GOT\n"
# endif
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 34cea0935c..9b9b00f76d 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -158,7 +158,11 @@ inline void QDirPrivate::setPath(const QString &path)
if (p.endsWith(QLatin1Char('/'))
&& p.length() > 1
#if defined(Q_OS_WIN)
+# if defined (Q_OS_WINRT)
+ && (!(p.toLower() == QDir::rootPath().toLower()))
+# else
&& (!(p.length() == 3 && p.at(1).unicode() == ':' && p.at(0).isLetter()))
+# endif
#endif
) {
p.truncate(p.length() - 1);
@@ -891,6 +895,9 @@ bool QDir::cd(const QString &dirName)
#if defined (Q_OS_UNIX)
//After cleanPath() if path is "/.." or starts with "/../" it means trying to cd above root.
if (newPath.startsWith(QLatin1String("/../")) || newPath == QLatin1String("/.."))
+#elif defined (Q_OS_WINRT)
+ const QString rootPath = QDir::rootPath();
+ if (newPath.size() < rootPath.size() && rootPath.startsWith(newPath))
#else
/*
cleanPath() already took care of replacing '\' with '/'.
@@ -2193,7 +2200,11 @@ QString QDir::cleanPath(const QString &path)
// Strip away last slash except for root directories
if (ret.length() > 1 && ret.endsWith(QLatin1Char('/'))) {
#if defined (Q_OS_WIN)
+# if defined(Q_OS_WINRT)
+ if (!((ret.length() == 3 || ret.length() == QDir::rootPath().length()) && ret.at(1) == QLatin1Char(':')))
+# else
if (!(ret.length() == 3 && ret.at(1) == QLatin1Char(':')))
+# endif
#endif
ret.chop(1);
}
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index d4a8d09107..76b56f4699 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -1101,7 +1101,7 @@ bool QFileInfo::isRoot() const
return true;
if (d->fileEngine == 0) {
if (d->fileEntry.isRoot()) {
-#if defined(Q_OS_WIN)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
//the path is a drive root, but the drive may not exist
//for backward compatibility, return true only if the drive exists
if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::ExistsAttribute))
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index 826a023d3d..0829bbc6e8 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -84,6 +84,11 @@ using namespace Microsoft::WRL::Wrappers;
using namespace ABI::Windows::Foundation;
using namespace ABI::Windows::Storage;
using namespace ABI::Windows::ApplicationModel;
+
+#if _MSC_VER < 1900
+#define Q_OS_WINRT_WIN81
+#endif
+
#endif // Q_OS_WINRT
#ifndef SPI_GETPLATFORMTYPE
@@ -528,7 +533,7 @@ QString QFileSystemEngine::nativeAbsoluteFilePath(const QString &path)
{
// can be //server or //server/share
QString absPath;
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT_WIN81)
QVarLengthArray<wchar_t, MAX_PATH> buf(qMax(MAX_PATH, path.size() + 1));
wchar_t *fileName = 0;
DWORD retLen = GetFullPathName((wchar_t*)path.utf16(), buf.size(), buf.data(), &fileName);
@@ -538,6 +543,16 @@ QString QFileSystemEngine::nativeAbsoluteFilePath(const QString &path)
}
if (retLen != 0)
absPath = QString::fromWCharArray(buf.data(), retLen);
+# if defined(Q_OS_WINRT)
+ // Win32 returns eg C:/ as root directory with a trailing /.
+ // WinRT returns the sandbox root without /.
+ // Also C:/../.. returns C:/ on Win32, while for WinRT it steps outside the package
+ // and goes beyond package root. Hence force the engine to stay inside
+ // the package.
+ const QString rootPath = QDir::toNativeSeparators(QDir::rootPath());
+ if (absPath.size() < rootPath.size() && rootPath.startsWith(absPath))
+ absPath = rootPath;
+# endif // Q_OS_WINRT
#elif !defined(Q_OS_WINCE)
if (QDir::isRelativePath(path))
absPath = QDir::toNativeSeparators(QDir::cleanPath(QDir::currentPath() + QLatin1Char('/') + path));
@@ -575,7 +590,7 @@ QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry)
ret = entry.filePath();
#endif
} else {
-#ifndef Q_OS_WINRT
+#ifndef Q_OS_WINRT_WIN81
ret = QDir::cleanPath(QDir::currentPath() + QLatin1Char('/') + entry.filePath());
#else
// Some WinRT APIs do not support absolute paths (due to sandboxing).
@@ -1224,8 +1239,8 @@ QString QFileSystemEngine::rootPath()
if (FAILED(item->get_Path(finalWinPath.GetAddressOf())))
return ret;
- ret = QDir::fromNativeSeparators(QString::fromWCharArray(finalWinPath.GetRawBuffer(nullptr)));
-
+ const QString qtWinPath = QDir::fromNativeSeparators(QString::fromWCharArray(finalWinPath.GetRawBuffer(nullptr)));
+ ret = qtWinPath.endsWith(QLatin1Char('/')) ? qtWinPath : qtWinPath + QLatin1Char('/');
#else
QString ret = QString::fromLatin1(qgetenv("SystemDrive"));
if (ret.isEmpty())
@@ -1343,7 +1358,7 @@ bool QFileSystemEngine::setCurrentPath(const QFileSystemEntry &entry)
if(!(meta.exists() && meta.isDirectory()))
return false;
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT_WIN81)
//TODO: this should really be using nativeFilePath(), but that returns a path in long format \\?\c:\foo
//which causes many problems later on when it's returned through currentPath()
return ::SetCurrentDirectory(reinterpret_cast<const wchar_t*>(QDir::toNativeSeparators(entry.filePath()).utf16())) != 0;
@@ -1356,7 +1371,7 @@ bool QFileSystemEngine::setCurrentPath(const QFileSystemEntry &entry)
QFileSystemEntry QFileSystemEngine::currentPath()
{
QString ret;
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT_WIN81)
DWORD size = 0;
wchar_t currentName[PATH_MAX];
size = ::GetCurrentDirectory(PATH_MAX, currentName);
@@ -1372,17 +1387,17 @@ QFileSystemEntry QFileSystemEngine::currentPath()
}
if (ret.length() >= 2 && ret[1] == QLatin1Char(':'))
ret[0] = ret.at(0).toUpper(); // Force uppercase drive letters.
-#else // !Q_OS_WINCE && !Q_OS_WINRT
+#else // !Q_OS_WINCE && !Q_OS_WINRT_WIN81
//TODO - a race condition exists when using currentPath / setCurrentPath from multiple threads
if (qfsPrivateCurrentDir.isEmpty())
-#ifndef Q_OS_WINRT
+#ifndef Q_OS_WINRT_WIN81
qfsPrivateCurrentDir = QCoreApplication::applicationDirPath();
#else
qfsPrivateCurrentDir = QDir::rootPath();
#endif
ret = qfsPrivateCurrentDir;
-#endif // Q_OS_WINCE || Q_OS_WINRT
+#endif // Q_OS_WINCE || Q_OS_WINRT_WIN81
return QFileSystemEntry(ret, QFileSystemEntry::FromNativePath());
}
diff --git a/src/corelib/io/qfilesystementry.cpp b/src/corelib/io/qfilesystementry.cpp
index bf63e72a79..21c6fd89a9 100644
--- a/src/corelib/io/qfilesystementry.cpp
+++ b/src/corelib/io/qfilesystementry.cpp
@@ -172,6 +172,12 @@ void QFileSystemEntry::resolveNativeFilePath() const
m_nativeFilePath.remove(0,1);
if (m_nativeFilePath.isEmpty())
m_nativeFilePath.append(QLatin1Char('.'));
+ // WinRT/MSVC2015 allows a maximum of 256 characters for a filepath
+ // unless //?/ is prepended which extends the rule to have a maximum
+ // of 256 characters in the filename plus the preprending path
+#if _MSC_VER >= 1900
+ m_nativeFilePath.prepend("\\\\?\\");
+#endif
#endif
}
}
@@ -289,9 +295,13 @@ bool QFileSystemEntry::isAbsolute() const
bool QFileSystemEntry::isDriveRoot() const
{
resolveFilePath();
+#ifndef Q_OS_WINRT
return (m_filePath.length() == 3
&& m_filePath.at(0).isLetter() && m_filePath.at(1) == QLatin1Char(':')
&& m_filePath.at(2) == QLatin1Char('/'));
+#else // !Q_OS_WINRT
+ return m_filePath == QDir::rootPath();
+#endif // !Q_OS_WINRT
}
#endif
diff --git a/src/corelib/io/qfilesystemiterator_win.cpp b/src/corelib/io/qfilesystemiterator_win.cpp
index 82c4a69025..2caf87a7b4 100644
--- a/src/corelib/io/qfilesystemiterator_win.cpp
+++ b/src/corelib/io/qfilesystemiterator_win.cpp
@@ -73,7 +73,8 @@ QFileSystemIterator::QFileSystemIterator(const QFileSystemEntry &entry, QDir::Fi
if (!nativePath.endsWith(QLatin1Char('\\')))
nativePath.append(QLatin1Char('\\'));
nativePath.append(QLatin1Char('*'));
-#ifdef Q_OS_WINRT
+ // In MSVC2015+ case we prepend //?/ for longer file-name support
+#if defined(Q_OS_WINRT) && _MSC_VER < 1900
if (nativePath.startsWith(QLatin1Char('\\')))
nativePath.remove(0, 1);
#endif
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index f4adee8c1b..d94a8433a9 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -1043,7 +1043,7 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size,
offsetHi, offsetLo, size + extra);
#else
LPVOID mapAddress = ::MapViewOfFileFromApp(mapHandle, access,
- (ULONG64(offsetHi) << 32) + offsetLo, size);
+ (ULONG64(offsetHi) << 32) + offsetLo, size + extra);
#endif
if (mapAddress) {
uchar *address = extra + static_cast<uchar*>(mapAddress);
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index c49994a98d..60f3dc0db0 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -183,16 +183,18 @@ void QCoreApplicationPrivate::processCommandLineArguments()
{
int j = argc ? 1 : 0;
for (int i = 1; i < argc; ++i) {
- if (argv[i] && *argv[i] != '-') {
+ if (!argv[i])
+ continue;
+ if (*argv[i] != '-') {
argv[j++] = argv[i];
continue;
}
- QByteArray arg = argv[i];
- if (arg.startsWith("--"))
- arg.remove(0, 1);
- if (arg.startsWith("-qmljsdebugger=")) {
- qmljs_debug_arguments = QString::fromLocal8Bit(arg.right(arg.length() - 15));
- } else if (arg == "-qmljsdebugger" && i < argc - 1) {
+ const char *arg = argv[i];
+ if (arg[1] == '-') // startsWith("--")
+ ++arg;
+ if (strncmp(arg, "-qmljsdebugger=", 15) == 0) {
+ qmljs_debug_arguments = QString::fromLocal8Bit(arg + 15);
+ } else if (strcmp(arg, "-qmljsdebugger") == 0 && i < argc - 1) {
++i;
qmljs_debug_arguments = QString::fromLocal8Bit(argv[i]);
} else {
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 96c188666d..4f7d99b1d8 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -2706,10 +2706,11 @@ qint64 QDateTimePrivate::toMSecsSinceEpoch() const
}
case Qt::TimeZone:
-#ifndef QT_BOOTSTRAPPED
+#ifdef QT_BOOTSTRAPPED
+ break;
+#else
return zoneMSecsToEpochMSecs(m_msecs, m_timeZone);
#endif
- break;
}
Q_UNREACHABLE();
return 0;
@@ -3206,7 +3207,9 @@ QString QDateTime::timeZoneAbbreviation() const
case Qt::OffsetFromUTC:
return QTimeZonePrivate::utcQString() + toOffsetString(Qt::ISODate, d->m_offsetFromUtc);
case Qt::TimeZone:
-#ifndef QT_BOOTSTRAPPED
+#ifdef QT_BOOTSTRAPPED
+ break;
+#else
return d->m_timeZone.d->abbreviation(d->toMSecsSinceEpoch());
#endif // QT_BOOTSTRAPPED
case Qt::LocalTime: {
@@ -3237,7 +3240,9 @@ bool QDateTime::isDaylightTime() const
case Qt::OffsetFromUTC:
return false;
case Qt::TimeZone:
-#ifndef QT_BOOTSTRAPPED
+#ifdef QT_BOOTSTRAPPED
+ break;
+#else
return d->m_timeZone.d->isDaylightTime(toMSecsSinceEpoch());
#endif // QT_BOOTSTRAPPED
case Qt::LocalTime: {
@@ -4829,10 +4834,8 @@ QDataStream &operator<<(QDataStream &out, const QDateTime &dateTime)
out << (qint8)QDateTimePrivate::OffsetFromUTC;
break;
case Qt::TimeZone:
-#ifndef QT_BOOTSTRAPPED
out << (qint8)QDateTimePrivate::TimeZone;
break;
-#endif // QT_BOOTSTRAPPED
case Qt::LocalTime:
out << (qint8)QDateTimePrivate::LocalUnknown;
break;
@@ -4905,10 +4908,11 @@ QDataStream &operator>>(QDataStream &in, QDateTime &dateTime)
spec = Qt::OffsetFromUTC;
break;
case QDateTimePrivate::TimeZone:
-#ifndef QT_BOOTSTRAPPED
spec = Qt::TimeZone;
+#ifndef QT_BOOTSTRAPPED
+ // FIXME: need to use a different constructor !
+#endif
break;
-#endif // QT_BOOTSTRAPPED
case QDateTimePrivate::LocalUnknown:
case QDateTimePrivate::LocalStandard:
case QDateTimePrivate::LocalDST:
@@ -4964,8 +4968,8 @@ QDebug operator<<(QDebug dbg, const QDateTime &date)
case Qt::TimeZone:
#ifndef QT_BOOTSTRAPPED
dbg << ' ' << date.timeZone().id();
- break;
#endif // QT_BOOTSTRAPPED
+ break;
case Qt::LocalTime:
break;
}
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 9b98f4322b..24d43dad88 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -5733,37 +5733,42 @@ static QString detachAndConvertCase(T &str, QStringIterator it)
Q_ASSERT(!str.isEmpty());
QString s = qMove(str); // will copy if T is const QString
QChar *pp = s.begin() + it.index(); // will detach if necessary
- uint uc = it.nextUnchecked();
- forever {
+
+ do {
+ uint uc = it.nextUnchecked();
+
const QUnicodeTables::Properties *prop = qGetProp(uc);
signed short caseDiff = Traits::caseDiff(prop);
if (Q_UNLIKELY(Traits::caseSpecial(prop))) {
- // slow path: the string is growing
const ushort *specialCase = specialCaseMap + caseDiff;
ushort length = *specialCase++;
- int inpos = it.index() - 1;
- int outpos = pp - s.constBegin();
-
- s.replace(outpos, 1, reinterpret_cast<const QChar *>(specialCase), length);
- pp = const_cast<QChar *>(s.constBegin()) + outpos + length;
-
- // do we need to adjust the input iterator too?
- // if it is pointing to s's data, str is empty
- if (str.isEmpty())
- it = QStringIterator(s.constBegin(), inpos + length, s.constEnd());
- } else if (QChar::requiresSurrogates(uc)) {
- *pp++ = QChar::highSurrogate(uc + caseDiff);
+
+ if (Q_LIKELY(length == 1)) {
+ *pp++ = QChar(*specialCase);
+ } else {
+ // slow path: the string is growing
+ int inpos = it.index() - 1;
+ int outpos = pp - s.constBegin();
+
+ s.replace(outpos, 1, reinterpret_cast<const QChar *>(specialCase), length);
+ pp = const_cast<QChar *>(s.constBegin()) + outpos + length;
+
+ // do we need to adjust the input iterator too?
+ // if it is pointing to s's data, str is empty
+ if (str.isEmpty())
+ it = QStringIterator(s.constBegin(), inpos + length, s.constEnd());
+ }
+ } else if (Q_UNLIKELY(QChar::requiresSurrogates(uc))) {
+ // so far, case convertion never changes planes (guaranteed by the qunicodetables generator)
+ pp++;
*pp++ = QChar::lowSurrogate(uc + caseDiff);
} else {
*pp++ = QChar(uc + caseDiff);
}
+ } while (it.hasNext());
- if (!it.hasNext())
- return s;
-
- uc = it.nextUnchecked();
- }
+ return s;
}
template <typename Traits, typename T>
@@ -5776,12 +5781,13 @@ static QString convertCase(T &str)
while (e != p && e[-1].isHighSurrogate())
--e;
- const QUnicodeTables::Properties *prop;
QStringIterator it(p, e);
- for ( ; it.hasNext(); it.advanceUnchecked()) {
- prop = qGetProp(it.peekNextUnchecked());
- if (Traits::caseDiff(prop))
+ while (it.hasNext()) {
+ uint uc = it.nextUnchecked();
+ if (Traits::caseDiff(qGetProp(uc))) {
+ it.recedeUnchecked();
return detachAndConvertCase<Traits>(str, it);
+ }
}
return qMove(str);
}