From 9e31f40c510d3efc3676cff2186410d38d539a4d Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 1 Jun 2011 14:11:09 +0200 Subject: Added an additional check to workaround an issue on Windows. Reviewed-by: David Boddie Original-patch-by: Friedemann Kleint (cherry picked from commit 8b1654ec6a892e84c1654c9196e80461ee6e92fa) --- tools/qdoc3/cppcodemarker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp index 9591801..2067716 100644 --- a/tools/qdoc3/cppcodemarker.cpp +++ b/tools/qdoc3/cppcodemarker.cpp @@ -953,7 +953,7 @@ QString CppCodeMarker::addMarkUp(const QString &in, ident += ch; finish = i; readChar(); - } while (isalnum(ch) || ch == '_'); + } while (ch >= 0 && isalnum(ch) || ch == '_'); if (classRegExp.exactMatch(ident)) { tag = QLatin1String("type"); -- cgit v0.12 From 88b4736d8085db27abbe54ac6ece86f9badf154a Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 21 Jul 2011 19:59:00 +0200 Subject: Doc: Fixed the example of an encoded URL in the class description. Task-number: QTBUG-20398 --- src/corelib/io/qurl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 2f0fd46..3f49cc6 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -63,8 +63,9 @@ unencoded representation is suitable for showing to users, but the encoded representation is typically what you would send to a web server. For example, the unencoded URL - "http://b\uuml\c{}hler.example.com" would be sent to the server as - "http://xn--bhler-kva.example.com/List%20of%20applicants.xml". + "http://b\uuml\c{}hler.example.com/List of applicants.xml" would be sent to the server as + "http://xn--bhler-kva.example.com/List%20of%20applicants.xml", + and this can be verified by calling the toEncoded() function. A URL can also be constructed piece by piece by calling setScheme(), setUserName(), setPassword(), setHost(), setPort(), -- cgit v0.12 From ca34cc75294e0d2a8bc491a2c679fe8a69cd0408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Fri, 26 Aug 2011 15:43:06 +0200 Subject: Wrap calls to Sequence::push_back In C++11 push_back is overloaded to support rvalue-references, void std::vector::push_back(const T &); void std::vector::push_back(T &&); so attempting to get the address for push_back is ambiguous. Instead of hardcoding the function signature, the better and more general solution is to allow the compiler to do the required overload resolution itself, also allowing for implicit conversions to take place. Task-number: QTBUG-18996 Done-with: Liang Qi Reviewed-by: Olivier Goffart --- src/corelib/concurrent/qtconcurrentfilter.h | 20 +++++++++----------- .../concurrent/qtconcurrentfunctionwrappers.h | 19 +++++++++++++++++++ src/corelib/concurrent/qtconcurrentmap.h | 8 ++++---- tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp | 4 ---- 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/src/corelib/concurrent/qtconcurrentfilter.h b/src/corelib/concurrent/qtconcurrentfilter.h index 4b9c4ae..d8c5f43 100644 --- a/src/corelib/concurrent/qtconcurrentfilter.h +++ b/src/corelib/concurrent/qtconcurrentfilter.h @@ -102,10 +102,9 @@ namespace QtConcurrent { namespace QtConcurrent { -template -ThreadEngineStarter filterInternal(Sequence &sequence, KeepFunctor keep, T (C::*reduce)(U)) +template +ThreadEngineStarter filterInternal(Sequence &sequence, KeepFunctor keep, ReduceFunctor reduce) { - typedef MemberFunctionWrapper1 ReduceFunctor; typedef typename Sequence::const_iterator Iterator; typedef FilterKernel KernelType; return startThreadEngine(new KernelType(sequence, keep, reduce)); @@ -115,7 +114,7 @@ ThreadEngineStarter filterInternal(Sequence &sequence, KeepFunctor keep, T template QFuture filter(Sequence &sequence, KeepFunctor keep) { - return filterInternal(sequence, QtPrivate::createFunctionWrapper(keep), &Sequence::push_back); + return filterInternal(sequence, QtPrivate::createFunctionWrapper(keep), QtPrivate::PushBackWrapper()); } // filteredReduced() on sequences @@ -184,7 +183,7 @@ QFuture::value_type> filtered(Iterator begin, Iter template void blockingFilter(Sequence &sequence, KeepFunctor keep) { - filterInternal(sequence, QtPrivate::createFunctionWrapper(keep), &Sequence::push_back).startBlocking(); + filterInternal(sequence, QtPrivate::createFunctionWrapper(keep), QtPrivate::PushBackWrapper()).startBlocking(); } // blocking filteredReduced() on sequences @@ -246,18 +245,17 @@ typename QtPrivate::ReduceResultType::ResultType blockingFiltered template Sequence blockingFiltered(const Sequence &sequence, KeepFunctor keep) { - return blockingFilteredReduced(sequence, QtPrivate::createFunctionWrapper(keep), &Sequence::push_back, OrderedReduce); + return startFilteredReduced(sequence, QtPrivate::createFunctionWrapper(keep), QtPrivate::PushBackWrapper(), OrderedReduce).startBlocking(); } // blocking filtered() on iterators template OutputSequence blockingFiltered(Iterator begin, Iterator end, KeepFunctor keep) { - return blockingFilteredReduced(begin, - end, - QtPrivate::createFunctionWrapper(keep), - &OutputSequence::push_back, - OrderedReduce); + return startFilteredReduced(begin, end, + QtPrivate::createFunctionWrapper(keep), + QtPrivate::PushBackWrapper(), + OrderedReduce).startBlocking(); } } // namespace QtConcurrent diff --git a/src/corelib/concurrent/qtconcurrentfunctionwrappers.h b/src/corelib/concurrent/qtconcurrentfunctionwrappers.h index 4bf2736..1e09221 100644 --- a/src/corelib/concurrent/qtconcurrentfunctionwrappers.h +++ b/src/corelib/concurrent/qtconcurrentfunctionwrappers.h @@ -195,6 +195,25 @@ QtConcurrent::ConstMemberFunctionWrapper createFunctionWrapper(T (C::*func return QtConcurrent::ConstMemberFunctionWrapper(func); } +struct PushBackWrapper +{ + typedef void result_type; + + template + inline void operator()(C &c, const U &u) const + { + return c.push_back(u); + } + +#ifdef Q_COMPILER_RVALUE_REFS + template + inline void operator()(C &c, U &&u) const + { + return c.push_back(u); + } +#endif +}; + template ::Value> struct LazyResultType { typedef typename Functor::result_type Type; }; template diff --git a/src/corelib/concurrent/qtconcurrentmap.h b/src/corelib/concurrent/qtconcurrentmap.h index 37a4143..166d5c8 100644 --- a/src/corelib/concurrent/qtconcurrentmap.h +++ b/src/corelib/concurrent/qtconcurrentmap.h @@ -271,7 +271,7 @@ OutputSequence blockingMapped(const InputSequence &sequence, MapFunctor map) return blockingMappedReduced (sequence, QtPrivate::createFunctionWrapper(map), - &OutputSequence::push_back, + QtPrivate::PushBackWrapper(), QtConcurrent::OrderedReduce); } @@ -282,7 +282,7 @@ typename QtPrivate::MapResultType::ResultType blockin return blockingMappedReduced (sequence, QtPrivate::createFunctionWrapper(map), - &OutputSequence::push_back, + QtPrivate::PushBackWrapper(), QtConcurrent::OrderedReduce); } @@ -293,7 +293,7 @@ Sequence blockingMapped(Iterator begin, Iterator end, MapFunctor map) return blockingMappedReduced (begin, end, QtPrivate::createFunctionWrapper(map), - &Sequence::push_back, + QtPrivate::PushBackWrapper(), QtConcurrent::OrderedReduce); } @@ -304,7 +304,7 @@ typename QtPrivate::MapResultType::ResultType blockingMapp return blockingMappedReduced (begin, end, QtPrivate::createFunctionWrapper(map), - &OutputSequence::push_back, + QtPrivate::PushBackWrapper(), QtConcurrent::OrderedReduce); } diff --git a/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp b/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp index f4249ab..336dc71 100644 --- a/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp +++ b/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp @@ -2320,10 +2320,6 @@ void tst_QtConcurrentMap::stlContainers() { #ifdef QT_NO_STL QSKIP("Qt compiled without STL support", SkipAll); -#elif defined(Q_COMPILER_RVALUE_REFS) - //mapped uses &Container::push_back, but in c++0x, std::vector has two overload of it - // meaning it is not possible to take the address of that function anymore. - QSKIP("mapped do not work with c++0x stl vector", SkipAll); #else std::vector vector; vector.push_back(1); -- cgit v0.12 From ddf5a09d469a1ded5490cffe54e0013a0d5ba347 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 1 Sep 2011 15:04:33 +0100 Subject: Fix comparison of absolute, unclean paths in QDir QDir::operator== was creating a clean absolute path for comparison purposes if the original path was relative. However original absolute paths were trusted, even though they could be unclean. Now they are checked for cleanliness first. Task-Number: QTBUG-19995 Task-Number: QTBUG-20495 Change-Id: I047a1a40ae5151e4604085e4ac87f30a4e4979c4 Reviewed-on: http://codereview.qt.nokia.com/4099 Reviewed-by: Qt Sanity Bot Reviewed-by: Prasanth Ullattil --- src/corelib/io/qdir.cpp | 2 +- src/corelib/io/qfilesystementry.cpp | 31 +++++++++++++++++++++ src/corelib/io/qfilesystementry_p.h | 1 + tests/auto/qdir/tst_qdir.cpp | 13 +++++++++ .../auto/qfilesystementry/tst_qfilesystementry.cpp | 32 ++++++++++++++++++++++ 5 files changed, 78 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index c0c62e1..3271148 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -198,7 +198,7 @@ inline void QDirPrivate::resolveAbsoluteEntry() const QString absoluteName; if (fileEngine.isNull()) { - if (!dirEntry.isRelative()) { + if (!dirEntry.isRelative() && dirEntry.isClean()) { absoluteDirEntry = dirEntry; return; } diff --git a/src/corelib/io/qfilesystementry.cpp b/src/corelib/io/qfilesystementry.cpp index bb7cb4e..2f37542 100644 --- a/src/corelib/io/qfilesystementry.cpp +++ b/src/corelib/io/qfilesystementry.cpp @@ -380,4 +380,35 @@ void QFileSystemEntry::findFileNameSeparators() const } } +bool QFileSystemEntry::isClean() const +{ + resolveFilePath(); + int dots = 0; + bool dotok = true; // checking for ".." or "." starts to relative paths + bool slashok = true; + for (QString::const_iterator iter = m_filePath.constBegin(); iter != m_filePath.constEnd(); iter++) { + if (*iter == QLatin1Char('/')) { + if (dots == 1 || dots == 2) + return false; // path contains "./" or "../" + if (!slashok) + return false; // path contains "//" + dots = 0; + dotok = true; + slashok = false; + } else if (dotok) { + slashok = true; + if (*iter == QLatin1Char('.')) { + dots++; + if (dots > 2) + dotok = false; + } else { + //path element contains a character other than '.', it's clean + dots = 0; + dotok = false; + } + } + } + return (dots != 1 && dots != 2); // clean if path doesn't end in . or .. +} + QT_END_NAMESPACE diff --git a/src/corelib/io/qfilesystementry_p.h b/src/corelib/io/qfilesystementry_p.h index 34b083a..8d524c0 100644 --- a/src/corelib/io/qfilesystementry_p.h +++ b/src/corelib/io/qfilesystementry_p.h @@ -91,6 +91,7 @@ public: QString completeSuffix() const; bool isAbsolute() const; bool isRelative() const; + bool isClean() const; #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) bool isDriveRoot() const; diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp index 419eaae..7e5ec79 100644 --- a/tests/auto/qdir/tst_qdir.cpp +++ b/tests/auto/qdir/tst_qdir.cpp @@ -1133,6 +1133,11 @@ void tst_QDir::absolutePath_data() QTest::newRow("4") << "c:/machine/share/dir1" << "c:/machine/share/dir1"; QTest::newRow("5") << "c:\\machine\\share\\dir1" << "c:/machine/share/dir1"; #endif + //test dirty paths are cleaned (QTBUG-19995) + QTest::newRow("/home/qt/.") << QDir::rootPath() + "home/qt/." << QDir::rootPath() + "home/qt"; + QTest::newRow("/system/data/../config") << QDir::rootPath() + "system/data/../config" << QDir::rootPath() + "system/config"; + QTest::newRow("//home//qt/") << QDir::rootPath() + "/home//qt/" << QDir::rootPath() + "home/qt"; + QTest::newRow("foo/../bar") << "foo/../bar" << QDir::currentPath() + "/bar"; QTest::newRow("resource") << ":/prefix/foo.bar" << ":/prefix/foo.bar"; } @@ -1942,6 +1947,14 @@ void tst_QDir::equalityOperator_data() << "./entrylist" << "*.cpp" << int(QDir::Name) << int(QDir::Files) << true; + QTest::newRow("QTBUG-20495") << QDir::currentPath() + "/entrylist/.." << "*.cpp" << int(QDir::Name) << int(QDir::Files) + << "." << "*.cpp" << int(QDir::Name) << int(QDir::Files) + << true; + + QTest::newRow("QTBUG-20495-root") << QDir::rootPath() + "tmp/.." << "*.cpp" << int(QDir::Name) << int(QDir::Files) + << QDir::rootPath() << "*.cpp" << int(QDir::Name) << int(QDir::Files) + << true; + QTest::newRow("diff-filters") << SRCDIR << "*.cpp" << int(QDir::Name) << int(QDir::Files) << SRCDIR << "*.cpp" << int(QDir::Name) << int(QDir::Dirs) << false; diff --git a/tests/auto/qfilesystementry/tst_qfilesystementry.cpp b/tests/auto/qfilesystementry/tst_qfilesystementry.cpp index 016bcbf..2daabee 100644 --- a/tests/auto/qfilesystementry/tst_qfilesystementry.cpp +++ b/tests/auto/qfilesystementry/tst_qfilesystementry.cpp @@ -68,6 +68,8 @@ private slots: void absoluteOrRelative_data(); void absoluteOrRelative(); #endif + void isClean_data(); + void isClean(); }; #if defined(WIN_STUFF) @@ -383,5 +385,35 @@ void tst_QFileSystemEntry::absoluteOrRelative() } #endif +void tst_QFileSystemEntry::isClean_data() +{ + QTest::addColumn("path"); + QTest::addColumn("isClean"); + + QTest::newRow("simple") << "foo" << true; + QTest::newRow("complex") << "/foo/bar/bz" << true; + QTest::newRow(".file") << "/foo/.file" << true; + QTest::newRow("..file") << "/foo/..file" << true; + QTest::newRow("...") << "/foo/.../bar" << true; + QTest::newRow("./") << "./" << false; + QTest::newRow("../") << "../" << false; + QTest::newRow(".") << "." << false; + QTest::newRow("..") << ".." << false; + QTest::newRow("/.") << "/." << false; + QTest::newRow("/..") << "/.." << false; + QTest::newRow("/../") << "foo/../bar" << false; + QTest::newRow("/./") << "foo/./bar" << false; + QTest::newRow("//") << "foo//bar" << false; +} + +void tst_QFileSystemEntry::isClean() +{ + QFETCH(QString, path); + QFETCH(bool, isClean); + + QFileSystemEntry fi(path); + QCOMPARE(fi.isClean(), isClean); +} + QTEST_MAIN(tst_QFileSystemEntry) #include -- cgit v0.12 From 220048de8130bbe6059af0a05c7328ae0048bf42 Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Fri, 2 Sep 2011 14:50:12 +0200 Subject: Fix assert error on Windows with a negative char. Reviewed-by: Denis Dzyubenko Fixes: QTBUG-20228 --- tools/qdoc3/cppcodemarker.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp index 2067716..9af7b9e 100644 --- a/tools/qdoc3/cppcodemarker.cpp +++ b/tools/qdoc3/cppcodemarker.cpp @@ -947,13 +947,13 @@ QString CppCodeMarker::addMarkUp(const QString &in, QString tag; bool target = false; - if (isalpha(ch) || ch == '_') { + if (isalpha((unsigned char) ch) || ch == '_') { QString ident; do { ident += ch; finish = i; readChar(); - } while (ch >= 0 && isalnum(ch) || ch == '_'); + } while (isalnum((unsigned char) ch) || ch == '_'); if (classRegExp.exactMatch(ident)) { tag = QLatin1String("type"); @@ -970,11 +970,11 @@ QString CppCodeMarker::addMarkUp(const QString &in, tag = QLatin1String("func"); target = true; } - } else if (isdigit(ch)) { + } else if (isdigit((unsigned char) ch)) { do { finish = i; readChar(); - } while (isalnum(ch) || ch == '.'); + } while (isalnum((unsigned char) ch) || ch == '.'); tag = QLatin1String("number"); } else { switch (ch) { -- cgit v0.12 From 4a6617b83612d79c8557102c9d313c28aee2aa0e Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 2 Sep 2011 18:39:16 +0100 Subject: Fix compile error on MSVC2008 Change-Id: I4f6192b9db601076688b52bfd794ea80a7346729 Reviewed-on: http://codereview.qt.nokia.com/4153 Reviewed-by: Qt Sanity Bot Reviewed-by: Prasanth Ullattil --- tests/auto/qfileinfo/tst_qfileinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp index c7d9979..4e4b92d 100644 --- a/tests/auto/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp @@ -1395,7 +1395,7 @@ void tst_QFileInfo::ntfsJunctionPointsAndSymlinks_data() wchar_t errstr[0x100]; DWORD count = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, 0, err, 0, errstr, 0x100, 0); - QString error(QString::fromUtf16(errstr, count)); + QString error(QString::fromWCharArray (errstr, count)); qWarning() << error; //we need at least one data set for the test not to assert fail when skipping _data function QDir target("target"); -- cgit v0.12 From ef774ee93cb561d072137f2a11c2d347bedf6342 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 2 Sep 2011 18:40:45 +0100 Subject: Restore Qt4.7 behaviour of QFileInfo::absolute(File)Path Many applications relied on the undefined behaviour that the filesystem engines returned clean paths (despite the documentation stating that they may not), and consequently suffered regressions with Qt 4.8. Unix paths are once again cleaned if necessary. Windows/Symbian paths were already cleaned, but now use the utility function to check if a path is dirty, to avoid duplicated code. Task-number: QTBUG-19995 Change-Id: If8c18469f149291c9d079ae3da23bc2087bbd49a Reviewed-on: http://codereview.qt.nokia.com/4154 Reviewed-by: Qt Sanity Bot Reviewed-by: Prasanth Ullattil --- src/corelib/io/qfilesystemengine_symbian.cpp | 4 +--- src/corelib/io/qfilesystemengine_unix.cpp | 2 +- src/corelib/io/qfilesystemengine_win.cpp | 6 +----- tests/auto/qfileinfo/tst_qfileinfo.cpp | 10 +++++++++- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/corelib/io/qfilesystemengine_symbian.cpp b/src/corelib/io/qfilesystemengine_symbian.cpp index 18c52cb..c8c1dfd 100644 --- a/src/corelib/io/qfilesystemengine_symbian.cpp +++ b/src/corelib/io/qfilesystemengine_symbian.cpp @@ -114,9 +114,7 @@ QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry) { QString orig = entry.filePath(); const bool isAbsolute = entry.isAbsolute(); - const bool isDirty = (orig.contains(QLatin1String("/../")) || orig.contains(QLatin1String("/./")) || - orig.contains(QLatin1String("//")) || - orig.endsWith(QLatin1String("/..")) || orig.endsWith(QLatin1String("/."))); + const bool isDirty = !entry.isClean(); if (isAbsolute && !isDirty) return entry; diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index b0ebfbd..cfb17de 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -223,7 +223,7 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry, //static QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry) { - if (entry.isAbsolute()) + if (entry.isAbsolute() && entry.isClean()) return entry; QByteArray orig = entry.nativeFilePath(); diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index 764ee6d..031d64b 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -508,11 +508,7 @@ QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry) if (!entry.isRelative()) { #if !defined(Q_OS_WINCE) - if (entry.isAbsolute() - && !entry.filePath().contains(QLatin1String("/../")) - && !entry.filePath().contains(QLatin1String("/./")) - && !entry.filePath().endsWith(QLatin1String("/..")) - && !entry.filePath().endsWith(QLatin1String("/."))) { + if (entry.isAbsolute() && entry.isClean()) { ret = entry.filePath(); } else { ret = QDir::fromNativeSeparators(nativeAbsoluteFilePath(entry.filePath())); diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp index 4e4b92d..d7d57f6 100644 --- a/tests/auto/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp @@ -482,6 +482,11 @@ void tst_QFileInfo::absolutePath_data() QTest::newRow("c:\\autoexec.bat") << "c:\\autoexec.bat" << "C:/" << "autoexec.bat"; #endif + QTest::newRow("QTBUG-19995.1") << drivePrefix + "/System/Library/StartupItems/../Frameworks" + << drivePrefix + "/System/Library" + << "Frameworks"; + QTest::newRow("QTBUG-19995.2") << drivePrefix + "/System/Library/StartupItems/../Frameworks/" + << drivePrefix + "/System/Library/Frameworks" << ""; } void tst_QFileInfo::absolutePath() @@ -503,6 +508,7 @@ void tst_QFileInfo::absFilePath_data() QTest::newRow("relativeFile") << "tmp.txt" << QDir::currentPath() + "/tmp.txt"; QTest::newRow("relativeFileInSubDir") << "temp/tmp.txt" << QDir::currentPath() + "/" + "temp/tmp.txt"; + QString drivePrefix; #if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN) QString curr = QDir::currentPath(); @@ -511,7 +517,7 @@ void tst_QFileInfo::absFilePath_data() QTest::newRow("absFilePath") << "c:\\home\\andy\\tmp.txt" << "C:/home/andy/tmp.txt"; // Make sure drive-relative paths return correct absolute paths (task 255326) - QString drivePrefix = QDir::currentPath().left(2); + drivePrefix = QDir::currentPath().left(2); QString nonCurrentDrivePrefix = drivePrefix.left(1).compare("X", Qt::CaseInsensitive) == 0 ? QString("Y:") : QString("X:"); @@ -521,6 +527,8 @@ void tst_QFileInfo::absFilePath_data() #else QTest::newRow("absFilePath") << "/home/andy/tmp.txt" << "/home/andy/tmp.txt"; #endif + QTest::newRow("QTBUG-19995") << drivePrefix + "/System/Library/StartupItems/../Frameworks" + << drivePrefix + "/System/Library/Frameworks"; } void tst_QFileInfo::absFilePath() -- cgit v0.12 From 85cd78b01812d108f381e42b044abaa888c4146e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 5 Sep 2011 17:24:07 +0200 Subject: remove obsolete define --- src/plugins/bearer/corewlan/corewlan.pro | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/bearer/corewlan/corewlan.pro b/src/plugins/bearer/corewlan/corewlan.pro index 9cb3955..59b1383 100644 --- a/src/plugins/bearer/corewlan/corewlan.pro +++ b/src/plugins/bearer/corewlan/corewlan.pro @@ -7,7 +7,6 @@ LIBS += -framework Foundation -framework SystemConfiguration contains(QT_CONFIG, corewlan) { isEmpty(QMAKE_MAC_SDK)|contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10.6.sdk") { LIBS += -framework CoreWLAN -framework Security - DEFINES += MAC_SDK_10_6 } } -- cgit v0.12 From ce1a25fc692abcaa1c825f465d6a158efa953b06 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 5 Sep 2011 17:23:53 +0200 Subject: Ensure that the corewlan plugin can be built with the Mac OS X 10.7 sdk When the 10.7 SDK was specified explicitly then it would fail the check inside the pro file. So this ensures that this is accounted for. Task-number: QTBUG-20516 Merge-request: 2657 Reviewed-by: ossi --- src/plugins/bearer/corewlan/corewlan.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/bearer/corewlan/corewlan.pro b/src/plugins/bearer/corewlan/corewlan.pro index 59b1383..5d7a795 100644 --- a/src/plugins/bearer/corewlan/corewlan.pro +++ b/src/plugins/bearer/corewlan/corewlan.pro @@ -5,7 +5,7 @@ QT = core network LIBS += -framework Foundation -framework SystemConfiguration contains(QT_CONFIG, corewlan) { - isEmpty(QMAKE_MAC_SDK)|contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10.6.sdk") { + isEmpty(QMAKE_MAC_SDK)|contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10\.[67]\.sdk") { LIBS += -framework CoreWLAN -framework Security } } -- cgit v0.12 From 9c86b3b0028d79cbca129afafa33d72d624d65c3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 5 Sep 2011 17:33:33 +0200 Subject: fix doc typo --- src/corelib/global/qnamespace.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index eabaf10..99f82fa 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2544,7 +2544,7 @@ will imply to use the layout direction set on the parent widget or QApplication. This has the same effect as QWidget::unsetLayoutDirection(). - When LayoutDirectoinAuto is used in conjunction with text layouting, it will imply that the text + When LayoutDirectionAuto is used in conjunction with text layouting, it will imply that the text directionality is determined from the content of the string to be layouted. \sa QApplication::setLayoutDirection(), QWidget::setLayoutDirection(), QTextOption::setTextDirection(), QString::isRightToLeft() -- cgit v0.12 From ff10b5288c18981c672429518d986d883626a2ef Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 6 Sep 2011 12:52:23 +1000 Subject: Fix typo in header guard. Task-number: QTBUG-21210 --- src/testlib/qtestxmlstreamer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testlib/qtestxmlstreamer.h b/src/testlib/qtestxmlstreamer.h index 46318a9..d4a9079 100644 --- a/src/testlib/qtestxmlstreamer.h +++ b/src/testlib/qtestxmlstreamer.h @@ -40,7 +40,7 @@ ****************************************************************************/ #ifndef QTESTXMLSTREAMER_H -#define QTESXMLSTREAMER_H +#define QTESTXMLSTREAMER_H #include -- cgit v0.12 From 64adbd0c5775f97343afbe0e7b5fde0d70bdaedd Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Mon, 5 Sep 2011 12:53:49 +0200 Subject: QSslCertificate: block all DigiNotar (intermediate and root) certs and do not only check leaf certificates, but all intermediates and the root. Tested manually with the cross-signed intermediates. Reviewed-by: Richard J. Moore --- src/network/ssl/qsslcertificate.cpp | 27 +++++++++++++++++++++++++-- src/network/ssl/qsslsocket_openssl.cpp | 15 +++++++++------ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index ab09932..2a2ad55 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -792,15 +792,38 @@ static const char *certificate_blacklist[] = { "92:39:d5:34:8f:40:d1:69:5a:74:54:70:e1:f2:3f:43", "addons.mozilla.org", // Comodo "b0:b7:13:3e:d0:96:f9:b5:6f:ae:91:c8:74:bd:3a:c0", "login.live.com", // Comodo "d8:f3:5f:4e:b7:87:2b:2d:ab:06:92:e3:15:38:2f:b0", "global trustee", // Comodo - "05:e2:e6:a4:cd:09:ea:54:d6:65:b0:75:fe:22:a2:56", "*.google.com", // DigiNotar + + "05:e2:e6:a4:cd:09:ea:54:d6:65:b0:75:fe:22:a2:56", "*.google.com", // leaf certificate issued by DigiNotar + "0c:76:da:9c:91:0c:4e:2c:9e:fe:15:d0:58:93:3c:4c", "DigiNotar Root CA", // DigiNotar root + "f1:4a:13:f4:87:2b:56:dc:39:df:84:ca:7a:a1:06:49", "DigiNotar Services CA", // DigiNotar intermediate signed by DigiNotar Root + "36:16:71:55:43:42:1b:9d:e6:cb:a3:64:41:df:24:38", "DigiNotar Services 1024 CA", // DigiNotar intermediate signed by DigiNotar Root + "0a:82:bd:1e:14:4e:88:14:d7:5b:1a:55:27:be:bf:3e", "DigiNotar Root CA G2", // other DigiNotar Root CA + "a4:b6:ce:e3:2e:d3:35:46:26:3c:b3:55:3a:a8:92:21", "CertiID Enterprise Certificate Authority", // DigiNotar intermediate signed by "DigiNotar Root CA G2" + "5b:d5:60:9c:64:17:68:cf:21:0e:35:fd:fb:05:ad:41", "DigiNotar Qualified CA", // DigiNotar intermediate signed by DigiNotar Root + + "1184640176", "DigiNotar Services 1024 CA", // DigiNotar intermediate cross-signed by Entrust + "120000525", "DigiNotar Cyber CA", // DigiNotar intermediate cross-signed by CyberTrust + "120000505", "DigiNotar Cyber CA", // DigiNotar intermediate cross-signed by CyberTrust + "120000515", "DigiNotar Cyber CA", // DigiNotar intermediate cross-signed by CyberTrust + "20015536", "DigiNotar PKIoverheid CA Overheid en Bedrijven", // DigiNotar intermediate cross-signed by the Dutch government + "20001983", "DigiNotar PKIoverheid CA Organisatie - G2", // DigiNotar intermediate cross-signed by the Dutch government + "d6:d0:29:77:f1:49:fd:1a:83:f2:b9:ea:94:8c:5c:b4", "DigiNotar Extended Validation CA", // DigiNotar intermediate signed by DigiNotar EV Root + "1e:7d:7a:53:3d:45:30:41:96:40:0f:71:48:1f:45:04", "DigiNotar Public CA 2025", // DigiNotar intermediate +// "(has not been seen in the wild so far)", "DigiNotar Public CA - G2", // DigiNotar intermediate +// "(has not been seen in the wild so far)", "Koninklijke Notariele Beroepsorganisatie CA", // compromised during DigiNotar breach +// "(has not been seen in the wild so far)", "Stichting TTP Infos CA," // compromised during DigiNotar breach + "1184640175", "DigiNotar Root CA", // DigiNotar intermediate cross-signed by Entrust + "1184644297", "DigiNotar Root CA", // DigiNotar intermediate cross-signed by Entrust 0 }; bool QSslCertificatePrivate::isBlacklisted(const QSslCertificate &certificate) { for (int a = 0; certificate_blacklist[a] != 0; a++) { + QString blacklistedCommonName = QString::fromUtf8(certificate_blacklist[(a+1)]); if (certificate.serialNumber() == certificate_blacklist[a++] && - certificate.subjectInfo(QSslCertificate::CommonName) == QString::fromUtf8(certificate_blacklist[a])) + (certificate.subjectInfo(QSslCertificate::CommonName) == blacklistedCommonName || + certificate.issuerInfo(QSslCertificate::CommonName) == blacklistedCommonName)) return true; } return false; diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 5a606af..8e53974 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -1246,12 +1246,15 @@ bool QSslSocketBackendPrivate::startHandshake() // Start translating errors. QList errors; - if (QSslCertificatePrivate::isBlacklisted(configuration.peerCertificate)) { - QSslError error(QSslError::CertificateBlacklisted, configuration.peerCertificate); - errors << error; - emit q->peerVerifyError(error); - if (q->state() != QAbstractSocket::ConnectedState) - return false; + // check the whole chain for blacklisting (including root, as we check for subjectInfo and issuer) + foreach (const QSslCertificate &cert, configuration.peerCertificateChain) { + if (QSslCertificatePrivate::isBlacklisted(cert)) { + QSslError error(QSslError::CertificateBlacklisted, cert); + errors << error; + emit q->peerVerifyError(error); + if (q->state() != QAbstractSocket::ConnectedState) + return false; + } } bool doVerifyPeer = configuration.peerVerifyMode == QSslSocket::VerifyPeer -- cgit v0.12 From b694d43c5fb4abe41907f38557323446d1e3effb Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Tue, 30 Aug 2011 13:10:06 +0200 Subject: QSslCertificate: also check common name for blacklisted certificates ... to reduce the possibility of blacklisting valid certificates that happen to have the same serial number as a blacklisted one, which is unlikely, but possible. Reviewed-by: Richard J. Moore --- src/network/ssl/qsslcertificate.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index be3276d..9c56525 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -803,23 +803,24 @@ QList QSslCertificatePrivate::certificatesFromDer(const QByteAr // These certificates are known to be fraudulent and were created during the comodo // compromise. See http://www.comodo.com/Comodo-Fraud-Incident-2011-03-23.html static const char *certificate_blacklist[] = { - "04:7e:cb:e9:fc:a5:5f:7b:d0:9e:ae:36:e1:0c:ae:1e", - "f5:c8:6a:f3:61:62:f1:3a:64:f5:4f:6d:c9:58:7c:06", - "d7:55:8f:da:f5:f1:10:5b:b2:13:28:2b:70:77:29:a3", - "39:2a:43:4f:0e:07:df:1f:8a:a3:05:de:34:e0:c2:29", - "3e:75:ce:d4:6b:69:30:21:21:88:30:ae:86:a8:2a:71", - "e9:02:8b:95:78:e4:15:dc:1a:71:0a:2b:88:15:44:47", - "92:39:d5:34:8f:40:d1:69:5a:74:54:70:e1:f2:3f:43", - "b0:b7:13:3e:d0:96:f9:b5:6f:ae:91:c8:74:bd:3a:c0", - "d8:f3:5f:4e:b7:87:2b:2d:ab:06:92:e3:15:38:2f:b0", - "05:e2:e6:a4:cd:09:ea:54:d6:65:b0:75:fe:22:a2:56", + "04:7e:cb:e9:fc:a5:5f:7b:d0:9e:ae:36:e1:0c:ae:1e", "mail.google.com", // Comodo + "f5:c8:6a:f3:61:62:f1:3a:64:f5:4f:6d:c9:58:7c:06", "www.google.com", // Comodo + "d7:55:8f:da:f5:f1:10:5b:b2:13:28:2b:70:77:29:a3", "login.yahoo.com", // Comodo + "39:2a:43:4f:0e:07:df:1f:8a:a3:05:de:34:e0:c2:29", "login.yahoo.com", // Comodo + "3e:75:ce:d4:6b:69:30:21:21:88:30:ae:86:a8:2a:71", "login.yahoo.com", // Comodo + "e9:02:8b:95:78:e4:15:dc:1a:71:0a:2b:88:15:44:47", "login.skype.com", // Comodo + "92:39:d5:34:8f:40:d1:69:5a:74:54:70:e1:f2:3f:43", "addons.mozilla.org", // Comodo + "b0:b7:13:3e:d0:96:f9:b5:6f:ae:91:c8:74:bd:3a:c0", "login.live.com", // Comodo + "d8:f3:5f:4e:b7:87:2b:2d:ab:06:92:e3:15:38:2f:b0", "global trustee", // Comodo + "05:e2:e6:a4:cd:09:ea:54:d6:65:b0:75:fe:22:a2:56", "*.google.com", // DigiNotar 0 }; bool QSslCertificatePrivate::isBlacklisted(const QSslCertificate &certificate) { for (int a = 0; certificate_blacklist[a] != 0; a++) { - if (certificate.serialNumber() == certificate_blacklist[a]) + if (certificate.serialNumber() == certificate_blacklist[a++] && + certificate.subjectInfo(QSslCertificate::CommonName) == QString::fromUtf8(certificate_blacklist[a])) return true; } return false; -- cgit v0.12 From 7d857bee73c9e81da203543a132b5b836853b797 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Mon, 5 Sep 2011 12:53:49 +0200 Subject: QSslCertificate: block all DigiNotar (intermediate and root) certs and do not only check leaf certificates, but all intermediates and the root. Tested manually with the cross-signed intermediates. Reviewed-by: Richard J. Moore --- src/network/ssl/qsslcertificate.cpp | 27 +++++++++++++++++++++++++-- src/network/ssl/qsslsocket_openssl.cpp | 16 ++++++++++------ 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index 9c56525..1ae98f4 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -812,15 +812,38 @@ static const char *certificate_blacklist[] = { "92:39:d5:34:8f:40:d1:69:5a:74:54:70:e1:f2:3f:43", "addons.mozilla.org", // Comodo "b0:b7:13:3e:d0:96:f9:b5:6f:ae:91:c8:74:bd:3a:c0", "login.live.com", // Comodo "d8:f3:5f:4e:b7:87:2b:2d:ab:06:92:e3:15:38:2f:b0", "global trustee", // Comodo - "05:e2:e6:a4:cd:09:ea:54:d6:65:b0:75:fe:22:a2:56", "*.google.com", // DigiNotar + + "05:e2:e6:a4:cd:09:ea:54:d6:65:b0:75:fe:22:a2:56", "*.google.com", // leaf certificate issued by DigiNotar + "0c:76:da:9c:91:0c:4e:2c:9e:fe:15:d0:58:93:3c:4c", "DigiNotar Root CA", // DigiNotar root + "f1:4a:13:f4:87:2b:56:dc:39:df:84:ca:7a:a1:06:49", "DigiNotar Services CA", // DigiNotar intermediate signed by DigiNotar Root + "36:16:71:55:43:42:1b:9d:e6:cb:a3:64:41:df:24:38", "DigiNotar Services 1024 CA", // DigiNotar intermediate signed by DigiNotar Root + "0a:82:bd:1e:14:4e:88:14:d7:5b:1a:55:27:be:bf:3e", "DigiNotar Root CA G2", // other DigiNotar Root CA + "a4:b6:ce:e3:2e:d3:35:46:26:3c:b3:55:3a:a8:92:21", "CertiID Enterprise Certificate Authority", // DigiNotar intermediate signed by "DigiNotar Root CA G2" + "5b:d5:60:9c:64:17:68:cf:21:0e:35:fd:fb:05:ad:41", "DigiNotar Qualified CA", // DigiNotar intermediate signed by DigiNotar Root + + "1184640176", "DigiNotar Services 1024 CA", // DigiNotar intermediate cross-signed by Entrust + "120000525", "DigiNotar Cyber CA", // DigiNotar intermediate cross-signed by CyberTrust + "120000505", "DigiNotar Cyber CA", // DigiNotar intermediate cross-signed by CyberTrust + "120000515", "DigiNotar Cyber CA", // DigiNotar intermediate cross-signed by CyberTrust + "20015536", "DigiNotar PKIoverheid CA Overheid en Bedrijven", // DigiNotar intermediate cross-signed by the Dutch government + "20001983", "DigiNotar PKIoverheid CA Organisatie - G2", // DigiNotar intermediate cross-signed by the Dutch government + "d6:d0:29:77:f1:49:fd:1a:83:f2:b9:ea:94:8c:5c:b4", "DigiNotar Extended Validation CA", // DigiNotar intermediate signed by DigiNotar EV Root + "1e:7d:7a:53:3d:45:30:41:96:40:0f:71:48:1f:45:04", "DigiNotar Public CA 2025", // DigiNotar intermediate +// "(has not been seen in the wild so far)", "DigiNotar Public CA - G2", // DigiNotar intermediate +// "(has not been seen in the wild so far)", "Koninklijke Notariele Beroepsorganisatie CA", // compromised during DigiNotar breach +// "(has not been seen in the wild so far)", "Stichting TTP Infos CA," // compromised during DigiNotar breach + "1184640175", "DigiNotar Root CA", // DigiNotar intermediate cross-signed by Entrust + "1184644297", "DigiNotar Root CA", // DigiNotar intermediate cross-signed by Entrust 0 }; bool QSslCertificatePrivate::isBlacklisted(const QSslCertificate &certificate) { for (int a = 0; certificate_blacklist[a] != 0; a++) { + QString blacklistedCommonName = QString::fromUtf8(certificate_blacklist[(a+1)]); if (certificate.serialNumber() == certificate_blacklist[a++] && - certificate.subjectInfo(QSslCertificate::CommonName) == QString::fromUtf8(certificate_blacklist[a])) + (certificate.subjectInfo(QSslCertificate::CommonName) == blacklistedCommonName || + certificate.issuerInfo(QSslCertificate::CommonName) == blacklistedCommonName)) return true; } return false; diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 141d80a..b8e6c4c 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -1193,12 +1193,16 @@ bool QSslSocketBackendPrivate::startHandshake() X509 *x509 = q_SSL_get_peer_certificate(ssl); configuration.peerCertificate = QSslCertificatePrivate::QSslCertificate_from_X509(x509); q_X509_free(x509); - if (QSslCertificatePrivate::isBlacklisted(configuration.peerCertificate)) { - q->setErrorString(QSslSocket::tr("The peer certificate is blacklisted")); - q->setSocketError(QAbstractSocket::SslHandshakeFailedError); - emit q->error(QAbstractSocket::SslHandshakeFailedError); - plainSocket->disconnectFromHost(); - return false; + + // check the whole chain for blacklisting (including root, as we check for subjectInfo and issuer) + foreach (const QSslCertificate &cert, configuration.peerCertificateChain) { + if (QSslCertificatePrivate::isBlacklisted(cert)) { + q->setErrorString(QSslSocket::tr("The peer certificate is blacklisted")); + q->setSocketError(QAbstractSocket::SslHandshakeFailedError); + emit q->error(QAbstractSocket::SslHandshakeFailedError); + plainSocket->disconnectFromHost(); + return false; + } } // Start translating errors. -- cgit v0.12 From 50af55095afe1ba048dde357b771485ef2188778 Mon Sep 17 00:00:00 2001 From: suzuki toshiya Date: Wed, 7 Sep 2011 11:58:54 +0200 Subject: Replace explicit surrogate handlers by inline methods of QChar class Merge-request: 1284 Reviewed-by: Oswald Buddenhagen --- src/corelib/codecs/qutfcodec.cpp | 8 ++++---- src/gui/kernel/qkeysequence.cpp | 16 ++++++++-------- src/gui/text/qfontengine.cpp | 3 +-- src/gui/text/qfontengine_ft.cpp | 13 +++++-------- src/gui/text/qfontengine_mac.mm | 23 ++++++++--------------- src/gui/text/qfontengine_qpa.cpp | 13 +++++-------- src/gui/text/qfontengine_qpf.cpp | 13 +++++-------- src/gui/text/qfontengine_qws.cpp | 13 +++++-------- src/gui/text/qfontengine_s60.cpp | 13 +++++-------- src/gui/text/qfontengine_win.cpp | 13 +++++-------- src/gui/text/qfontengine_x11.cpp | 4 +--- src/gui/text/qfontenginedirectwrite.cpp | 13 +++++-------- src/gui/text/qtextcursor.cpp | 4 ++-- src/gui/text/qtextengine.cpp | 3 +-- src/gui/text/qtexthtmlparser.cpp | 12 ++++-------- src/gui/widgets/qlinecontrol.cpp | 6 ++---- src/plugins/codecs/cn/qgb18030codec.cpp | 14 +++++++------- 17 files changed, 73 insertions(+), 111 deletions(-) diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp index f59f404..aaebec3 100644 --- a/src/corelib/codecs/qutfcodec.cpp +++ b/src/corelib/codecs/qutfcodec.cpp @@ -90,8 +90,8 @@ QByteArray QUtf8::convertFromUnicode(const QChar *uc, int len, QTextCodec::Conve while (ch < end) { uint u = ch->unicode(); if (surrogate_high >= 0) { - if (u >= 0xdc00 && u < 0xe000) { - u = (surrogate_high - 0xd800)*0x400 + (u - 0xdc00) + 0x10000; + if (ch->isLowSurrogate()) { + u = QChar::surrogateToUcs4(surrogate_high, u); surrogate_high = -1; } else { // high surrogate without low @@ -101,13 +101,13 @@ QByteArray QUtf8::convertFromUnicode(const QChar *uc, int len, QTextCodec::Conve surrogate_high = -1; continue; } - } else if (u >= 0xdc00 && u < 0xe000) { + } else if (ch->isLowSurrogate()) { // low surrogate without high *cursor = replacement; ++ch; ++invalid; continue; - } else if (u >= 0xd800 && u < 0xdc00) { + } else if (ch->isHighSurrogate()) { surrogate_high = u; ++ch; continue; diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index 117b72f..2350f16 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -1381,11 +1381,11 @@ QString QKeySequencePrivate::encodeString(int key, QKeySequence::SequenceFormat QString p; if (key && key < Qt::Key_Escape && key != Qt::Key_Space) { - if (key < 0x10000) { - p = QChar(key & 0xffff).toUpper(); + if (!QChar::requiresSurrogates(key)) { + p = QChar(ushort(key)).toUpper(); } else { - p = QChar((key-0x10000)/0x400+0xd800); - p += QChar((key-0x10000)%400+0xdc00); + p += QChar(QChar::highSurrogate(key)); + p += QChar(QChar::lowSurrogate(key)); } } else if (key >= Qt::Key_F1 && key <= Qt::Key_F35) { p = nativeText ? QShortcut::tr("F%1").arg(key - Qt::Key_F1 + 1) @@ -1418,11 +1418,11 @@ NonSymbol: // Or else characters like Qt::Key_aring may not get displayed // (Really depends on you locale) if (!keyname[i].name) { - if (key < 0x10000) { - p = QChar(key & 0xffff).toUpper(); + if (!QChar::requiresSurrogates(key)) { + p = QChar(ushort(key)).toUpper(); } else { - p = QChar((key-0x10000)/0x400+0xd800); - p += QChar((key-0x10000)%400+0xdc00); + p += QChar(QChar::highSurrogate(key)); + p += QChar(QChar::lowSurrogate(key)); } } } diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index dec0982..b4c58b5 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -1335,8 +1335,7 @@ bool QFontEngineMulti::stringToCMap(const QChar *str, int len, int glyph_pos = 0; for (int i = 0; i < len; ++i) { - bool surrogate = (str[i].unicode() >= 0xd800 && str[i].unicode() < 0xdc00 && i < len-1 - && str[i+1].unicode() >= 0xdc00 && str[i+1].unicode() < 0xe000); + bool surrogate = (str[i].isHighSurrogate() && i < len-1 && str[i+1].isLowSurrogate()); if (glyphs->glyphs[glyph_pos] == 0 && str[i].category() != QChar::Separator_Line) { QGlyphLayoutInstance tmp = glyphs->instance(glyph_pos); diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 9a5d9d6..b7d1e5d 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1418,15 +1418,12 @@ void QFontEngineFT::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_me static inline unsigned int getChar(const QChar *str, int &i, const int len) { - unsigned int uc = str[i].unicode(); - if (uc >= 0xd800 && uc < 0xdc00 && i < len-1) { - uint low = str[i+1].unicode(); - if (low >= 0xdc00 && low < 0xe000) { - uc = (uc - 0xd800)*0x400 + (low - 0xdc00) + 0x10000; - ++i; - } + uint ucs4 = str[i].unicode(); + if (str[i].isHighSurrogate() && i < len-1 && str[i+1].isLowSurrogate()) { + ++i; + ucs4 = QChar::surrogateToUcs4(ucs4, str[i].unicode()); } - return uc; + return ucs4; } bool QFontEngineFT::canRender(const QChar *string, int len) diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm index 9d9eaed..6186b2f 100644 --- a/src/gui/text/qfontengine_mac.mm +++ b/src/gui/text/qfontengine_mac.mm @@ -257,10 +257,8 @@ static OSStatus atsuPostLayoutCallback(ATSULayoutOperationSelector selector, ATS #if !defined(QT_NO_DEBUG) int surrogates = 0; const QChar *str = item->string; - for (int i = item->from; i < item->from + item->length - 1; ++i) { - surrogates += (str[i].unicode() >= 0xd800 && str[i].unicode() < 0xdc00 - && str[i+1].unicode() >= 0xdc00 && str[i+1].unicode() < 0xe000); - } + for (int i = item->from; i < item->from + item->length - 1; ++i) + surrogates += (str[i].isHighSurrogate() && str[i+1].isLowSurrogate()); #endif for (nextCharStop = item->from; nextCharStop < item->from + item->length; ++nextCharStop) if (item->charAttributes[nextCharStop].charStop) @@ -328,10 +326,8 @@ static OSStatus atsuPostLayoutCallback(ATSULayoutOperationSelector selector, ATS if (charOffset < item->length - 1) { QChar current = item->string[item->from + charOffset]; QChar next = item->string[item->from + charOffset + 1]; - if (current.unicode() >= 0xd800 && current.unicode() < 0xdc00 - && next.unicode() >= 0xdc00 && next.unicode() < 0xe000) { + if (current.isHighSurrogate() && next.isLowSurrogate()) item->log_clusters[charOffset + 1] = currentClusterGlyph; - } } } } @@ -738,15 +734,12 @@ QFontEngineMac::~QFontEngineMac() static inline unsigned int getChar(const QChar *str, int &i, const int len) { - unsigned int uc = str[i].unicode(); - if (uc >= 0xd800 && uc < 0xdc00 && i < len-1) { - uint low = str[i+1].unicode(); - if (low >= 0xdc00 && low < 0xe000) { - uc = (uc - 0xd800)*0x400 + (low - 0xdc00) + 0x10000; - ++i; - } + uint ucs4 = str[i].unicode(); + if (str[i].isHighSurrogate() && i < len-1 && str[i+1].isLowSurrogate()) { + ++i; + ucs4 = QChar::surrogateToUcs4(ucs4, str[i].unicode()); } - return uc; + return ucs4; } // Not used directly for shaping, only used to calculate m_averageCharWidth diff --git a/src/gui/text/qfontengine_qpa.cpp b/src/gui/text/qfontengine_qpa.cpp index cb1e7d6..c829c2f 100644 --- a/src/gui/text/qfontengine_qpa.cpp +++ b/src/gui/text/qfontengine_qpa.cpp @@ -226,15 +226,12 @@ QVariant QFontEngineQPA::extractHeaderField(const uchar *data, HeaderTag request static inline unsigned int getChar(const QChar *str, int &i, const int len) { - unsigned int uc = str[i].unicode(); - if (uc >= 0xd800 && uc < 0xdc00 && i < len-1) { - uint low = str[i+1].unicode(); - if (low >= 0xdc00 && low < 0xe000) { - uc = (uc - 0xd800)*0x400 + (low - 0xdc00) + 0x10000; - ++i; - } + uint ucs4 = str[i].unicode(); + if (str[i].isHighSurrogate() && i < len-1 && str[i+1].isLowSurrogate()) { + ++i; + ucs4 = QChar::surrogateToUcs4(ucs4, str[i].unicode()); } - return uc; + return ucs4; } QFontEngineQPA::QFontEngineQPA(const QFontDef &def, const QByteArray &data) diff --git a/src/gui/text/qfontengine_qpf.cpp b/src/gui/text/qfontengine_qpf.cpp index 30a1623..3db5ce1 100644 --- a/src/gui/text/qfontengine_qpf.cpp +++ b/src/gui/text/qfontengine_qpf.cpp @@ -278,15 +278,12 @@ QList QFontEngineQPF::cleanUpAfterClientCrash(const QList &cras static inline unsigned int getChar(const QChar *str, int &i, const int len) { - unsigned int uc = str[i].unicode(); - if (uc >= 0xd800 && uc < 0xdc00 && i < len-1) { - uint low = str[i+1].unicode(); - if (low >= 0xdc00 && low < 0xe000) { - uc = (uc - 0xd800)*0x400 + (low - 0xdc00) + 0x10000; - ++i; - } + uint ucs4 = str[i].unicode(); + if (str[i].isHighSurrogate() && i < len-1 && str[i+1].isLowSurrogate()) { + ++i; + ucs4 = QChar::surrogateToUcs4(ucs4, str[i].unicode()); } - return uc; + return ucs4; } #ifdef QT_FONTS_ARE_RESOURCES QFontEngineQPF::QFontEngineQPF(const QFontDef &def, const uchar *bytes, int size) diff --git a/src/gui/text/qfontengine_qws.cpp b/src/gui/text/qfontengine_qws.cpp index 237842b..ade283f 100644 --- a/src/gui/text/qfontengine_qws.cpp +++ b/src/gui/text/qfontengine_qws.cpp @@ -83,15 +83,12 @@ QT_BEGIN_NAMESPACE static inline unsigned int getChar(const QChar *str, int &i, const int len) { - unsigned int uc = str[i].unicode(); - if (uc >= 0xd800 && uc < 0xdc00 && i < len-1) { - uint low = str[i+1].unicode(); - if (low >= 0xdc00 && low < 0xe000) { - uc = (uc - 0xd800)*0x400 + (low - 0xdc00) + 0x10000; - ++i; - } + uint ucs4 = str[i].unicode(); + if (str[i].isHighSurrogate() && i < len-1 && str[i+1].isLowSurrogate()) { + ++i; + ucs4 = QChar::surrogateToUcs4(ucs4, str[i].unicode()); } - return uc; + return ucs4; } #define FM_SMOOTH 1 diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index b0824cb..203b6e1 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -233,15 +233,12 @@ bool QSymbianTypeFaceExtras::symbianFontTableApiAvailable() // duplicated from qfontengine_xyz.cpp static inline unsigned int getChar(const QChar *str, int &i, const int len) { - unsigned int uc = str[i].unicode(); - if (uc >= 0xd800 && uc < 0xdc00 && i < len-1) { - uint low = str[i+1].unicode(); - if (low >= 0xdc00 && low < 0xe000) { - uc = (uc - 0xd800)*0x400 + (low - 0xdc00) + 0x10000; - ++i; - } + uint ucs4 = str[i].unicode(); + if (str[i].isHighSurrogate() && i < len-1 && str[i+1].isLowSurrogate()) { + ++i; + ucs4 = QChar::surrogateToUcs4(ucs4, str[i].unicode()); } - return uc; + return ucs4; } extern QString qt_symbian_fontNameWithAppFontMarker(const QString &fontName); // qfontdatabase_s60.cpp diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp index aef2145..fc11387 100644 --- a/src/gui/text/qfontengine_win.cpp +++ b/src/gui/text/qfontengine_win.cpp @@ -224,15 +224,12 @@ void QFontEngineWin::getCMap() inline unsigned int getChar(const QChar *str, int &i, const int len) { - unsigned int uc = str[i].unicode(); - if (uc >= 0xd800 && uc < 0xdc00 && i < len-1) { - uint low = str[i+1].unicode(); - if (low >= 0xdc00 && low < 0xe000) { - uc = (uc - 0xd800)*0x400 + (low - 0xdc00) + 0x10000; - ++i; - } + uint ucs4 = str[i].unicode(); + if (str[i].isHighSurrogate() && i < len-1 && str[i+1].isLowSurrogate()) { + ++i; + ucs4 = QChar::surrogateToUcs4(ucs4, str[i].unicode()); } - return uc; + return ucs4; } int QFontEngineWin::getGlyphIndexes(const QChar *str, int numChars, QGlyphLayout *glyphs, bool mirrored) const diff --git a/src/gui/text/qfontengine_x11.cpp b/src/gui/text/qfontengine_x11.cpp index 490866c..6e87f4c 100644 --- a/src/gui/text/qfontengine_x11.cpp +++ b/src/gui/text/qfontengine_x11.cpp @@ -358,9 +358,7 @@ bool QFontEngineXLFD::stringToCMap(const QChar *s, int len, QGlyphLayout *glyphs QVarLengthArray _s(len); QChar *str = (QChar *)_s.data(); for (int i = 0; i < len; ++i) { - if (i < len - 1 - && s[i].unicode() >= 0xd800 && s[i].unicode() < 0xdc00 - && s[i+1].unicode() >= 0xdc00 && s[i].unicode() < 0xe000) { + if (s[i].isHighSurrogate() && i < len-1 && s[i+1].isLowSurrogate()) { *str = QChar(); ++i; } else { diff --git a/src/gui/text/qfontenginedirectwrite.cpp b/src/gui/text/qfontenginedirectwrite.cpp index d693273..5bac117 100644 --- a/src/gui/text/qfontenginedirectwrite.cpp +++ b/src/gui/text/qfontenginedirectwrite.cpp @@ -269,15 +269,12 @@ QFixed QFontEngineDirectWrite::emSquareSize() const inline unsigned int getChar(const QChar *str, int &i, const int len) { - unsigned int uc = str[i].unicode(); - if (uc >= 0xd800 && uc < 0xdc00 && i < len-1) { - uint low = str[i+1].unicode(); - if (low >= 0xdc00 && low < 0xe000) { - uc = (uc - 0xd800)*0x400 + (low - 0xdc00) + 0x10000; - ++i; - } + uint ucs4 = str[i].unicode(); + if (str[i].isHighSurrogate() && i < len-1 && str[i+1].isLowSurrogate()) { + ++i; + ucs4 = QChar::surrogateToUcs4( ucs4, str[i].unicode()); } - return uc; + return ucs4; } bool QFontEngineDirectWrite::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp index 7e7ca6c..acef9fa 100644 --- a/src/gui/text/qtextcursor.cpp +++ b/src/gui/text/qtextcursor.cpp @@ -1511,11 +1511,11 @@ void QTextCursor::deletePreviousChar() const QTextFragmentData * const frag = fragIt.value(); int fpos = fragIt.position(); QChar uc = d->priv->buffer().at(d->anchor - fpos + frag->stringPosition); - if (d->anchor > fpos && uc.unicode() >= 0xdc00 && uc.unicode() < 0xe000) { + if (d->anchor > fpos && uc.isLowSurrogate()) { // second half of a surrogate, check if we have the first half as well, // if yes delete both at once uc = d->priv->buffer().at(d->anchor - 1 - fpos + frag->stringPosition); - if (uc.unicode() >= 0xd800 && uc.unicode() < 0xdc00) + if (uc.isHighSurrogate()) --d->anchor; } diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index aa4a20d..732b821 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -993,8 +993,7 @@ static void heuristicSetGlyphAttributes(const QChar *uc, int length, QGlyphLayou int glyph_pos = 0; for (int i = 0; i < length; i++) { - if (uc[i].unicode() >= 0xd800 && uc[i].unicode() < 0xdc00 && i < length-1 - && uc[i+1].unicode() >= 0xdc00 && uc[i+1].unicode() < 0xe000) { + if (uc[i].isHighSurrogate() && i < length-1 && uc[i+1].isLowSurrogate()) { logClusters[i] = glyph_pos; logClusters[++i] = glyph_pos; } else { diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp index 5b60dfa..d130c61 100644 --- a/src/gui/text/qtexthtmlparser.cpp +++ b/src/gui/text/qtexthtmlparser.cpp @@ -820,15 +820,11 @@ QString QTextHtmlParser::parseEntity() if (uc >= 0x80 && uc < 0x80 + (sizeof(windowsLatin1ExtendedCharacters)/sizeof(windowsLatin1ExtendedCharacters[0]))) uc = windowsLatin1ExtendedCharacters[uc - 0x80]; QString str; - if (uc > 0xffff) { - // surrogate pair - uc -= 0x10000; - ushort high = uc/0x400 + 0xd800; - ushort low = uc%0x400 + 0xdc00; - str.append(QChar(high)); - str.append(QChar(low)); + if (QChar::requiresSurrogates(uc)) { + str += QChar(QChar::highSurrogate(uc)); + str += QChar(QChar::lowSurrogate(uc)); } else { - str.append(QChar(uc)); + str = QChar(uc); } return str; } diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index b6e2f90..873630a 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -198,12 +198,10 @@ void QLineControl::backspace() --m_cursor; if (m_maskData) m_cursor = prevMaskBlank(m_cursor); - QChar uc = m_text.at(m_cursor); - if (m_cursor > 0 && uc.unicode() >= 0xdc00 && uc.unicode() < 0xe000) { + if (m_cursor > 0 && m_text.at(m_cursor).isLowSurrogate()) { // second half of a surrogate, check if we have the first half as well, // if yes delete both at once - uc = m_text.at(m_cursor - 1); - if (uc.unicode() >= 0xd800 && uc.unicode() < 0xdc00) { + if (m_text.at(m_cursor - 1).isHighSurrogate()) { internalDelete(true); --m_cursor; } diff --git a/src/plugins/codecs/cn/qgb18030codec.cpp b/src/plugins/codecs/cn/qgb18030codec.cpp index 0a45eeb..d12f5d9 100644 --- a/src/plugins/codecs/cn/qgb18030codec.cpp +++ b/src/plugins/codecs/cn/qgb18030codec.cpp @@ -108,10 +108,10 @@ QByteArray QGb18030Codec::convertFromUnicode(const QChar *uc, int len, Converter int len; uchar buf[4]; if (high >= 0) { - if (ch >= 0xdc00 && ch < 0xe000) { + if (uc[i].isLowSurrogate()) { // valid surrogate pair ++i; - uint u = (high-0xd800)*0x400+(ch-0xdc00)+0x10000; + uint u = QChar::surrogateToUcs4(high, uc[i].unicode()); len = qt_UnicodeToGb18030(u, buf); if (len >= 2) { for (int j=0; j= 0xd800 && ch < 0xdc00)) { + } else if (uc[i].isHighSurrogate()) { // surrogates area. check for correct encoding // we need at least one more character, first the high surrogate, then the low one high = ch; @@ -181,7 +181,7 @@ QString QGb18030Codec::convertToUnicode(const char* chars, int len, ConverterSta uchar ch = chars[i]; switch (nbuf) { case 0: - if (ch < 0x80) { + if (IsLatin(ch)) { // ASCII resultData[unicodeLen] = ch; ++unicodeLen; @@ -339,7 +339,7 @@ QString QGbkCodec::convertToUnicode(const char* chars, int len, ConverterState * uchar ch = chars[i]; switch (nbuf) { case 0: - if (ch < 0x80) { + if (IsLatin(ch)) { // ASCII resultData[unicodeLen] = ch; ++unicodeLen; @@ -487,7 +487,7 @@ QString QGb2312Codec::convertToUnicode(const char* chars, int len, ConverterStat uchar ch = chars[i]; switch (nbuf) { case 0: - if (ch < 0x80) { + if (IsLatin(ch)) { // ASCII resultData[unicodeLen] = ch; ++unicodeLen; -- cgit v0.12 From ad35d25e78c8252a72108a4ba931934047c4707e Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 6 Sep 2011 16:43:29 +0100 Subject: Merge fixes for QDir::operator== There were two fixes in 4.8 which each fixed a part of the problem. Comparing canonical paths is more correct, but is only possible where both directories exist. If neither directory exists, then compare absolute paths instead. Changed a regression test, because /tmp is a symbolic link on MacOS. I.E. "/tmp/.." is canonically "/private" and not "/" as expected. Task-Number: QTBUG-20495 Reviewed-By: joao --- src/corelib/io/qdir.cpp | 15 +++++++++++++-- tests/auto/qdir/tst_qdir.cpp | 22 +++++++++++++++++++++- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 3271148..9081e31 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -1638,8 +1638,19 @@ bool QDir::operator==(const QDir &dir) const if (d->dirEntry.filePath() == other->dirEntry.filePath()) return true; - // Fallback to expensive canonical path computation - return canonicalPath().compare(dir.canonicalPath(), sensitive) == 0; + if (exists()) { + if (!dir.exists()) + return false; //can't be equal if only one exists + // Both exist, fallback to expensive canonical path computation + return canonicalPath().compare(dir.canonicalPath(), sensitive) == 0; + } else { + if (dir.exists()) + return false; //can't be equal if only one exists + // Neither exists, compare absolute paths rather than canonical (which would be empty strings) + d->resolveAbsoluteEntry(); + other->resolveAbsoluteEntry(); + return d->absoluteDirEntry.filePath().compare(other->absoluteDirEntry.filePath(), sensitive) == 0; + } } return false; } diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp index 7e5ec79..9693480 100644 --- a/tests/auto/qdir/tst_qdir.cpp +++ b/tests/auto/qdir/tst_qdir.cpp @@ -1951,10 +1951,30 @@ void tst_QDir::equalityOperator_data() << "." << "*.cpp" << int(QDir::Name) << int(QDir::Files) << true; - QTest::newRow("QTBUG-20495-root") << QDir::rootPath() + "tmp/.." << "*.cpp" << int(QDir::Name) << int(QDir::Files) + //need a path in the root directory that is unlikely to be a symbolic link. +#if defined (Q_OS_WIN) + QString pathinroot("c:/windows/.."); +#elif defined (Q_OS_SYMBIAN) + QString pathinroot("c:/data/.."); +#else + QString pathinroot("/sbin/.."); +#endif + QTest::newRow("QTBUG-20495-root") << pathinroot << "*.cpp" << int(QDir::Name) << int(QDir::Files) + << QDir::rootPath() << "*.cpp" << int(QDir::Name) << int(QDir::Files) + << true; + + QTest::newRow("slashdot") << QDir::rootPath() + "." << "*.cpp" << int(QDir::Name) << int(QDir::Files) << QDir::rootPath() << "*.cpp" << int(QDir::Name) << int(QDir::Files) << true; + QTest::newRow("slashdotslash") << QDir::rootPath() + "./" << "*.cpp" << int(QDir::Name) << int(QDir::Files) + << QDir::rootPath() << "*.cpp" << int(QDir::Name) << int(QDir::Files) + << true; + + QTest::newRow("nonexistantpaths") << "dir-that-dont-exist" << "*.cpp" << int(QDir::Name) << int(QDir::Files) + << "another-dir-that-dont-exist" << "*.cpp" << int(QDir::Name) << int(QDir::Files) + << false; + QTest::newRow("diff-filters") << SRCDIR << "*.cpp" << int(QDir::Name) << int(QDir::Files) << SRCDIR << "*.cpp" << int(QDir::Name) << int(QDir::Dirs) << false; -- cgit v0.12 From 4aff9e52efc7c6fc6124972efb3b381f85c45e4f Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Wed, 7 Sep 2011 19:51:23 +0200 Subject: QSettings: use the common appdata dir when bootstrapping qmake on win QSystemLibrary doesn't depend on QObject, so nothing could stop us Merge-request: 1341 Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qsettings.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 79b2728..9f9802c 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -66,13 +66,12 @@ #ifndef QT_NO_QOBJECT #include "qcoreapplication.h" +#endif #ifdef Q_OS_WIN // for homedirpath reading from registry #include "qt_windows.h" #include - -#endif // Q_OS_WIN -#endif // QT_NO_QOBJECT +#endif #ifdef Q_OS_VXWORKS # include @@ -1024,9 +1023,6 @@ static QString windowsConfigPath(int type) { QString result; -#ifndef QT_NO_QOBJECT - // We can't use QLibrary if there is QT_NO_QOBJECT is defined - // This only happens when bootstrapping qmake. #ifndef Q_OS_WINCE QSystemLibrary library(QLatin1String("shell32")); #else @@ -1040,8 +1036,6 @@ static QString windowsConfigPath(int type) result = QString::fromWCharArray(path); } -#endif // QT_NO_QOBJECT - if (result.isEmpty()) { switch (type) { #ifndef Q_OS_WINCE -- cgit v0.12 From 38b4b059e83bca2fe82a0826bdf69fd8b02b2827 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Wed, 7 Sep 2011 19:51:24 +0200 Subject: QSettings: don't assume XDG_CONFIG_HOME is latin1-encoded use QFile::decodeName() instead Merge-request: 1341 Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qsettings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 9f9802c..547bbeb 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -1108,11 +1108,11 @@ static void initDefaultPaths(QMutexLocker *locker) userPath += QLatin1String(".config"); #endif } else if (*env == '/') { - userPath = QLatin1String(env); + userPath = QFile::decodeName(env); } else { userPath = homePath; userPath += QLatin1Char('/'); - userPath += QLatin1String(env); + userPath += QFile::decodeName(env); } userPath += QLatin1Char('/'); -- cgit v0.12 From b3de52be29a54aa23a446c7689a48f73206a7cbc Mon Sep 17 00:00:00 2001 From: Markku Heikkila Date: Wed, 7 Sep 2011 20:08:34 +0200 Subject: Perl check for windows configure. Works for Windows, *nix check is done by bash shell. Task-number: QTBUG-5710 Merge-request: 1362 Reviewed-by: Oswald Buddenhagen --- tools/configure/configureapp.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 31c359e..e6d8526 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3599,17 +3599,21 @@ void Configure::displayConfig() #if !defined(EVAL) void Configure::generateHeaders() { - if (dictionary["SYNCQT"] == "yes" - && findFile("perl.exe")) { - cout << "Running syncqt..." << endl; - QStringList args; - args += buildPath + "/bin/syncqt.bat"; - QStringList env; - env += QString("QTDIR=" + sourcePath); - env += QString("PATH=" + buildPath + "/bin/;" + qgetenv("PATH")); - int retc = Environment::execute(args, env, QStringList()); - if (retc) { - cout << "syncqt failed, return code " << retc << endl << endl; + if (dictionary["SYNCQT"] == "yes") { + if (findFile("perl.exe")) { + cout << "Running syncqt..." << endl; + QStringList args; + args += buildPath + "/bin/syncqt.bat"; + QStringList env; + env += QString("QTDIR=" + sourcePath); + env += QString("PATH=" + buildPath + "/bin/;" + qgetenv("PATH")); + int retc = Environment::execute(args, env, QStringList()); + if (retc) { + cout << "syncqt failed, return code " << retc << endl << endl; + dictionary["DONE"] = "error"; + } + } else { + cout << "Perl not found in environment - cannot run syncqt." << endl; dictionary["DONE"] = "error"; } } -- cgit v0.12 From 248ec0d94a6e58a679cb757d2dd32f6fd59a2b6d Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Wed, 7 Sep 2011 20:28:31 +0200 Subject: runonphone: Add a missing space between a message and the file name Merge-request: 2670 Reviewed-by: Oswald Buddenhagen --- tools/runonphone/trksignalhandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/runonphone/trksignalhandler.cpp b/tools/runonphone/trksignalhandler.cpp index 59ff22c..52de3c8 100644 --- a/tools/runonphone/trksignalhandler.cpp +++ b/tools/runonphone/trksignalhandler.cpp @@ -106,7 +106,7 @@ void TrkSignalHandler::canNotCloseFile(const QString &filename, const QString &e void TrkSignalHandler::installingStarted(const QString &packageName) { if (d->loglevel > 0) - d->out << "Installing" << packageName << "..." << endl; + d->out << "Installing " << packageName << "..." << endl; } void TrkSignalHandler::canNotInstall(const QString &packageFilename, const QString &errorMessage) -- cgit v0.12 From 270c20490813fa943b4fbf0feb1aecb98f0b19ba Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 7 Sep 2011 20:40:48 +0200 Subject: Ensure that the proxystyle is used over the style's own functions When calling a style function such as pixelMetric() then this should be done via the proxy style and not on the style directly. This is so that the proxy style always has a chance to override the original style's implementation and still preserve the fallback to the base style. Task-number: QTBUG-20849 Merge-request: 2645 Reviewed-by: olivier --- src/gui/styles/qcommonstyle.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index ad0e151..327bedf 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -837,14 +837,12 @@ static void drawArrow(const QStyle *style, const QStyleOptionToolButton *toolbut QSize QCommonStylePrivate::viewItemSize(const QStyleOptionViewItemV4 *option, int role) const { - Q_Q(const QCommonStyle); - const QWidget *widget = option->widget; switch (role) { case Qt::CheckStateRole: if (option->features & QStyleOptionViewItemV2::HasCheckIndicator) - return QSize(q->pixelMetric(QStyle::PM_IndicatorWidth, option, widget), - q->pixelMetric(QStyle::PM_IndicatorHeight, option, widget)); + return QSize(proxyStyle->pixelMetric(QStyle::PM_IndicatorWidth, option, widget), + proxyStyle->pixelMetric(QStyle::PM_IndicatorHeight, option, widget)); break; case Qt::DisplayRole: if (option->features & QStyleOptionViewItemV2::HasDisplay) { @@ -855,7 +853,7 @@ QSize QCommonStylePrivate::viewItemSize(const QStyleOptionViewItemV4 *option, in textLayout.setFont(option->font); textLayout.setText(option->text); const bool wrapText = option->features & QStyleOptionViewItemV2::WrapText; - const int textMargin = q->pixelMetric(QStyle::PM_FocusFrameHMargin, option, widget) + 1; + const int textMargin = proxyStyle->pixelMetric(QStyle::PM_FocusFrameHMargin, option, widget) + 1; QRect bounds = option->rect; switch (option->decorationPosition) { case QStyleOptionViewItem::Left: @@ -919,9 +917,8 @@ static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth) void QCommonStylePrivate::viewItemDrawText(QPainter *p, const QStyleOptionViewItemV4 *option, const QRect &rect) const { - Q_Q(const QCommonStyle); const QWidget *widget = option->widget; - const int textMargin = q->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, widget) + 1; + const int textMargin = proxyStyle->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, widget) + 1; QRect textRect = rect.adjusted(textMargin, 0, -textMargin, 0); // remove width padding const bool wrapText = option->features & QStyleOptionViewItemV2::WrapText; @@ -999,7 +996,6 @@ void QCommonStylePrivate::viewItemDrawText(QPainter *p, const QStyleOptionViewIt void QCommonStylePrivate::viewItemLayout(const QStyleOptionViewItemV4 *opt, QRect *checkRect, QRect *pixmapRect, QRect *textRect, bool sizehint) const { - Q_Q(const QCommonStyle); Q_ASSERT(checkRect && pixmapRect && textRect); *pixmapRect = QRect(QPoint(0, 0), viewItemSize(opt, Qt::DecorationRole)); *textRect = QRect(QPoint(0, 0), viewItemSize(opt, Qt::DisplayRole)); @@ -1009,9 +1005,9 @@ void QCommonStylePrivate::viewItemLayout(const QStyleOptionViewItemV4 *opt, QRe const bool hasCheck = checkRect->isValid(); const bool hasPixmap = pixmapRect->isValid(); const bool hasText = textRect->isValid(); - const int textMargin = hasText ? q->pixelMetric(QStyle::PM_FocusFrameHMargin, opt, widget) + 1 : 0; - const int pixmapMargin = hasPixmap ? q->pixelMetric(QStyle::PM_FocusFrameHMargin, opt, widget) + 1 : 0; - const int checkMargin = hasCheck ? q->pixelMetric(QStyle::PM_FocusFrameHMargin, opt, widget) + 1 : 0; + const int textMargin = hasText ? proxyStyle->pixelMetric(QStyle::PM_FocusFrameHMargin, opt, widget) + 1 : 0; + const int pixmapMargin = hasPixmap ? proxyStyle->pixelMetric(QStyle::PM_FocusFrameHMargin, opt, widget) + 1 : 0; + const int checkMargin = hasCheck ? proxyStyle->pixelMetric(QStyle::PM_FocusFrameHMargin, opt, widget) + 1 : 0; int x = opt->rect.left(); int y = opt->rect.top(); int w, h; -- cgit v0.12 From 2a1e82452a192c88bcf0250f5976492f6dc3b65f Mon Sep 17 00:00:00 2001 From: Jan Arne Petersen Date: Wed, 7 Sep 2011 21:38:21 +0200 Subject: Split CFLAGS from pkg-config properly Add support for DEFINES and INCLUDEPATH to link_pkgconfig so moc uses the cflags properly. Task-number: QTBUG-19922 Merge-request: 2674 Reviewed-by: ossi --- mkspecs/features/link_pkgconfig.prf | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/link_pkgconfig.prf b/mkspecs/features/link_pkgconfig.prf index a3dbd1f..91683f6 100644 --- a/mkspecs/features/link_pkgconfig.prf +++ b/mkspecs/features/link_pkgconfig.prf @@ -5,8 +5,21 @@ for(PKGCONFIG_LIB, $$list($$unique(PKGCONFIG))) { # don't proceed if the .pro asks for a package we don't have! !packagesExist($$PKGCONFIG_LIB):error("Package $$PKGCONFIG_LIB not found") - QMAKE_CXXFLAGS += $$system($$PKG_CONFIG --cflags $$PKGCONFIG_LIB) - QMAKE_CFLAGS += $$system($$PKG_CONFIG --cflags $$PKGCONFIG_LIB) + PKGCONFIG_CFLAGS = $$system($$PKG_CONFIG --cflags $$PKGCONFIG_LIB) + + PKGCONFIG_INCLUDEPATH = $$find(PKGCONFIG_CFLAGS, ^-I.*) + PKGCONFIG_INCLUDEPATH ~= s/^-I(.*)/\\1/g + + PKGCONFIG_DEFINES = $$find(PKGCONFIG_CFLAGS, ^-D.*) + PKGCONFIG_DEFINES ~= s/^-D(.*)/\\1/g + + PKGCONFIG_CFLAGS ~= s/^-[ID].*//g + + INCLUDEPATH *= $$PKGCONFIG_INCLUDEPATH + DEFINES *= $$PKGCONFIG_DEFINES + + QMAKE_CXXFLAGS += $$PKGCONFIG_CFLAGS + QMAKE_CFLAGS += $$PKGCONFIG_CFLAGS LIBS += $$system($$PKG_CONFIG --libs $$PKGCONFIG_LIB) } -- cgit v0.12 From 852abfca6f4c349dce9b895956922f96d82df579 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Thu, 8 Sep 2011 12:28:49 +1000 Subject: Fix double click and drag not extending word selection. mousePressed isn't set on the second press of a double click and so can't be used to determine if all selections should be skipped. Instead skip only the single click and drag selections if mousePressed is false. Change-Id: I5e7ba033f38b0f9b98fdca5c61a8548f92991601 Task-number: QTBUG-20925 Reviewed-by: Martin Jones --- src/gui/text/qtextcontrol.cpp | 7 ++---- tests/auto/qtextedit/tst_qtextedit.cpp | 41 ++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index aacac04..996d488 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1628,16 +1628,13 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons return; } - if (!mousePressed) - return; - const qreal mouseX = qreal(mousePos.x()); int newCursorPos = q->hitTest(mousePos, Qt::FuzzyHit); if (newCursorPos == -1) return; - if (wordSelectionEnabled && !selectedWordOnDoubleClick.hasSelection()) { + if (mousePressed && wordSelectionEnabled && !selectedWordOnDoubleClick.hasSelection()) { selectedWordOnDoubleClick = cursor; selectedWordOnDoubleClick.select(QTextCursor::WordUnderCursor); } @@ -1646,7 +1643,7 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons extendBlockwiseSelection(newCursorPos); else if (selectedWordOnDoubleClick.hasSelection()) extendWordwiseSelection(newCursorPos, mouseX); - else + else if (mousePressed) setCursorPosition(newCursorPos, QTextCursor::KeepAnchor); if (interactionFlags & Qt::TextEditable) { diff --git a/tests/auto/qtextedit/tst_qtextedit.cpp b/tests/auto/qtextedit/tst_qtextedit.cpp index 42ea3b1..73d09f4 100644 --- a/tests/auto/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/qtextedit/tst_qtextedit.cpp @@ -138,6 +138,8 @@ private slots: void textSemantics(); #endif void cursorPositionChanged(); + void mouseSelection(); + void mouseSelectionDClick(); void setTextCursor(); #ifndef QT_NO_CLIPBOARD void undoAvailableAfterPaste(); @@ -785,6 +787,45 @@ void tst_QTextEdit::cursorPositionChanged() QCOMPARE(ed->textCursor().position(), 0); } +void tst_QTextEdit::mouseSelection() +{ + ed->show(); + ed->setPlainText(("Hello World")); + QTextCursor cursor = ed->textCursor(); + cursor.setPosition(1); + QPoint p1 = ed->cursorRect(cursor).center(); + cursor.setPosition(10); + QPoint p2 = ed->cursorRect(cursor).center(); + QTest::mousePress(ed->viewport(), Qt::LeftButton, 0, p1); + { QMouseEvent ev(QEvent::MouseMove, p2, Qt::LeftButton, Qt::LeftButton, 0); + QCoreApplication::sendEvent(ed->viewport(), &ev); } + QTest::mouseRelease(ed->viewport(), Qt::LeftButton, 0, p2); + QVERIFY(ed->textCursor().hasSelection()); + QCOMPARE(ed->textCursor().selectedText(), QString("ello Worl")); + +} + +void tst_QTextEdit::mouseSelectionDClick() +{ + ed->show(); + ed->setPlainText(("Hello World")); + QTextCursor cursor = ed->textCursor(); + cursor.setPosition(1); + QPoint p1 = ed->cursorRect(cursor).center(); + cursor.setPosition(10); + QPoint p2 = ed->cursorRect(cursor).center(); + QTest::mousePress(ed->viewport(), Qt::LeftButton, 0, p1); + QTest::mouseRelease(ed->viewport(), Qt::LeftButton, 0, p1); + QTest::mouseDClick(ed->viewport(), Qt::LeftButton, 0, p1); + QVERIFY(ed->textCursor().hasSelection()); + QCOMPARE(ed->textCursor().selectedText(), QString("Hello")); + { QMouseEvent ev(QEvent::MouseMove, p2, Qt::LeftButton, Qt::LeftButton, 0); + QCoreApplication::sendEvent(ed->viewport(), &ev); } + QTest::mouseRelease(ed->viewport(), Qt::LeftButton, 0, p2); + QVERIFY(ed->textCursor().hasSelection()); + QCOMPARE(ed->textCursor().selectedText(), QString("Hello World")); +} + void tst_QTextEdit::setTextCursor() { QSignalSpy spy(ed, SIGNAL(cursorPositionChanged())); -- cgit v0.12 From 695ef14f443ef992f62203949fc1565b11fdf621 Mon Sep 17 00:00:00 2001 From: Kranthi Kuntala Date: Thu, 8 Sep 2011 13:33:19 +0300 Subject: update the proxy info before session is opened in QNAM by Aapo Makela Reviewed-By: Kranthi Kuntala --- src/network/access/qnetworkreplyimpl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index 8a0a944..a7a6287 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -253,6 +253,11 @@ void QNetworkReplyImplPrivate::_q_networkSessionConnected() if (session->state() != QNetworkSession::Connected) return; + #ifndef QT_NO_NETWORKPROXY + // Re-set proxies here as new session might have changed them + proxyList = manager->d_func()->queryProxy(QNetworkProxyQuery(request.url())); + #endif + switch (state) { case QNetworkReplyImplPrivate::Buffering: case QNetworkReplyImplPrivate::Working: -- cgit v0.12 From 80966f5ac941092e25643b5f80a410e61c26f8bc Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Thu, 8 Sep 2011 14:46:40 +0200 Subject: Migrate addMarkUp function to QChar. Reviewed-by: Martin Smith --- tools/qdoc3/cppcodemarker.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp index 9af7b9e..b81e979 100644 --- a/tools/qdoc3/cppcodemarker.cpp +++ b/tools/qdoc3/cppcodemarker.cpp @@ -937,7 +937,7 @@ QString CppCodeMarker::addMarkUp(const QString &in, int i = 0; int start = 0; int finish = 0; - char ch; + QChar ch; QRegExp classRegExp("Qt?(?:[A-Z3]+[a-z][A-Za-z]*|t)"); QRegExp functionRegExp("q([A-Z][a-z]+)+"); @@ -947,13 +947,13 @@ QString CppCodeMarker::addMarkUp(const QString &in, QString tag; bool target = false; - if (isalpha((unsigned char) ch) || ch == '_') { + if (ch.isLetter() || ch == '_') { QString ident; do { - ident += ch; - finish = i; - readChar(); - } while (isalnum((unsigned char) ch) || ch == '_'); + ident += ch; + finish = i; + readChar(); + } while (ch.isLetterOrNumber() || ch == '_'); if (classRegExp.exactMatch(ident)) { tag = QLatin1String("type"); @@ -970,14 +970,14 @@ QString CppCodeMarker::addMarkUp(const QString &in, tag = QLatin1String("func"); target = true; } - } else if (isdigit((unsigned char) ch)) { + } else if (ch.isDigit()) { do { finish = i; readChar(); - } while (isalnum((unsigned char) ch) || ch == '.'); + } while (ch.isLetterOrNumber() || ch == '.'); tag = QLatin1String("number"); } else { - switch (ch) { + switch (ch.unicode()) { case '+': case '-': case '!': -- cgit v0.12 From 712b1f400ec0a87e9d6c521c1d14548f7359f038 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 8 Sep 2011 17:44:05 +0200 Subject: qmake vcxproj generator: fix XML conversion for build events Task-number: QTBUG-20419 Reviewed-by: ossi --- qmake/generators/win32/msbuild_objectmodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index f50afc3..0b201b8 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -1524,8 +1524,8 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCEventTool &tool) { xml << tag(tool.EventName) - << attrTagS(_Command, tool.CommandLine.join(vcxCommandSeparator())) - << attrTagS(_Message, tool.Description) + << tag(_Command) << valueTag(tool.CommandLine.join(vcxCommandSeparator())) + << tag(_Message) << valueTag(tool.Description) << closetag(tool.EventName); } -- cgit v0.12 From b62dc3277c4d41cc99d37c457e3a55842879e0b1 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Fri, 9 Sep 2011 14:49:15 +0200 Subject: Release font engine refcount when done using it in QTextEngine 5f2b6dd2a50275bc05ae5d7e9dd8902d6d49d9df increased refcounts for font engines in QTextEngine cache, we need to decrease them when the QTextEngine is deallocated. Task-number: QTBUG-21222 Reviewed-by: Eskil --- src/gui/text/qtextengine.cpp | 12 +++++++++--- src/gui/text/qtextengine_p.h | 1 + src/gui/text/qtextlayout.cpp | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index cff3641..ee2eef6 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1334,6 +1334,7 @@ QTextEngine::~QTextEngine() if (!stackEngine) delete layoutData; delete specialData; + resetFontEngineCache(); } const HB_CharAttributes *QTextEngine::attributes() const @@ -1394,6 +1395,13 @@ static inline void releaseCachedFontEngine(QFontEngine *fontEngine) } } +void QTextEngine::resetFontEngineCache() +{ + releaseCachedFontEngine(feCache.prevFontEngine); + releaseCachedFontEngine(feCache.prevScaledFontEngine); + feCache.reset(); +} + void QTextEngine::invalidate() { freeMemory(); @@ -1402,9 +1410,7 @@ void QTextEngine::invalidate() if (specialData) specialData->resolvedFormatIndices.clear(); - releaseCachedFontEngine(feCache.prevFontEngine); - releaseCachedFontEngine(feCache.prevScaledFontEngine); - feCache.reset(); + resetFontEngineCache(); } void QTextEngine::clearLineData() diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h index c920c7b..2b6db67 100644 --- a/src/gui/text/qtextengine_p.h +++ b/src/gui/text/qtextengine_p.h @@ -614,6 +614,7 @@ public: QFixed leadingSpaceWidth(const QScriptLine &line); int positionInLigature(const QScriptItem *si, int end, QFixed x, QFixed edge, int glyph_pos, bool cursorOnCharacter); + void resetFontEngineCache(); private: void setBoundary(int strPos) const; diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index d180f0e..f2d3de1 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -386,7 +386,7 @@ QTextLayout::~QTextLayout() void QTextLayout::setFont(const QFont &font) { d->fnt = font; - d->feCache.reset(); + d->resetFontEngineCache(); } /*! @@ -519,7 +519,7 @@ void QTextLayout::setAdditionalFormats(const QList &formatList) } if (d->block.docHandle()) d->block.docHandle()->documentChange(d->block.position(), d->block.length()); - d->feCache.reset(); + d->resetFontEngineCache(); } /*! -- cgit v0.12 From c378e16e57e8ce2255116e7fdb5436524cccb8c7 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 9 Sep 2011 18:41:52 +0200 Subject: find qt.conf more reliably a qmake invoked with a relative path would not find qt.conf, because it already changed CWD, which would confuse our copy of QCoreApplication::applicationFilePath() (see also QTBUG-21381). we already have the absolute path to the qmake executable in Option::qmake_abslocation, so just use it. --- qmake/option.cpp | 59 +++----------------------------------------------------- 1 file changed, 3 insertions(+), 56 deletions(-) diff --git a/qmake/option.cpp b/qmake/option.cpp index 31372ab..c3e89de 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -750,64 +750,11 @@ qmakeAddCacheClear(qmakeCacheClearFunc func, void **data) cache_items.append(new QMakeCacheClearItem(func, data)); } -#ifdef Q_OS_WIN -# include - -QT_USE_NAMESPACE -#endif - QString qmake_libraryInfoFile() { - QString ret; -#if defined( Q_OS_WIN ) - wchar_t module_name[MAX_PATH]; - GetModuleFileName(0, module_name, MAX_PATH); - QFileInfo filePath = QString::fromWCharArray(module_name); - ret = filePath.filePath(); -#else - QString argv0 = QFile::decodeName(QByteArray(Option::application_argv0)); - QString absPath; - - if (!argv0.isEmpty() && argv0.at(0) == QLatin1Char('/')) { - /* - If argv0 starts with a slash, it is already an absolute - file path. - */ - absPath = argv0; - } else if (argv0.contains(QLatin1Char('/'))) { - /* - If argv0 contains one or more slashes, it is a file path - relative to the current directory. - */ - absPath = QDir::current().absoluteFilePath(argv0); - } else { - /* - Otherwise, the file path has to be determined using the - PATH environment variable. - */ - QByteArray pEnv = qgetenv("PATH"); - QDir currentDir = QDir::current(); - QStringList paths = QString::fromLocal8Bit(pEnv.constData()).split(QLatin1String(":")); - for (QStringList::const_iterator p = paths.constBegin(); p != paths.constEnd(); ++p) { - if ((*p).isEmpty()) - continue; - QString candidate = currentDir.absoluteFilePath(*p + QLatin1Char('/') + argv0); - QFileInfo candidate_fi(candidate); - if (candidate_fi.exists() && !candidate_fi.isDir()) { - absPath = candidate; - break; - } - } - } - - absPath = QDir::cleanPath(absPath); - - QFileInfo fi(absPath); - ret = fi.exists() ? fi.canonicalFilePath() : QString(); -#endif - if(!ret.isEmpty()) - ret = QDir(QFileInfo(ret).absolutePath()).filePath("qt.conf"); - return ret; + if(!Option::qmake_abslocation.isEmpty()) + return QDir(QFileInfo(Option::qmake_abslocation).absolutePath()).filePath("qt.conf"); + return QString(); } QT_END_NAMESPACE -- cgit v0.12 From f85819fe083ae7c6804c884de68e906d153a6d11 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 12 Sep 2011 09:42:51 +1000 Subject: StrictlyEnforceRange with snapOneItem/Row and header behavior change Change cf23188de237009136fa1480ab8fd9e3ca364769 changed the positioning of a view with StrictlyEnforceRange, snapOneItem/Row, and a header, such that the view was positioned at the beginning of the header, rather than on the first item. This change reverts back to the old behavior (position on the first item). Change-Id: I62ad183919bb2ed83d787d1d76421caf9e708599 Task-number: QTTH-1501 Reviewed-by: Michael Brasser --- src/declarative/graphicsitems/qdeclarativegridview.cpp | 6 ++++-- src/declarative/graphicsitems/qdeclarativelistview.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 59e4cbb..5a5b60e 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -1064,6 +1064,8 @@ void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m highlightEnd = highlightRangeEnd; } + bool strictHighlightRange = haveHighlightRange && highlightRange == QDeclarativeGridView::StrictlyEnforceRange; + if (snapMode != QDeclarativeGridView::NoSnap) { qreal tempPosition = isRightToLeftTopToBottom() ? -position()-size() : position(); if (snapMode == QDeclarativeGridView::SnapOneRow && moveReason == Mouse) { @@ -1081,7 +1083,7 @@ void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m FxGridItem *topItem = snapItemAt(tempPosition+highlightStart); FxGridItem *bottomItem = snapItemAt(tempPosition+highlightEnd); qreal pos; - if (topItem && bottomItem && haveHighlightRange && highlightRange == QDeclarativeGridView::StrictlyEnforceRange) { + if (topItem && bottomItem && strictHighlightRange) { qreal topPos = qMin(topItem->rowPos() - highlightStart, -maxExtent); qreal bottomPos = qMax(bottomItem->rowPos() - highlightEnd, -minExtent); pos = qAbs(data.move + topPos) < qAbs(data.move + bottomPos) ? topPos : bottomPos; @@ -1089,7 +1091,7 @@ void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m qreal headerPos = 0; if (header) headerPos = isRightToLeftTopToBottom() ? header->rowPos() + cellWidth - headerSize() : header->rowPos(); - if (topItem->index == 0 && header && tempPosition+highlightStart < headerPos+headerSize()/2) { + if (topItem->index == 0 && header && tempPosition+highlightStart < headerPos+headerSize()/2 && !strictHighlightRange) { pos = isRightToLeftTopToBottom() ? - headerPos + highlightStart - size() : headerPos - highlightStart; } else { if (isRightToLeftTopToBottom()) diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 57b7dea..70be7a7 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1293,6 +1293,7 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m correctFlick = false; fixupMode = moveReason == Mouse ? fixupMode : Immediate; + bool strictHighlightRange = haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange; qreal highlightStart; qreal highlightEnd; @@ -1325,9 +1326,9 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m FxListItem *topItem = snapItemAt(tempPosition+highlightStart); FxListItem *bottomItem = snapItemAt(tempPosition+highlightEnd); qreal pos; - bool isInBounds = -position() > maxExtent && -position() < minExtent; + bool isInBounds = -position() > maxExtent && -position() <= minExtent; if (topItem && isInBounds) { - if (topItem->index == 0 && header && tempPosition+highlightStart < header->position()+header->size()/2) { + if (topItem->index == 0 && header && tempPosition+highlightStart < header->position()+header->size()/2 && !strictHighlightRange) { pos = isRightToLeft() ? - header->position() + highlightStart - size() : header->position() - highlightStart; } else { if (isRightToLeft()) @@ -1356,7 +1357,7 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m } vTime = timeline.time(); } - } else if (currentItem && haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange + } else if (currentItem && strictHighlightRange && moveReason != QDeclarativeListViewPrivate::SetIndex) { updateHighlight(); qreal pos = currentItem->itemPosition(); -- cgit v0.12 From 6acb1a68962592e59cf2673de05661b39587c18c Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Mon, 12 Sep 2011 18:17:53 +0200 Subject: runonphone: Add a missing argument for QString::arg Merge-request: 2680 Reviewed-by: Oswald Buddenhagen --- tools/runonphone/codasignalhandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/runonphone/codasignalhandler.cpp b/tools/runonphone/codasignalhandler.cpp index 0d086b5..3d524dd 100644 --- a/tools/runonphone/codasignalhandler.cpp +++ b/tools/runonphone/codasignalhandler.cpp @@ -168,7 +168,7 @@ int CodaSignalHandler::run() QString deviceError = "No such port"; if (d->codaDevice) deviceError = d->codaDevice->device()->errorString(); - reportError(tr("Could not open serial device: ").arg(deviceError)); + reportError(tr("Could not open serial device: %1").arg(deviceError)); SymbianUtils::SymbianDeviceManager::instance()->releaseCodaDevice(d->codaDevice); return 1; } -- cgit v0.12 From 434686a926a2a6e71f3cdea2508898b7800f7c81 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 12 Sep 2011 18:43:21 +0200 Subject: Fix QNetworkReply::errorString returning an untranslated string The QHttpNetworkConnectionPrivate::errorDetail is supposed to return a translated string, which is then set as the QNetworkReply error. The current code incorrectly uses QT_TRANSLATE_NOOP, which mark the strings for translation, but does not translate them. The result is that even with a translator loaded those strings are written in English. Fixes QTBUG-18382. Merge-request: 2671 Reviewed-by: Oswald Buddenhagen --- src/network/access/qhttpnetworkconnection.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 6101eea..4f2145e 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -665,32 +666,31 @@ QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError e QString errorString; switch (errorCode) { case QNetworkReply::HostNotFoundError: - errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QHttp", "Host %1 not found")) - .arg(socket->peerName()); + errorString = QCoreApplication::translate("QHttp", "Host %1 not found").arg(socket->peerName()); break; case QNetworkReply::ConnectionRefusedError: - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Connection refused")); + errorString = QCoreApplication::translate("QHttp", "Connection refused"); break; case QNetworkReply::RemoteHostClosedError: - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Connection closed")); + errorString = QCoreApplication::translate("QHttp", "Connection closed"); break; case QNetworkReply::TimeoutError: - errorString = QLatin1String(QT_TRANSLATE_NOOP("QAbstractSocket", "Socket operation timed out")); + errorString = QCoreApplication::translate("QAbstractSocket", "Socket operation timed out"); break; case QNetworkReply::ProxyAuthenticationRequiredError: - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Proxy requires authentication")); + errorString = QCoreApplication::translate("QHttp", "Proxy requires authentication"); break; case QNetworkReply::AuthenticationRequiredError: - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Host requires authentication")); + errorString = QCoreApplication::translate("QHttp", "Host requires authentication"); break; case QNetworkReply::ProtocolFailure: - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Data corrupted")); + errorString = QCoreApplication::translate("QHttp", "Data corrupted"); break; case QNetworkReply::ProtocolUnknownError: - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Unknown protocol specified")); + errorString = QCoreApplication::translate("QHttp", "Unknown protocol specified"); break; case QNetworkReply::SslHandshakeFailedError: - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "SSL handshake failed")); + errorString = QCoreApplication::translate("QHttp", "SSL handshake failed"); break; default: // all other errors are treated as QNetworkReply::UnknownNetworkError -- cgit v0.12 From 5c9ab15eda6a14b48120776fdc4c7c84d5771274 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 13 Sep 2011 17:27:48 +0200 Subject: wtf? .pro.user files? congrats to overriding the hook! --- src/opengl/opengl.pro.user.2.1pre1 | 83 -------------------------------------- 1 file changed, 83 deletions(-) delete mode 100644 src/opengl/opengl.pro.user.2.1pre1 diff --git a/src/opengl/opengl.pro.user.2.1pre1 b/src/opengl/opengl.pro.user.2.1pre1 deleted file mode 100644 index 0c38724..0000000 --- a/src/opengl/opengl.pro.user.2.1pre1 +++ /dev/null @@ -1,83 +0,0 @@ - - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - UTF-8 - - - - ProjectExplorer.Project.Target.0 - - Desktop - Qt4ProjectManager.Target.DesktopTarget - 0 - 0 - - - qmake - QtProjectManager.QMakeBuildStep - - QMAKE_ABSOLUTE_SOURCE_PATH=/home/jlind/dev/qt/lighthouse-master/src/opengl - - - - Make - Qt4ProjectManager.MakeStep - false - - -j9 - - - - 2 - - Make - Qt4ProjectManager.MakeStep - true - - clean - - - - 1 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - /home/jlind/builds/master-lighthouse/src/opengl - 23 - 0 - true - - 1 - - headers - Qt4ProjectManager.Qt4RunConfiguration - 2 - - ../../../../../builds/master-lighthouse/include/QtOpenGL/headers.pri - false - false - - false - false - - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.FileVersion - 4 - - -- cgit v0.12 From b2c75c1f846e03442d9bb337513357b553ce719b Mon Sep 17 00:00:00 2001 From: Ademar de Souza Reis Jr Date: Tue, 13 Sep 2011 11:07:16 -0300 Subject: Updated WebKit to 64cce10 (qtwebkit-rc1, week36) Changes since last sync: [https://webkit.org/b/59927 #59927]: [SH4] AssemblerLabel does not name a type [https://webkit.org/b/63259 #63259]: Warnings in JSC's JIT on 32 bit [https://webkit.org/b/67254 #67254]: [Qt][DRT] Normalize file:///tmp/LayoutTests in LayoutTestController::pathToLocalResource() [https://webkit.org/b/64527 #64527]: [Qt]Update layout test results for newer Qt 4.8.x [https://webkit.org/b/67644 #67644]: [Qt][Symbian] REGRESSION[94105] DumpRenderTree.exe doesn't build on Symbian [https://webkit.org/b/67784 #67784]: frame-loading-via-document-write.html test cases have extra slash in path [https://webkit.org/b/67958 #67958]: (restricted bug) [https://webkit.org/b/61805 #61805]: (restricted bug) [https://webkit.org/b/64753 #64753]: (restricted bug) [https://webkit.org/b/67364 #67364]: (restricted bug) [https://webkit.org/b/67488 #67488]: (restricted bug) [https://webkit.org/b/67735 #67735]: (restricted bug) [https://webkit.org/b/67748 #67748]: (restricted bug) --- src/3rdparty/webkit/.tag | 2 +- .../webkit/Source/JavaScriptCore/ChangeLog | 25 ++++ .../JavaScriptCore/assembler/MacroAssemblerSH4.h | 2 +- .../JavaScriptCore/jit/JITPropertyAccess32_64.cpp | 12 +- src/3rdparty/webkit/Source/WebCore/ChangeLog | 162 +++++++++++++++++++++ .../accessibility/AccessibilityRenderObject.cpp | 16 +- .../WebCore/bindings/ScriptControllerBase.cpp | 2 + .../Source/WebCore/platform/graphics/Gradient.cpp | 4 - .../Source/WebCore/rendering/RenderBlock.cpp | 32 ++-- .../Source/WebCore/rendering/RenderObject.cpp | 18 +++ .../webkit/Source/WebCore/rendering/RenderObject.h | 8 + .../WebCore/rendering/RenderObjectChildList.cpp | 9 +- .../webkit/Source/WebCore/rendering/RenderRuby.cpp | 12 ++ .../webkit/Source/WebCore/rendering/RenderRuby.h | 6 + .../Source/WebCore/rendering/RenderTable.cpp | 1 + .../Source/WebCore/rendering/RenderTableRow.cpp | 6 +- .../WebCore/rendering/RenderTableSection.cpp | 10 +- .../Source/WebCore/rendering/RenderTableSection.h | 3 + .../rendering/svg/RenderSVGResourceContainer.cpp | 2 +- .../Source/WebCore/svg/SVGDocumentExtensions.cpp | 24 ++- .../Source/WebCore/svg/SVGDocumentExtensions.h | 1 + .../webkit/Source/WebCore/svg/SVGStyledElement.cpp | 12 +- .../webkit/Source/WebCore/svg/SVGStyledElement.h | 3 +- .../webkit/Source/WebCore/svg/SVGUseElement.cpp | 4 +- src/3rdparty/webkit/Source/WebKit/qt/ChangeLog | 10 ++ .../Source/WebKit/qt/symbian/eabi/QtWebKitu.def | 1 + src/3rdparty/webkit/VERSION | 2 +- 27 files changed, 339 insertions(+), 50 deletions(-) mode change 100644 => 100755 src/3rdparty/webkit/Source/WebCore/ChangeLog mode change 100644 => 100755 src/3rdparty/webkit/Source/WebCore/svg/SVGDocumentExtensions.cpp mode change 100644 => 100755 src/3rdparty/webkit/Source/WebCore/svg/SVGDocumentExtensions.h mode change 100644 => 100755 src/3rdparty/webkit/Source/WebCore/svg/SVGStyledElement.cpp mode change 100644 => 100755 src/3rdparty/webkit/Source/WebCore/svg/SVGStyledElement.h diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag index 458898a..34446ae 100644 --- a/src/3rdparty/webkit/.tag +++ b/src/3rdparty/webkit/.tag @@ -1 +1 @@ -a2bd2bb1b19949c6807da38e25bfa7d210bb4b17 +64cce100215c71575f19ca0b090c65fa97d4ba10 diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/Source/JavaScriptCore/ChangeLog index 5aec2e3..9cda920 100644 --- a/src/3rdparty/webkit/Source/JavaScriptCore/ChangeLog +++ b/src/3rdparty/webkit/Source/JavaScriptCore/ChangeLog @@ -1,3 +1,28 @@ +2011-05-23 Thouraya ANDOLSI + + Reviewed by Gavin Barraclough. + + [SH4] AssemblerLabel does not name a type + https://bugs.webkit.org/show_bug.cgi?id=59927 + + SH4Assembler.h file shoold be included before AbstractMacroAssembler.h. + + * assembler/MacroAssemblerSH4.h: + +2011-06-28 Pierre Rossi + + Reviewed by Eric Seidel. + + Warnings in JSC's JIT on 32 bit + https://bugs.webkit.org/show_bug.cgi?id=63259 + + Fairly straightforward, just use ASSERT_JIT_OFFSET_UNUSED when it applies. + + * jit/JITPropertyAccess32_64.cpp: + (JSC::JIT::emit_op_method_check): + (JSC::JIT::compileGetByIdHotPath): + (JSC::JIT::emit_op_put_by_id): + 2011-08-30 Ademar de Souza Reis Jr. [Qt] Do not unconditionally use pkg-config in .pro files diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/assembler/MacroAssemblerSH4.h b/src/3rdparty/webkit/Source/JavaScriptCore/assembler/MacroAssemblerSH4.h index 5ef7b20..9036f0f 100644 --- a/src/3rdparty/webkit/Source/JavaScriptCore/assembler/MacroAssemblerSH4.h +++ b/src/3rdparty/webkit/Source/JavaScriptCore/assembler/MacroAssemblerSH4.h @@ -29,8 +29,8 @@ #if ENABLE(ASSEMBLER) && CPU(SH4) -#include "AbstractMacroAssembler.h" #include "SH4Assembler.h" +#include "AbstractMacroAssembler.h" #include namespace JSC { diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp b/src/3rdparty/webkit/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp index f18e277..c88e9ad 100644 --- a/src/3rdparty/webkit/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp +++ b/src/3rdparty/webkit/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp @@ -225,9 +225,9 @@ void JIT::emit_op_method_check(Instruction* currentInstruction) move(TrustedImm32(JSValue::CellTag), regT1); Jump match = jump(); - ASSERT_JIT_OFFSET(differenceBetween(info.structureToCompare, protoObj), patchOffsetMethodCheckProtoObj); + ASSERT_JIT_OFFSET_UNUSED(protoObj, differenceBetween(info.structureToCompare, protoObj), patchOffsetMethodCheckProtoObj); ASSERT_JIT_OFFSET(differenceBetween(info.structureToCompare, protoStructureToCompare), patchOffsetMethodCheckProtoStruct); - ASSERT_JIT_OFFSET(differenceBetween(info.structureToCompare, putFunction), patchOffsetMethodCheckPutFunction); + ASSERT_JIT_OFFSET_UNUSED(putFunction, differenceBetween(info.structureToCompare, putFunction), patchOffsetMethodCheckPutFunction); // Link the failure cases here. structureCheck.link(this); @@ -436,9 +436,9 @@ void JIT::compileGetByIdHotPath() loadPtr(Address(regT0, OBJECT_OFFSETOF(JSObject, m_propertyStorage)), regT2); DataLabel32 displacementLabel1 = loadPtrWithAddressOffsetPatch(Address(regT2, patchGetByIdDefaultOffset), regT0); // payload - ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, displacementLabel1), patchOffsetGetByIdPropertyMapOffset1); + ASSERT_JIT_OFFSET_UNUSED(displacementLabel1, differenceBetween(hotPathBegin, displacementLabel1), patchOffsetGetByIdPropertyMapOffset1); DataLabel32 displacementLabel2 = loadPtrWithAddressOffsetPatch(Address(regT2, patchGetByIdDefaultOffset), regT1); // tag - ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, displacementLabel2), patchOffsetGetByIdPropertyMapOffset2); + ASSERT_JIT_OFFSET_UNUSED(displacementLabel2, differenceBetween(hotPathBegin, displacementLabel2), patchOffsetGetByIdPropertyMapOffset2); Label putResult(this); ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, putResult), patchOffsetGetByIdPutResult); @@ -514,8 +514,8 @@ void JIT::emit_op_put_by_id(Instruction* currentInstruction) END_UNINTERRUPTED_SEQUENCE(sequencePutById); - ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, displacementLabel1), patchOffsetPutByIdPropertyMapOffset1); - ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, displacementLabel2), patchOffsetPutByIdPropertyMapOffset2); + ASSERT_JIT_OFFSET_UNUSED(displacementLabel1, differenceBetween(hotPathBegin, displacementLabel1), patchOffsetPutByIdPropertyMapOffset1); + ASSERT_JIT_OFFSET_UNUSED(displacementLabel2, differenceBetween(hotPathBegin, displacementLabel2), patchOffsetPutByIdPropertyMapOffset2); } void JIT::emitSlow_op_put_by_id(Instruction* currentInstruction, Vector::iterator& iter) diff --git a/src/3rdparty/webkit/Source/WebCore/ChangeLog b/src/3rdparty/webkit/Source/WebCore/ChangeLog old mode 100644 new mode 100755 index a781b1f..da9d1b2 --- a/src/3rdparty/webkit/Source/WebCore/ChangeLog +++ b/src/3rdparty/webkit/Source/WebCore/ChangeLog @@ -1,3 +1,165 @@ +2011-09-12 Adam Klein + + Fix out-of-bounds access in Gradient::sortStopsIfNecessary + https://bugs.webkit.org/show_bug.cgi?id=67958 + + Reviewed by Darin Adler. + + Reported by Valgrind in http://crbug.com/77049. + + The errant code was added as an optimization in r67804. + This patch reverts that one, as all parties agree that the optimization + doesn't seem worthwhile, and there clearly aren't any tests covering + the special case. + + No new tests, as existing tests should cover the remaining call to + |std::stable_sort|. + + * platform/graphics/Gradient.cpp: + (WebCore::Gradient::sortStopsIfNecessary): + +2011-09-09 Dominic Mazzoni + + Assert being hit in AccessibilityRenderObject::addChildren() + https://bugs.webkit.org/show_bug.cgi?id=61805 + + Reviewed by Chris Fleizach. + + Fix nextSibling and previousSibling to handle adjacent continuations + properly, otherwise nodes end up appearing in the accessibility + tree twice (or a debug assertion could be raised). + + Test: accessibility/adjacent-continuations-cause-assertion-failure.html + + * accessibility/AccessibilityRenderObject.cpp: + (WebCore::AccessibilityRenderObject::previousSibling): + (WebCore::AccessibilityRenderObject::nextSibling): + +2011-09-08 Abhishek Arya + + :before content rendering issues with list markers and run-ins. + https://bugs.webkit.org/show_bug.cgi?id=67735 + + 1) Remove the isAnonymous checks for run-in detection since the + run-in can belong to a node. + 2) When the parent has block children, then the list marker will + be enclosed in an anonymous block. In that case, for going to the + next list marker, we need to traverse one level up. We don't need + this check when searching for generated run-in (loop 2), since we + know parent will have inline children, so the list marker wont be + enclosed in an anonymous block. + + Reviewed by Dave Hyatt. + + Tests: fast/lists/list-marker-before-content-table.html + fast/runin/runin-generated-before-content.html + + * rendering/RenderObjectChildList.cpp: + (WebCore::RenderObjectChildList::beforePseudoElementRenderer): + +2011-09-10 Ken Buchanan + + Crash due to bad data in SVGDocumentExtensions m_pendingResources + https://bugs.webkit.org/show_bug.cgi?id=67488 + + Reviewed by Nikolas Zimmermann. + + Resolving a crash condition caused by the deletion of + elements while pending resource entries for those elements are still + recorded. + + * rendering/svg/RenderSVGResourceContainer.cpp: + (WebCore::RenderSVGResourceContainer::registerResource) + * svg/SVGDocumentExtensions.h: + (WebCore::SVGDocumentExtensions::isElementInPendingResources) + * svg/SVGDocumentExtensions.cpp: + (WebCore::SVGDocumentExtensions::addPendingResource) + (WebCore::SVGDocumentExtensions::isElementInPendingResources) + (WebCore::SVGDocumentExtensions::removeElementFromPendingResources) + * svg/SVGStyledElement.h: + (WebCore::SVGStyledElement::clearHasPendingResourcesIfPossible) + * svg/SVGStyledElement.cpp: + (WebCore::SVGStyledElement::buildPendingResourcesIfNeeded) + (WebCore::SVGStyledElement::clearHasPendingResourcesIfPossible) + * svg/SVGUseElement.cpp: + (WebCore::SVGUseElement::svgAttributeChanged) + +2011-09-08 Alexey Proskuryakov + + REGRESSION (r66874): Missing RefPtr in ScriptController + https://bugs.webkit.org/show_bug.cgi?id=67748 + + Reviewed by Adam Barth. + + * bindings/ScriptControllerBase.cpp: (WebCore::ScriptController::executeScript): + +2011-09-06 Abhishek Arya + + Style not propagated to anonymous boxes and anonymous + inline-blocks. + https://bugs.webkit.org/show_bug.cgi?id=67364 + + Reviewed by James Robinson. + + Share propagateStyleToAnonymousChildren with RenderBlock::styleDidChange. + + * rendering/RenderBlock.cpp: + (WebCore::RenderBlock::styleDidChange): + * rendering/RenderObject.cpp: + (WebCore::RenderObject::propagateStyleToAnonymousChildren): + * rendering/RenderObject.h: + +2011-09-04 Abhishek Arya + + Style not propagated to anonymous boxes and anonymous + inline-blocks. + https://bugs.webkit.org/show_bug.cgi?id=67364 + + Reviewed by James Robinson. + + Tests: fast/ruby/ruby-block-style-not-updated-with-before-after-content.html + fast/ruby/ruby-block-style-not-updated.html + fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html + fast/ruby/ruby-inline-style-not-updated.html + fast/table/table-row-style-not-updated-with-after-content.html + fast/table/table-row-style-not-updated-with-before-content.html + fast/table/table-row-style-not-updated.html + fast/table/table-style-not-updated.html + + * rendering/RenderObject.cpp: + (WebCore::RenderObject::propagateStyleToAnonymousChildren): + * rendering/RenderObject.h: + (WebCore::RenderObject::isBeforeAfterContent): + * rendering/RenderRuby.cpp: + (WebCore::RenderRubyAsInline::styleDidChange): + (WebCore::RenderRubyAsBlock::styleDidChange): + * rendering/RenderRuby.h: + * rendering/RenderTable.cpp: + (WebCore::RenderTable::styleDidChange): + * rendering/RenderTableRow.cpp: + (WebCore::RenderTableRow::styleDidChange): + (WebCore::RenderTableRow::addChild): + * rendering/RenderTableSection.cpp: + (WebCore::RenderTableSection::styleDidChange): + (WebCore::RenderTableSection::addChild): + * rendering/RenderTableSection.h: + +2011-09-05 Abhishek Arya + + Crash in RenderObjectChildList::destroyLeftOverChildren() + https://bugs.webkit.org/show_bug.cgi?id=64753 + + Reviewed by James Robinson. + + If any of the ancestors between column span element and containing + column's block is a continuation, then don't attempt to render the + column span by splitting the block into continuations. + + Test: fast/multicol/column-span-parent-continuation-crash.html + + * rendering/RenderBlock.cpp: + (WebCore::RenderBlock::columnsBlockForSpanningElement): + 2011-08-30 Abhishek Arya Removed m_owner accessed in custom scrollbars. diff --git a/src/3rdparty/webkit/Source/WebCore/accessibility/AccessibilityRenderObject.cpp b/src/3rdparty/webkit/Source/WebCore/accessibility/AccessibilityRenderObject.cpp index 25078c5..9725a6b 100644 --- a/src/3rdparty/webkit/Source/WebCore/accessibility/AccessibilityRenderObject.cpp +++ b/src/3rdparty/webkit/Source/WebCore/accessibility/AccessibilityRenderObject.cpp @@ -302,8 +302,12 @@ AccessibilityObject* AccessibilityRenderObject::previousSibling() const // Case 2: Anonymous block parent of the end of a continuation - skip all the way to before // the parent of the start, since everything in between will be linked up via the continuation. - else if (m_renderer->isAnonymousBlock() && firstChildIsInlineContinuation(m_renderer)) - previousSibling = startOfContinuations(m_renderer->firstChild())->parent()->previousSibling(); + else if (m_renderer->isAnonymousBlock() && firstChildIsInlineContinuation(m_renderer)) { + RenderObject* firstParent = startOfContinuations(m_renderer->firstChild())->parent(); + while (firstChildIsInlineContinuation(firstParent)) + firstParent = startOfContinuations(firstParent->firstChild())->parent(); + previousSibling = firstParent->previousSibling(); + } // Case 3: The node has an actual previous sibling else if (RenderObject* ps = m_renderer->previousSibling()) @@ -340,8 +344,12 @@ AccessibilityObject* AccessibilityRenderObject::nextSibling() const // Case 2: Anonymous block parent of the start of a continuation - skip all the way to // after the parent of the end, since everything in between will be linked up via the continuation. - else if (m_renderer->isAnonymousBlock() && lastChildHasContinuation(m_renderer)) - nextSibling = endOfContinuations(m_renderer->lastChild())->parent()->nextSibling(); + else if (m_renderer->isAnonymousBlock() && lastChildHasContinuation(m_renderer)) { + RenderObject* lastParent = endOfContinuations(m_renderer->lastChild())->parent(); + while (lastChildHasContinuation(lastParent)) + lastParent = endOfContinuations(lastParent->lastChild())->parent(); + nextSibling = lastParent->nextSibling(); + } // Case 3: node has an actual next sibling else if (RenderObject* ns = m_renderer->nextSibling()) diff --git a/src/3rdparty/webkit/Source/WebCore/bindings/ScriptControllerBase.cpp b/src/3rdparty/webkit/Source/WebCore/bindings/ScriptControllerBase.cpp index 4190637..254a6c2 100644 --- a/src/3rdparty/webkit/Source/WebCore/bindings/ScriptControllerBase.cpp +++ b/src/3rdparty/webkit/Source/WebCore/bindings/ScriptControllerBase.cpp @@ -59,6 +59,8 @@ ScriptValue ScriptController::executeScript(const ScriptSourceCode& sourceCode) bool wasInExecuteScript = m_inExecuteScript; m_inExecuteScript = true; + RefPtr protect(m_frame); // Script execution can destroy the frame, and thus the ScriptController. + ScriptValue result = evaluate(sourceCode); if (!wasInExecuteScript) { diff --git a/src/3rdparty/webkit/Source/WebCore/platform/graphics/Gradient.cpp b/src/3rdparty/webkit/Source/WebCore/platform/graphics/Gradient.cpp index 7e3984f..fc7b741 100644 --- a/src/3rdparty/webkit/Source/WebCore/platform/graphics/Gradient.cpp +++ b/src/3rdparty/webkit/Source/WebCore/platform/graphics/Gradient.cpp @@ -124,10 +124,6 @@ void Gradient::sortStopsIfNecessary() if (!m_stops.size()) return; - // Shortcut for the ideal case (ordered 2-stop gradient) - if (m_stops.size() == 2 && compareStops(*m_stops.begin(), *m_stops.end())) - return; - std::stable_sort(m_stops.begin(), m_stops.end(), compareStops); } diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/RenderBlock.cpp b/src/3rdparty/webkit/Source/WebCore/rendering/RenderBlock.cpp index df30adb..4ad1bfe 100644 --- a/src/3rdparty/webkit/Source/WebCore/rendering/RenderBlock.cpp +++ b/src/3rdparty/webkit/Source/WebCore/rendering/RenderBlock.cpp @@ -241,21 +241,7 @@ void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldSty } } - // FIXME: We could save this call when the change only affected non-inherited properties - for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { - if (child->isAnonymousBlock()) { - RefPtr newStyle = RenderStyle::createAnonymousStyle(style()); - if (style()->specifiesColumns()) { - if (child->style()->specifiesColumns()) - newStyle->inheritColumnPropertiesFrom(style()); - if (child->style()->columnSpan()) - newStyle->setColumnSpan(true); - } - newStyle->setDisplay(BLOCK); - child->setStyle(newStyle.release()); - } - } - + propagateStyleToAnonymousChildren(true); m_lineHeight = -1; // Update pseudos for :before and :after now. @@ -654,8 +640,22 @@ RenderBlock* RenderBlock::columnsBlockForSpanningElement(RenderObject* newChild) && !newChild->isInline() && !isAnonymousColumnSpanBlock()) { if (style()->specifiesColumns()) columnsBlockAncestor = this; - else if (!isInline() && parent() && parent()->isRenderBlock()) + else if (!isInline() && parent() && parent()->isRenderBlock()) { columnsBlockAncestor = toRenderBlock(parent())->containingColumnsBlock(false); + + if (columnsBlockAncestor) { + // Make sure that none of the parent ancestors have a continuation. + // If yes, we do not want split the block into continuations. + RenderObject* curr = this; + while (curr && curr != columnsBlockAncestor) { + if (curr->isRenderBlock() && toRenderBlock(curr)->continuation()) { + columnsBlockAncestor = 0; + break; + } + curr = curr->parent(); + } + } + } } return columnsBlockAncestor; } diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/RenderObject.cpp b/src/3rdparty/webkit/Source/WebCore/rendering/RenderObject.cpp index a81e668..c1f5ba0 100644 --- a/src/3rdparty/webkit/Source/WebCore/rendering/RenderObject.cpp +++ b/src/3rdparty/webkit/Source/WebCore/rendering/RenderObject.cpp @@ -1811,6 +1811,24 @@ void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldSt } } +void RenderObject::propagateStyleToAnonymousChildren(bool blockChildrenOnly) +{ + // FIXME: We could save this call when the change only affected non-inherited properties. + for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { + if (blockChildrenOnly ? child->isAnonymousBlock() : child->isAnonymous() && !child->isBeforeOrAfterContent()) { + RefPtr newStyle = RenderStyle::createAnonymousStyle(style()); + if (style()->specifiesColumns()) { + if (child->style()->specifiesColumns()) + newStyle->inheritColumnPropertiesFrom(style()); + if (child->style()->columnSpan()) + newStyle->setColumnSpan(true); + } + newStyle->setDisplay(blockChildrenOnly ? BLOCK : child->style()->display()); + child->setStyle(newStyle.release()); + } + } +} + void RenderObject::updateFillImages(const FillLayer* oldLayers, const FillLayer* newLayers) { // Optimize the common case diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/RenderObject.h b/src/3rdparty/webkit/Source/WebCore/rendering/RenderObject.h index 44ee43c..2ba0114 100644 --- a/src/3rdparty/webkit/Source/WebCore/rendering/RenderObject.h +++ b/src/3rdparty/webkit/Source/WebCore/rendering/RenderObject.h @@ -322,8 +322,10 @@ public: inline bool isBeforeContent() const; inline bool isAfterContent() const; + inline bool isBeforeOrAfterContent() const; static inline bool isBeforeContent(const RenderObject* obj) { return obj && obj->isBeforeContent(); } static inline bool isAfterContent(const RenderObject* obj) { return obj && obj->isAfterContent(); } + static inline bool isBeforeOrAfterContent(const RenderObject* obj) { return obj && obj->isBeforeOrAfterContent(); } bool childrenInline() const { return m_childrenInline; } void setChildrenInline(bool b = true) { m_childrenInline = b; } @@ -791,6 +793,7 @@ protected: virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle); // Overrides should call the superclass at the start virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); + void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false); void drawLineForBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, BoxSide, Color, EBorderStyle, int adjbw1, int adjbw2, bool antialias = false); @@ -932,6 +935,11 @@ inline bool RenderObject::isAfterContent() const return true; } +inline bool RenderObject::isBeforeOrAfterContent() const +{ + return isBeforeContent() || isAfterContent(); +} + inline void RenderObject::setNeedsLayout(bool b, bool markParents) { bool alreadyNeededLayout = m_needsLayout; diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/RenderObjectChildList.cpp b/src/3rdparty/webkit/Source/WebCore/rendering/RenderObjectChildList.cpp index a6c2da9..28703c5 100644 --- a/src/3rdparty/webkit/Source/WebCore/rendering/RenderObjectChildList.cpp +++ b/src/3rdparty/webkit/Source/WebCore/rendering/RenderObjectChildList.cpp @@ -271,7 +271,12 @@ RenderObject* RenderObjectChildList::beforePseudoElementRenderer(const RenderObj do { // Skip list markers and generated run-ins first = first->firstChild(); - while (first && (first->isListMarker() || (first->isRenderInline() && first->isRunIn() && first->isAnonymous()))) + while (first && first->isListMarker()) { + if (first->parent() != owner && first->parent()->isAnonymousBlock()) + first = first->parent(); + first = first->nextSibling(); + } + while (first && first->isRenderInline() && first->isRunIn()) first = first->nextSibling(); } while (first && first->isAnonymous() && first->style()->styleType() == NOPSEUDO); @@ -293,7 +298,7 @@ RenderObject* RenderObjectChildList::beforePseudoElementRenderer(const RenderObj // We still need to skip any list markers that could exist before the run-in. while (first && first->isListMarker()) first = first->nextSibling(); - if (first && first->style()->styleType() == BEFORE && first->isRenderInline() && first->isRunIn() && first->isAnonymous()) + if (first && first->style()->styleType() == BEFORE && first->isRenderInline() && first->isRunIn()) return first; } return 0; diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/RenderRuby.cpp b/src/3rdparty/webkit/Source/WebCore/rendering/RenderRuby.cpp index e0137de..41604d6 100644 --- a/src/3rdparty/webkit/Source/WebCore/rendering/RenderRuby.cpp +++ b/src/3rdparty/webkit/Source/WebCore/rendering/RenderRuby.cpp @@ -119,6 +119,12 @@ RenderRubyAsInline::~RenderRubyAsInline() { } +void RenderRubyAsInline::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) +{ + RenderInline::styleDidChange(diff, oldStyle); + propagateStyleToAnonymousChildren(); +} + void RenderRubyAsInline::addChild(RenderObject* child, RenderObject* beforeChild) { // Insert :before and :after content before/after the RenderRubyRun(s) @@ -220,6 +226,12 @@ RenderRubyAsBlock::~RenderRubyAsBlock() { } +void RenderRubyAsBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) +{ + RenderBlock::styleDidChange(diff, oldStyle); + propagateStyleToAnonymousChildren(); +} + void RenderRubyAsBlock::addChild(RenderObject* child, RenderObject* beforeChild) { // Insert :before and :after content before/after the RenderRubyRun(s) diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/RenderRuby.h b/src/3rdparty/webkit/Source/WebCore/rendering/RenderRuby.h index 24ac0db..2ab964c 100644 --- a/src/3rdparty/webkit/Source/WebCore/rendering/RenderRuby.h +++ b/src/3rdparty/webkit/Source/WebCore/rendering/RenderRuby.h @@ -59,6 +59,9 @@ public: virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0); virtual void removeChild(RenderObject* child); +protected: + virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); + private: virtual bool isRuby() const { return true; } virtual const char* renderName() const { return "RenderRuby (inline)"; } @@ -75,6 +78,9 @@ public: virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0); virtual void removeChild(RenderObject* child); +protected: + virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); + private: virtual bool isRuby() const { return true; } virtual const char* renderName() const { return "RenderRuby (block)"; } diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/RenderTable.cpp b/src/3rdparty/webkit/Source/WebCore/rendering/RenderTable.cpp index 4e90ffc..73b0801 100644 --- a/src/3rdparty/webkit/Source/WebCore/rendering/RenderTable.cpp +++ b/src/3rdparty/webkit/Source/WebCore/rendering/RenderTable.cpp @@ -73,6 +73,7 @@ RenderTable::~RenderTable() void RenderTable::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) { RenderBlock::styleDidChange(diff, oldStyle); + propagateStyleToAnonymousChildren(); ETableLayout oldTableLayout = oldStyle ? oldStyle->tableLayout() : TAUTO; diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableRow.cpp b/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableRow.cpp index dd44577..686bc3a 100644 --- a/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableRow.cpp +++ b/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableRow.cpp @@ -74,10 +74,10 @@ void RenderTableRow::updateBeforeAndAfterContent() void RenderTableRow::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) { RenderBox::styleDidChange(diff, oldStyle); + propagateStyleToAnonymousChildren(); if (parent()) updateBeforeAndAfterContent(); - } void RenderTableRow::addChild(RenderObject* child, RenderObject* beforeChild) @@ -90,7 +90,7 @@ void RenderTableRow::addChild(RenderObject* child, RenderObject* beforeChild) RenderObject* last = beforeChild; if (!last) last = lastChild(); - if (last && last->isAnonymous() && last->isTableCell() && !isAfterContent(last) && !isBeforeContent(last)) { + if (last && last->isAnonymous() && last->isTableCell() && !last->isBeforeOrAfterContent()) { if (beforeChild == last) beforeChild = last->firstChild(); last->addChild(child, beforeChild); @@ -98,7 +98,7 @@ void RenderTableRow::addChild(RenderObject* child, RenderObject* beforeChild) } // If beforeChild is inside an anonymous cell, insert into the cell. - if (last && !last->isTableCell() && last->parent() && last->parent()->isAnonymous() && !isAfterContent(last->parent()) && !isBeforeContent(last->parent())) { + if (last && !last->isTableCell() && last->parent() && last->parent()->isAnonymous() && !last->parent()->isBeforeOrAfterContent()) { last->parent()->addChild(child, beforeChild); return; } diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.cpp b/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.cpp index 3f84404..7d414a0 100644 --- a/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.cpp +++ b/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.cpp @@ -74,6 +74,12 @@ RenderTableSection::~RenderTableSection() clearGrid(); } +void RenderTableSection::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) +{ + RenderBox::styleDidChange(diff, oldStyle); + propagateStyleToAnonymousChildren(); +} + void RenderTableSection::destroy() { RenderTable* recalcTable = table(); @@ -96,7 +102,7 @@ void RenderTableSection::addChild(RenderObject* child, RenderObject* beforeChild RenderObject* last = beforeChild; if (!last) last = lastChild(); - if (last && last->isAnonymous() && !isAfterContent(last) && !isBeforeContent(last)) { + if (last && last->isAnonymous() && !last->isBeforeOrAfterContent()) { if (beforeChild == last) beforeChild = last->firstChild(); last->addChild(child, beforeChild); @@ -108,7 +114,7 @@ void RenderTableSection::addChild(RenderObject* child, RenderObject* beforeChild RenderObject* lastBox = last; while (lastBox && lastBox->parent()->isAnonymous() && !lastBox->isTableRow()) lastBox = lastBox->parent(); - if (lastBox && lastBox->isAnonymous() && !isAfterContent(lastBox) && !isBeforeContent(lastBox)) { + if (lastBox && lastBox->isAnonymous() && !lastBox->isBeforeOrAfterContent()) { lastBox->addChild(child, beforeChild); return; } diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.h b/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.h index cc969e8..db6edc2 100644 --- a/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.h +++ b/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.h @@ -118,6 +118,9 @@ public: int getBaseline(int row) { return m_grid[row].baseline; } +protected: + virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); + private: virtual RenderObjectChildList* virtualChildren() { return children(); } virtual const RenderObjectChildList* virtualChildren() const { return children(); } diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp b/src/3rdparty/webkit/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp index 79e8e1e..db4027b 100644 --- a/src/3rdparty/webkit/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp +++ b/src/3rdparty/webkit/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp @@ -168,7 +168,7 @@ void RenderSVGResourceContainer::registerResource() const SVGDocumentExtensions::SVGPendingElements::const_iterator end = clients->end(); for (SVGDocumentExtensions::SVGPendingElements::const_iterator it = clients->begin(); it != end; ++it) { ASSERT((*it)->hasPendingResources()); - (*it)->setHasPendingResources(false); + (*it)->clearHasPendingResourcesIfPossible(); RenderObject* renderer = (*it)->renderer(); if (!renderer) continue; diff --git a/src/3rdparty/webkit/Source/WebCore/svg/SVGDocumentExtensions.cpp b/src/3rdparty/webkit/Source/WebCore/svg/SVGDocumentExtensions.cpp old mode 100644 new mode 100755 index d74f646..4b339ca --- a/src/3rdparty/webkit/Source/WebCore/svg/SVGDocumentExtensions.cpp +++ b/src/3rdparty/webkit/Source/WebCore/svg/SVGDocumentExtensions.cpp @@ -227,7 +227,7 @@ void SVGDocumentExtensions::addPendingResource(const AtomicString& id, SVGStyled m_pendingResources.add(id, set); } - element->setHasPendingResources(true); + element->setHasPendingResources(); } bool SVGDocumentExtensions::hasPendingResources(const AtomicString& id) const @@ -238,6 +238,24 @@ bool SVGDocumentExtensions::hasPendingResources(const AtomicString& id) const return m_pendingResources.contains(id); } +bool SVGDocumentExtensions::isElementInPendingResources(SVGStyledElement* element) const +{ + ASSERT(element); + + if (m_pendingResources.isEmpty()) + return false; + + HashMap::const_iterator end = m_pendingResources.end(); + for (HashMap::const_iterator it = m_pendingResources.begin(); it != end; ++it) { + SVGPendingElements* elements = it->second; + ASSERT(elements); + + if (elements->contains(element)) + return true; + } + return false; +} + void SVGDocumentExtensions::removeElementFromPendingResources(SVGStyledElement* element) { ASSERT(element); @@ -245,8 +263,6 @@ void SVGDocumentExtensions::removeElementFromPendingResources(SVGStyledElement* if (m_pendingResources.isEmpty() || !element->hasPendingResources()) return; - element->setHasPendingResources(false); - Vector toBeRemoved; HashMap::iterator end = m_pendingResources.end(); for (HashMap::iterator it = m_pendingResources.begin(); it != end; ++it) { @@ -259,6 +275,8 @@ void SVGDocumentExtensions::removeElementFromPendingResources(SVGStyledElement* toBeRemoved.append(it->first); } + element->clearHasPendingResourcesIfPossible(); + if (toBeRemoved.isEmpty()) return; diff --git a/src/3rdparty/webkit/Source/WebCore/svg/SVGDocumentExtensions.h b/src/3rdparty/webkit/Source/WebCore/svg/SVGDocumentExtensions.h old mode 100644 new mode 100755 index a66b066..8ad44f8 --- a/src/3rdparty/webkit/Source/WebCore/svg/SVGDocumentExtensions.h +++ b/src/3rdparty/webkit/Source/WebCore/svg/SVGDocumentExtensions.h @@ -81,6 +81,7 @@ public: // For instance, dynamically build gradients / patterns / clippers... void addPendingResource(const AtomicString& id, SVGStyledElement*); bool hasPendingResources(const AtomicString& id) const; + bool isElementInPendingResources(SVGStyledElement*) const; void removeElementFromPendingResources(SVGStyledElement*); PassOwnPtr removePendingResource(const AtomicString& id); }; diff --git a/src/3rdparty/webkit/Source/WebCore/svg/SVGStyledElement.cpp b/src/3rdparty/webkit/Source/WebCore/svg/SVGStyledElement.cpp old mode 100644 new mode 100755 index c1a6449..0693eb0 --- a/src/3rdparty/webkit/Source/WebCore/svg/SVGStyledElement.cpp +++ b/src/3rdparty/webkit/Source/WebCore/svg/SVGStyledElement.cpp @@ -380,7 +380,7 @@ void SVGStyledElement::insertedIntoDocument() for (SVGDocumentExtensions::SVGPendingElements::const_iterator it = clients->begin(); it != end; ++it) { ASSERT((*it)->hasPendingResources()); (*it)->buildPendingResource(); - (*it)->setHasPendingResources(false); + (*it)->clearHasPendingResourcesIfPossible(); } } @@ -453,9 +453,15 @@ bool SVGStyledElement::hasPendingResources() const return hasRareSVGData() && rareSVGData()->hasPendingResources(); } -void SVGStyledElement::setHasPendingResources(bool value) +void SVGStyledElement::setHasPendingResources() { - ensureRareSVGData()->setHasPendingResources(value); + ensureRareSVGData()->setHasPendingResources(true); +} + +void SVGStyledElement::clearHasPendingResourcesIfPossible() +{ + if (!document()->accessSVGExtensions()->isElementInPendingResources(this)) + ensureRareSVGData()->setHasPendingResources(false); } AffineTransform SVGStyledElement::localCoordinateSpaceTransform(SVGLocatable::CTMScope) const diff --git a/src/3rdparty/webkit/Source/WebCore/svg/SVGStyledElement.h b/src/3rdparty/webkit/Source/WebCore/svg/SVGStyledElement.h old mode 100644 new mode 100755 index f48513c..fdad347 --- a/src/3rdparty/webkit/Source/WebCore/svg/SVGStyledElement.h +++ b/src/3rdparty/webkit/Source/WebCore/svg/SVGStyledElement.h @@ -53,7 +53,8 @@ public: void setInstanceUpdatesBlocked(bool); bool hasPendingResources() const; - void setHasPendingResources(bool); + void setHasPendingResources(); + void clearHasPendingResourcesIfPossible(); AnimatedAttributeType animatedPropertyTypeForCSSProperty(const QualifiedName&); static bool isAnimatableCSSProperty(const QualifiedName&); diff --git a/src/3rdparty/webkit/Source/WebCore/svg/SVGUseElement.cpp b/src/3rdparty/webkit/Source/WebCore/svg/SVGUseElement.cpp index d8f9674..7de1f4c 100644 --- a/src/3rdparty/webkit/Source/WebCore/svg/SVGUseElement.cpp +++ b/src/3rdparty/webkit/Source/WebCore/svg/SVGUseElement.cpp @@ -172,11 +172,11 @@ void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName) const SVGDocumentExtensions::SVGPendingElements::const_iterator end = clients->end(); for (SVGDocumentExtensions::SVGPendingElements::const_iterator it = clients->begin(); it != end; ++it) { ASSERT((*it)->hasPendingResources()); - (*it)->setHasPendingResources(false); + (*it)->clearHasPendingResourcesIfPossible(); } m_resourceId = String(); - setHasPendingResources(false); + clearHasPendingResourcesIfPossible(); } invalidateShadowTree(); diff --git a/src/3rdparty/webkit/Source/WebKit/qt/ChangeLog b/src/3rdparty/webkit/Source/WebKit/qt/ChangeLog index 4758de0..32428f1 100644 --- a/src/3rdparty/webkit/Source/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/Source/WebKit/qt/ChangeLog @@ -1,3 +1,13 @@ +2011-09-06 Ademar de Souza Reis Jr. + + [Qt][Symbian] REGRESSION[94105] DumpRenderTree.exe doesn't build on Symbian + https://bugs.webkit.org/show_bug.cgi?id=67644 + + Reviewed by Csaba Osztrogonác. + + * symbian/eabi/QtWebKitu.def: add missing entry for + FrameLoaderClientQt::dumpProgressFinishedCallback(bool) + 2011-08-31 Caio Marcelo de Oliveira Filho [Qt] Unskip API test for load signals order diff --git a/src/3rdparty/webkit/Source/WebKit/qt/symbian/eabi/QtWebKitu.def b/src/3rdparty/webkit/Source/WebKit/qt/symbian/eabi/QtWebKitu.def index 0a1c6cb..b67d3f8 100644 --- a/src/3rdparty/webkit/Source/WebKit/qt/symbian/eabi/QtWebKitu.def +++ b/src/3rdparty/webkit/Source/WebKit/qt/symbian/eabi/QtWebKitu.def @@ -880,3 +880,4 @@ EXPORTS _ZN8QDRTNodeaSERKS_ @ 879 NONAME _ZN23DumpRenderTreeSupportQt21injectInternalsObjectEP9QWebFrame @ 880 NONAME _ZN23DumpRenderTreeSupportQt20resetInternalsObjectEP9QWebFrame @ 881 NONAME + _ZN23DumpRenderTreeSupportQt28dumpProgressFinishedCallbackEb @ 882 NONAME diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index aeaa22c..6a40345 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from and has the sha1 checksum - a2bd2bb1b19949c6807da38e25bfa7d210bb4b17 + 64cce100215c71575f19ca0b090c65fa97d4ba10 -- cgit v0.12 From 44d30ae2968846bd820b8bb5d1128a8b7a2d4207 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 14 Sep 2011 18:11:35 +1000 Subject: Fix crash in compiled bindings Task-number: QTBUG-21265 --- src/declarative/qml/qdeclarativecompiledbindings.cpp | 12 ++++++++++-- src/declarative/qml/qdeclarativecompiledbindings_p.h | 2 +- src/declarative/qml/qdeclarativevme.cpp | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/declarative/qml/qdeclarativecompiledbindings.cpp b/src/declarative/qml/qdeclarativecompiledbindings.cpp index 51ffc10..72a3e53 100644 --- a/src/declarative/qml/qdeclarativecompiledbindings.cpp +++ b/src/declarative/qml/qdeclarativecompiledbindings.cpp @@ -235,6 +235,7 @@ public: void run(Binding *, QDeclarativePropertyPrivate::WriteFlags flags); const char *programData; + QDeclarativeRefCount *dataRef; Binding *m_bindings; quint32 *m_signalTable; @@ -267,7 +268,7 @@ public: }; QDeclarativeCompiledBindingsPrivate::QDeclarativeCompiledBindingsPrivate() -: subscriptions(0), identifiers(0) +: subscriptions(0), identifiers(0), programData(0), dataRef(0), m_bindings(0), m_signalTable(0) { } @@ -275,11 +276,16 @@ QDeclarativeCompiledBindingsPrivate::~QDeclarativeCompiledBindingsPrivate() { delete [] subscriptions; subscriptions = 0; delete [] identifiers; identifiers = 0; + if (dataRef) { + dataRef->release(); + dataRef = 0; + } } int QDeclarativeCompiledBindingsPrivate::methodCount = -1; -QDeclarativeCompiledBindings::QDeclarativeCompiledBindings(const char *program, QDeclarativeContextData *context) +QDeclarativeCompiledBindings::QDeclarativeCompiledBindings(const char *program, QDeclarativeContextData *context, + QDeclarativeRefCount *dataRef) : QObject(*(new QDeclarativeCompiledBindingsPrivate)) { Q_D(QDeclarativeCompiledBindings); @@ -288,6 +294,8 @@ QDeclarativeCompiledBindings::QDeclarativeCompiledBindings(const char *program, d->methodCount = QDeclarativeCompiledBindings::staticMetaObject.methodCount(); d->programData = program; + d->dataRef = dataRef; + if (d->dataRef) d->dataRef->addref(); d->init(); diff --git a/src/declarative/qml/qdeclarativecompiledbindings_p.h b/src/declarative/qml/qdeclarativecompiledbindings_p.h index e7b6937..8ec0ac3 100644 --- a/src/declarative/qml/qdeclarativecompiledbindings_p.h +++ b/src/declarative/qml/qdeclarativecompiledbindings_p.h @@ -95,7 +95,7 @@ class QDeclarativeCompiledBindingsPrivate; class QDeclarativeCompiledBindings : public QObject, public QDeclarativeAbstractExpression, public QDeclarativeRefCount { public: - QDeclarativeCompiledBindings(const char *program, QDeclarativeContextData *context); + QDeclarativeCompiledBindings(const char *program, QDeclarativeContextData *context, QDeclarativeRefCount *); virtual ~QDeclarativeCompiledBindings(); QDeclarativeAbstractBinding *configBinding(int index, QObject *target, QObject *scope, int property); diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp index a23f89d..8cf97d2 100644 --- a/src/declarative/qml/qdeclarativevme.cpp +++ b/src/declarative/qml/qdeclarativevme.cpp @@ -209,7 +209,7 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEObjectStack &stack, if (instr.init.contextCache != -1) ctxt->setIdPropertyData(comp->contextCaches.at(instr.init.contextCache)); if (instr.init.compiledBinding != -1) - ctxt->optimizedBindings = new QDeclarativeCompiledBindings(datas.at(instr.init.compiledBinding).constData(), ctxt); + ctxt->optimizedBindings = new QDeclarativeCompiledBindings(datas.at(instr.init.compiledBinding).constData(), ctxt, comp); } break; -- cgit v0.12 From e29af89ec3655188e00def7234bf7181d070b09b Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 14 Sep 2011 17:14:53 +0200 Subject: Update changes file. --- dist/changes-4.8.0 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.8.0 b/dist/changes-4.8.0 index b8e3842..2d46a26 100644 --- a/dist/changes-4.8.0 +++ b/dist/changes-4.8.0 @@ -223,7 +223,8 @@ Qt for Windows CE - qmake - + * Implemented "aux" template that allows making use of the INSTALLS variable + without building anything. Needed for projects with QML entry point. - configure -- cgit v0.12