diff options
author | Martin Smith <martin.smith@nokia.com> | 2010-08-11 13:33:34 (GMT) |
---|---|---|
committer | Martin Smith <martin.smith@nokia.com> | 2010-08-11 13:33:34 (GMT) |
commit | add515dc7fefd1c6b07ab75d94d033f145293ee4 (patch) | |
tree | ccd7a18d389b6fe3764f6a4f07e0045abe2185bb | |
parent | a4d19eef86b07d670b8b2a3f9ad6b3448800bae5 (diff) | |
parent | 59f01a1efe818004fdc9265af6a0e9a05c43932a (diff) | |
download | Qt-add515dc7fefd1c6b07ab75d94d033f145293ee4.zip Qt-add515dc7fefd1c6b07ab75d94d033f145293ee4.tar.gz Qt-add515dc7fefd1c6b07ab75d94d033f145293ee4.tar.bz2 |
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
-rw-r--r-- | doc/src/legal/licenses.qdoc | 46 | ||||
-rw-r--r-- | doc/src/snippets/legal/CatharonLicense.txt | 123 | ||||
-rwxr-xr-x | doc/src/template/style/style.css | 4 | ||||
-rw-r--r-- | examples/phonon/qmusicplayer/mainwindow.cpp | 2 | ||||
-rw-r--r-- | src/corelib/xml/qxmlstream.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qdrawhelper_p.h | 140 | ||||
-rw-r--r-- | src/gui/styles/qstylesheetstyle.cpp | 2 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket_openssl_symbols.cpp | 121 | ||||
-rw-r--r-- | tests/auto/qsslcertificate/more-certificates/cert-large-expiration-date.pem | 15 | ||||
-rw-r--r-- | tests/auto/qsslcertificate/tst_qsslcertificate.cpp | 15 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 24 | ||||
-rw-r--r-- | tools/qdoc3/test/qt-html-templates.qdocconf | 3 |
12 files changed, 347 insertions, 150 deletions
diff --git a/doc/src/legal/licenses.qdoc b/doc/src/legal/licenses.qdoc index a04a256..12aca6b 100644 --- a/doc/src/legal/licenses.qdoc +++ b/doc/src/legal/licenses.qdoc @@ -262,14 +262,14 @@ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\br - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer.\br - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution.\br - * Neither the name of Research In Motion Limited nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer.\br + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution.\br + * Neither the name of Research In Motion Limited nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY Research In Motion Limited ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -476,6 +476,24 @@ \hr + Copyright 2001, 2002 Catharon Productions Inc. + + This file is part of the Catharon Typography Project and shall only + be used, modified, and distributed under the terms of the Catharon + Open Source License that should come with this file under the name + `CatharonLicense.txt'. By continuing to use, modify, or distribute + this file you indicate that you have read the license and + understand and accept it fully. + + Note that this license is compatible with the FreeType license. + + \list + \o Included in the build system of the FreeType library + \o See \l{CatharonLicense.txt} for more information + \endlist + + \hr + Copyright (C) 2006 Apple Computer, Inc. All rights reserved.\br Copyright (C) 2007 Eric Seidel <eric@webkit.org>\br Copyright (C) 2008 Kelvin W Sherlock (ksherlock@gmail.com)\br @@ -987,3 +1005,15 @@ and have given a quick thought about whether Roman might perhaps be interested to read what you did with his stuff. Horizontal rules don't apply.} */ + +/*! + \page catharon-license.html + \title CatharonLicense.txt + \ingroup licensing + \brief The Catharon License used in parts of FreeType. + + See the \l{Other Licenses Used in Qt} document for information on the + context in which this license is applied to code in the FreeType library. + + \quotefile doc/src/snippets/legal/CatharonLicense.txt +*/ diff --git a/doc/src/snippets/legal/CatharonLicense.txt b/doc/src/snippets/legal/CatharonLicense.txt new file mode 100644 index 0000000..789c8c9 --- /dev/null +++ b/doc/src/snippets/legal/CatharonLicense.txt @@ -0,0 +1,123 @@ + The Catharon Open Source LICENSE + ---------------------------- + + 2000-Jul-04 + + Copyright (C) 2000 by Catharon Productions, Inc. + + + +Introduction +============ + + This license applies to source files distributed by Catharon + Productions, Inc. in several archive packages. This license + applies to all files found in such packages which do not fall + under their own explicit license. + + This license was inspired by the BSD, Artistic, and IJG + (Independent JPEG Group) licenses, which all encourage inclusion + and use of free software in commercial and freeware products + alike. As a consequence, its main points are that: + + o We don't promise that this software works. However, we are + interested in any kind of bug reports. (`as is' distribution) + + o You can use this software for whatever you want, in parts or + full form, without having to pay us. (`royalty-free' usage) + + o You may not pretend that you wrote this software. If you use + it, or only parts of it, in a program, you must acknowledge + somewhere in your documentation that you have used the + Catharon Code. (`credits') + + We specifically permit and encourage the inclusion of this + software, with or without modifications, in commercial products. + We disclaim all warranties covering the packages distributed by + Catharon Productions, Inc. and assume no liability related to + their use. + + +Legal Terms +=========== + +0. Definitions +-------------- + + Throughout this license, the terms `Catharon Package', `package', + and `Catharon Code' refer to the set of files originally + distributed by Catharon Productions, Inc. + + `You' refers to the licensee, or person using the project, where + `using' is a generic term including compiling the project's source + code as well as linking it to form a `program' or `executable'. + This program is referred to as `a program using one of the + Catharon Packages'. + + This license applies to all files distributed in the original + Catharon Package(s), including all source code, binaries and + documentation, unless otherwise stated in the file in its + original, unmodified form as distributed in the original archive. + If you are unsure whether or not a particular file is covered by + this license, you must contact us to verify this. + + The Catharon Packages are copyright (C) 2000 by Catharon + Productions, Inc. All rights reserved except as specified below. + +1. No Warranty +-------------- + + THE CATHARON PACKAGES ARE PROVIDED `AS IS' WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OF OR THE INABILITY TO + USE THE CATHARON PACKAGE. + +2. Redistribution +----------------- + + This license grants a worldwide, royalty-free, perpetual and + irrevocable right and license to use, execute, perform, compile, + display, copy, create derivative works of, distribute and + sublicense the Catharon Packages (in both source and object code + forms) and derivative works thereof for any purpose; and to + authorize others to exercise some or all of the rights granted + herein, subject to the following conditions: + + o Redistribution of source code must retain this license file + (`license.txt') unaltered; any additions, deletions or changes + to the original files must be clearly indicated in + accompanying documentation. The copyright notices of the + unaltered, original files must be preserved in all copies of + source files. + + o Redistribution in binary form must provide a disclaimer that + states that the software is based in part on the work of + Catharon Productions, Inc. in the distribution documentation. + + These conditions apply to any software derived from or based on + the Catharon Packages, not just the unmodified files. If you use + our work, you must acknowledge us. However, no fee need be paid + to us. + +3. Advertising +-------------- + + Neither Catharon Productions, Inc. and contributors nor you shall + use the name of the other for commercial, advertising, or + promotional purposes without specific prior written permission. + + We suggest, but do not require, that you use the following phrase + to refer to this software in your documentation: 'this software is + based in part on the Catharon Typography Project'. + + As you have not signed this license, you are not required to + accept it. However, as the Catharon Packages are copyrighted + material, only this license, or another one contracted with the + authors, grants you the right to use, distribute, and modify it. + Therefore, by using, distributing, or modifying the Catharon + Packages, you indicate that you understand and accept all the + terms of this license. + +--- end of license.txt --- diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index d6b0fda..6a32e53 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -1375,7 +1375,7 @@ .creator .wrapper { position:relative; - top:50px; + top:5px; } .creator .wrapper .bd { @@ -1486,7 +1486,7 @@ - position:fixed; + /* position:fixed;*/ } diff --git a/examples/phonon/qmusicplayer/mainwindow.cpp b/examples/phonon/qmusicplayer/mainwindow.cpp index 4778138..0e8e780 100644 --- a/examples/phonon/qmusicplayer/mainwindow.cpp +++ b/examples/phonon/qmusicplayer/mainwindow.cpp @@ -248,7 +248,7 @@ void MainWindow::aboutToFinish() void MainWindow::setupActions() { playAction = new QAction(style()->standardIcon(QStyle::SP_MediaPlay), tr("Play"), this); - playAction->setShortcut(tr("Crl+P")); + playAction->setShortcut(tr("Ctrl+P")); playAction->setDisabled(true); pauseAction = new QAction(style()->standardIcon(QStyle::SP_MediaPause), tr("Pause"), this); pauseAction->setShortcut(tr("Ctrl+A")); diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index 853f311..91c3a19 100644 --- a/src/corelib/xml/qxmlstream.cpp +++ b/src/corelib/xml/qxmlstream.cpp @@ -1523,7 +1523,7 @@ ushort QXmlStreamReaderPrivate::getChar_helper() decoder = codec->makeDecoder(); } - decoder->toUnicode(&readBuffer, rawReadBuffer.data(), nbytesread); + decoder->toUnicode(&readBuffer, rawReadBuffer.constData(), nbytesread); if(lockEncoding && decoder->hasFailure()) { raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content.")); diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h index 1a87127..d04c70d 100644 --- a/src/gui/painting/qdrawhelper_p.h +++ b/src/gui/painting/qdrawhelper_p.h @@ -314,18 +314,61 @@ struct QSpanData void adjustSpanMethods(); }; +#if defined(Q_CC_RVCT) +# pragma push +# pragma arm +#endif +Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_255(uint x, uint a, uint y, uint b) { + uint t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; + t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8; + t &= 0xff00ff; -Q_STATIC_INLINE_FUNCTION uint BYTE_MUL_RGB16(uint x, uint a) { - a += 1; - uint t = (((x & 0x07e0)*a) >> 8) & 0x07e0; - t |= (((x & 0xf81f)*(a>>2)) >> 6) & 0xf81f; - return t; + x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; + x = (x + ((x >> 8) & 0xff00ff) + 0x800080); + x &= 0xff00ff00; + x |= t; + return x; } +#if defined(Q_CC_RVCT) +# pragma pop +#endif -Q_STATIC_INLINE_FUNCTION uint BYTE_MUL_RGB16_32(uint x, uint a) { - uint t = (((x & 0xf81f07e0) >> 5)*a) & 0xf81f07e0; - t |= (((x & 0x07e0f81f)*a) >> 5) & 0x07e0f81f; - return t; +#if QT_POINTER_SIZE == 8 // 64-bit versions + +Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b) { + quint64 t = (((quint64(x)) | ((quint64(x)) << 24)) & 0x00ff00ff00ff00ff) * a; + t += (((quint64(y)) | ((quint64(y)) << 24)) & 0x00ff00ff00ff00ff) * b; + t >>= 8; + t &= 0x00ff00ff00ff00ff; + return (uint(t)) | (uint(t >> 24)); +} + +Q_STATIC_INLINE_FUNCTION uint BYTE_MUL(uint x, uint a) { + quint64 t = (((quint64(x)) | ((quint64(x)) << 24)) & 0x00ff00ff00ff00ff) * a; + t = (t + ((t >> 8) & 0xff00ff00ff00ff) + 0x80008000800080) >> 8; + t &= 0x00ff00ff00ff00ff; + return (uint(t)) | (uint(t >> 24)); +} + +Q_STATIC_INLINE_FUNCTION uint PREMUL(uint x) { + uint a = x >> 24; + quint64 t = (((quint64(x)) | ((quint64(x)) << 24)) & 0x00ff00ff00ff00ff) * a; + t = (t + ((t >> 8) & 0xff00ff00ff00ff) + 0x80008000800080) >> 8; + t &= 0x000000ff00ff00ff; + return (uint(t)) | (uint(t >> 24)) | (a << 24); +} + +#else // 32-bit versions + +Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b) { + uint t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; + t >>= 8; + t &= 0xff00ff; + + x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; + x &= 0xff00ff00; + x |= t; + return x; } #if defined(Q_CC_RVCT) @@ -359,6 +402,21 @@ Q_STATIC_INLINE_FUNCTION uint PREMUL(uint x) { x |= t | (a << 24); return x; } +#endif + + +Q_STATIC_INLINE_FUNCTION uint BYTE_MUL_RGB16(uint x, uint a) { + a += 1; + uint t = (((x & 0x07e0)*a) >> 8) & 0x07e0; + t |= (((x & 0xf81f)*(a>>2)) >> 6) & 0xf81f; + return t; +} + +Q_STATIC_INLINE_FUNCTION uint BYTE_MUL_RGB16_32(uint x, uint a) { + uint t = (((x & 0xf81f07e0) >> 5)*a) & 0xf81f07e0; + t |= (((x & 0x07e0f81f)*a) >> 5) & 0x07e0f81f; + return t; +} #define INV_PREMUL(p) \ (qAlpha(p) == 0 ? 0 : \ @@ -1847,70 +1905,6 @@ inline int qBlue565(quint16 rgb) { return (b << 3) | (b >> 2); } -#if 1 -Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b) { - uint t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; - t >>= 8; - t &= 0xff00ff; - - x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; - x &= 0xff00ff00; - x |= t; - return x; -} - -#if defined(Q_CC_RVCT) -# pragma push -# pragma arm -#endif -Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_255(uint x, uint a, uint y, uint b) { - uint t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; - t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8; - t &= 0xff00ff; - - x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; - x = (x + ((x >> 8) & 0xff00ff) + 0x800080); - x &= 0xff00ff00; - x |= t; - return x; -} -#if defined(Q_CC_RVCT) -# pragma pop -#endif -#else -// possible implementation for 64 bit -Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b) { - ulong t = (((ulong(x)) | ((ulong(x)) << 24)) & 0x00ff00ff00ff00ff) * a; - t += (((ulong(y)) | ((ulong(y)) << 24)) & 0x00ff00ff00ff00ff) * b; - t >>= 8; - t &= 0x00ff00ff00ff00ff; - return (uint(t)) | (uint(t >> 24)); -} - -Q_STATIC_INLINE_FUNCTION uint INTERPOLATE_PIXEL_255(uint x, uint a, uint y, uint b) { - ulong t = (((ulong(x)) | ((ulong(x)) << 24)) & 0x00ff00ff00ff00ff) * a; - t += (((ulong(y)) | ((ulong(y)) << 24)) & 0x00ff00ff00ff00ff) * b; - t = (t + ((t >> 8) & 0xff00ff00ff00ff) + 0x80008000800080); - t &= 0x00ff00ff00ff00ff; - return (uint(t)) | (uint(t >> 24)); -} - -Q_STATIC_INLINE_FUNCTION uint BYTE_MUL(uint x, uint a) { - ulong t = (((ulong(x)) | ((ulong(x)) << 24)) & 0x00ff00ff00ff00ff) * a; - t = (t + ((t >> 8) & 0xff00ff00ff00ff) + 0x80008000800080); - t &= 0x00ff00ff00ff00ff; - return (uint(t)) | (uint(t >> 24)); -} - -Q_STATIC_INLINE_FUNCTION uint PREMUL(uint x) { - uint a = x >> 24; - ulong t = (((ulong(x)) | ((ulong(x)) << 24)) & 0x00ff00ff00ff00ff) * a; - t = (t + ((t >> 8) & 0xff00ff00ff00ff) + 0x80008000800080); - t &= 0x00ff00ff00ff00ff; - return (uint(t)) | (uint(t >> 24)) | 0xff000000; -} -#endif - const uint qt_bayer_matrix[16][16] = { { 0x1, 0xc0, 0x30, 0xf0, 0xc, 0xcc, 0x3c, 0xfc, 0x3, 0xc3, 0x33, 0xf3, 0xf, 0xcf, 0x3f, 0xff}, diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index dff525e..92e2c81 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -4094,7 +4094,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q if (pe1 != PseudoElement_None) { QRenderRule subRule = renderRule(w, opt, pe1); if (subRule.bg != 0 || subRule.hasDrawable()) { - //We test subRule.bg dirrectly because hasBackground() would return false for background:none. + //We test subRule.bg directly because hasBackground() would return false for background:none. //But we still don't want the default drawning in that case (example for QScrollBar::add-page) (task 198926) subRule.drawRule(p, opt->rect); } else if (fallback) { diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index 09ecd4d..d1225c1 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -761,74 +761,95 @@ bool q_resolveOpenSslSymbols() //============================================================================== QDateTime q_getTimeFromASN1(const ASN1_TIME *aTime) { - char lBuffer[24]; - char *pBuffer = lBuffer; - size_t lTimeLength = aTime->length; char *pString = (char *) aTime->data; if (aTime->type == V_ASN1_UTCTIME) { + + char lBuffer[24]; + char *pBuffer = lBuffer; + if ((lTimeLength < 11) || (lTimeLength > 17)) return QDateTime(); memcpy(pBuffer, pString, 10); pBuffer += 10; pString += 10; - } else { - if (lTimeLength < 13) - return QDateTime(); - - memcpy(pBuffer, pString, 12); - pBuffer += 12; - pString += 12; - } - if ((*pString == 'Z') || (*pString == '-') || (*pString == '+')) { - *pBuffer++ = '0'; - *pBuffer++ = '0'; - } else { - *pBuffer++ = *pString++; - *pBuffer++ = *pString++; - // Skip any fractional seconds... - if (*pString == '.') { - pString++; - while ((*pString >= '0') && (*pString <= '9')) + if ((*pString == 'Z') || (*pString == '-') || (*pString == '+')) { + *pBuffer++ = '0'; + *pBuffer++ = '0'; + } else { + *pBuffer++ = *pString++; + *pBuffer++ = *pString++; + // Skip any fractional seconds... + if (*pString == '.') { pString++; + while ((*pString >= '0') && (*pString <= '9')) + pString++; + } } - } - *pBuffer++ = 'Z'; - *pBuffer++ = '\0'; + *pBuffer++ = 'Z'; + *pBuffer++ = '\0'; - time_t lSecondsFromUCT; - if (*pString == 'Z') { - lSecondsFromUCT = 0; - } else { - if ((*pString != '+') && (*pString != '-')) - return QDateTime(); + time_t lSecondsFromUCT; + if (*pString == 'Z') { + lSecondsFromUCT = 0; + } else { + if ((*pString != '+') && (*pString != '-')) + return QDateTime(); + + lSecondsFromUCT = ((pString[1] - '0') * 10 + (pString[2] - '0')) * 60; + lSecondsFromUCT += (pString[3] - '0') * 10 + (pString[4] - '0'); + lSecondsFromUCT *= 60; + if (*pString == '-') + lSecondsFromUCT = -lSecondsFromUCT; + } + + tm lTime; + lTime.tm_sec = ((lBuffer[10] - '0') * 10) + (lBuffer[11] - '0'); + lTime.tm_min = ((lBuffer[8] - '0') * 10) + (lBuffer[9] - '0'); + lTime.tm_hour = ((lBuffer[6] - '0') * 10) + (lBuffer[7] - '0'); + lTime.tm_mday = ((lBuffer[4] - '0') * 10) + (lBuffer[5] - '0'); + lTime.tm_mon = (((lBuffer[2] - '0') * 10) + (lBuffer[3] - '0')) - 1; + lTime.tm_year = ((lBuffer[0] - '0') * 10) + (lBuffer[1] - '0'); + if (lTime.tm_year < 50) + lTime.tm_year += 100; // RFC 2459 + + QDate resDate(lTime.tm_year + 1900, lTime.tm_mon + 1, lTime.tm_mday); + QTime resTime(lTime.tm_hour, lTime.tm_min, lTime.tm_sec); + + QDateTime result(resDate, resTime, Qt::UTC); + result = result.addSecs(lSecondsFromUCT); + return result; + + } else if (aTime->type == V_ASN1_GENERALIZEDTIME) { - lSecondsFromUCT = ((pString[1] - '0') * 10 + (pString[2] - '0')) * 60; - lSecondsFromUCT += (pString[3] - '0') * 10 + (pString[4] - '0'); - lSecondsFromUCT *= 60; - if (*pString == '-') - lSecondsFromUCT = -lSecondsFromUCT; + if (lTimeLength < 15) + return QDateTime(); // hopefully never triggered + + // generalized time is always YYYYMMDDHHMMSSZ (RFC 2459, section 4.1.2.5.2) + tm lTime; + lTime.tm_sec = ((pString[12] - '0') * 10) + (pString[13] - '0'); + lTime.tm_min = ((pString[10] - '0') * 10) + (pString[11] - '0'); + lTime.tm_hour = ((pString[8] - '0') * 10) + (pString[9] - '0'); + lTime.tm_mday = ((pString[6] - '0') * 10) + (pString[7] - '0'); + lTime.tm_mon = (((pString[4] - '0') * 10) + (pString[5] - '0')); + lTime.tm_year = ((pString[0] - '0') * 1000) + ((pString[1] - '0') * 100) + + ((pString[2] - '0') * 10) + (pString[3] - '0'); + + QDate resDate(lTime.tm_year, lTime.tm_mon, lTime.tm_mday); + QTime resTime(lTime.tm_hour, lTime.tm_min, lTime.tm_sec); + + QDateTime result(resDate, resTime, Qt::UTC); + return result; + + } else { + qWarning("unsupported date format detected"); + return QDateTime(); } - tm lTime; - lTime.tm_sec = ((lBuffer[10] - '0') * 10) + (lBuffer[11] - '0'); - lTime.tm_min = ((lBuffer[8] - '0') * 10) + (lBuffer[9] - '0'); - lTime.tm_hour = ((lBuffer[6] - '0') * 10) + (lBuffer[7] - '0'); - lTime.tm_mday = ((lBuffer[4] - '0') * 10) + (lBuffer[5] - '0'); - lTime.tm_mon = (((lBuffer[2] - '0') * 10) + (lBuffer[3] - '0')) - 1; - lTime.tm_year = ((lBuffer[0] - '0') * 10) + (lBuffer[1] - '0'); - if (lTime.tm_year < 50) - lTime.tm_year += 100; // RFC 2459 - - QDate resDate(lTime.tm_year + 1900, lTime.tm_mon + 1, lTime.tm_mday); - QTime resTime(lTime.tm_hour, lTime.tm_min, lTime.tm_sec); - QDateTime result(resDate, resTime, Qt::UTC); - result = result.addSecs(lSecondsFromUCT); - return result; } QT_END_NAMESPACE diff --git a/tests/auto/qsslcertificate/more-certificates/cert-large-expiration-date.pem b/tests/auto/qsslcertificate/more-certificates/cert-large-expiration-date.pem new file mode 100644 index 0000000..416dd4d --- /dev/null +++ b/tests/auto/qsslcertificate/more-certificates/cert-large-expiration-date.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICWjCCAcOgAwIBAgIJAM7bMShFxAVAMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV +BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX +aWRnaXRzIFB0eSBMdGQwIBcNMTAwODA0MDk1MzQxWhgPMjA1MTA4MjkwOTUzNDFa +MEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJ +bnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ +AoGBAM2q22/WNMmn8cC+5EEYGeICySLmp9W6Ay6eKHr0Xxp3X3epETuPfvAuxp7r +OtkS18EMUegkUj8jw0IMEcbyHKFC/rTCaYOt93CxGBXMIChiMPAsFeYzGa/D6xzA +kfcRaJRQ+Ek3CDLXPnXfo7xpABXezYcPXAJrgsgBfWrwHdxzAgMBAAGjUDBOMB0G +A1UdDgQWBBSKbhnnl5uP2X+zuwFP6GovUpUN2TAfBgNVHSMEGDAWgBSKbhnnl5uP +2X+zuwFP6GovUpUN2TAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAKF0 +jl02liwFfupmzC5oxz2T3IyjEa21fm7QBMQJvQr5OTuX1/C7DAl7g/6/h7BH6JS3 +qpx5rXGet8SZmG8dODL4o3U4xOXnNzch7HtQixWwlx4XnFAXPMHflFX7YC5QQNHq +I8Y8IW+XjAYWpYJywWMUZIbr1/9y9gn1beYEE3pq +-----END CERTIFICATE----- diff --git a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp index d0509bb..963bf11 100644 --- a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp +++ b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp @@ -110,6 +110,7 @@ private slots: void nulInCN(); void nulInSan(); void largeSerialNumber(); + void largeExpirationDate(); // ### add tests for certificate bundles (multiple certificates concatenated into a single // structure); both PEM and DER formatted #endif @@ -802,6 +803,20 @@ void tst_QSslCertificate::largeSerialNumber() QCOMPARE(cert.serialNumber(), QByteArray("01:02:03:04:05:06:07:08:09:10:aa:bb:cc:dd:ee:ff:17:18:19:20")); } +void tst_QSslCertificate::largeExpirationDate() // QTBUG-12489 +{ + QList<QSslCertificate> certList = + QSslCertificate::fromPath(SRCDIR "more-certificates/cert-large-expiration-date.pem"); + + QCOMPARE(certList.size(), 1); + + const QSslCertificate &cert = certList.at(0); + QVERIFY(!cert.isNull()); + QCOMPARE(cert.effectiveDate().toUTC(), QDateTime(QDate(2010, 8, 4), QTime(9, 53, 41), Qt::UTC)); + // if the date is larger than 2049, then the generalized time format is used + QCOMPARE(cert.expiryDate().toUTC(), QDateTime(QDate(2051, 8, 29), QTime(9, 53, 41), Qt::UTC)); +} + #endif // QT_NO_OPENSSL QTEST_MAIN(tst_QSslCertificate) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index e8fd155..9e8d768 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1724,7 +1724,7 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title, out() << "</li>\n"; } if (!cn->name().isEmpty()) - out() << " <li>" << cn->name() << "</li>\n"; + out() << " <li>" << protectEnc(cn->name()) << "</li>\n"; } else if (node->type() == Node::Fake) { const FakeNode* fn = static_cast<const FakeNode*>(node); @@ -1732,52 +1732,50 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title, out() << " <li><a href=\"modules.html\">Modules</a></li>"; QString name = node->name(); if (!name.isEmpty()) - out() << " <li>" << name << "</li>\n"; + out() << " <li>" << protectEnc(name) << "</li>\n"; } else if (node->subType() == Node::Group) { if (fn->name() == QString("modules")) out() << " <li>Modules</li>"; else { - out() << " <li>" << title << "</li>"; + out() << " <li>" << protectEnc(title) << "</li>"; } } else if (node->subType() == Node::Page) { if (fn->name() == QString("qdeclarativeexamples.html")) { out() << " <li><a href=\"all-examples.html\">Examples</a></li>"; - out() << " <li>QML Examples & Demos</li>"; + out() << " <li>QML Examples & Demos</li>"; } else if (fn->name().startsWith("examples-")) { out() << " <li><a href=\"all-examples.html\">Examples</a></li>"; - out() << " <li>" << title << "</li>"; + out() << " <li>" << protectEnc(title) << "</li>"; } else if (fn->name() == QString("namespaces.html")) { out() << " <li>Namespaces</li>"; } else { - out() << " <li>" << title << "</li>"; + out() << " <li>" << protectEnc(title) << "</li>"; } } else if (node->subType() == Node::QmlClass) { out() << " <li><a href=\"qdeclarativeelements.html\">QML Elements</a></li>"; - out() << " <li>" << title << "</li>"; + out() << " <li>" << protectEnc(title) << "</li>"; } else if (node->subType() == Node::Example) { out() << " <li><a href=\"all-examples.html\">Examples</a></li>"; QStringList sl = fn->name().split('/'); if (sl.contains("declarative")) - out() << " <li><a href=\"qdeclarativeexamples.html\">QML Examples & Demos</a></li>"; + out() << " <li><a href=\"qdeclarativeexamples.html\">QML Examples & Demos</a></li>"; else { - QString name = "examples-" + sl.at(0) + ".html"; // this generates an empty link + QString name = protectEnc("examples-" + sl.at(0) + ".html"); // this generates an empty link QString t = CodeParser::titleFromName(name); - // out() << " <li> <a href=\"" << name << "\">" - // << t << "</a></li>"; } - out() << " <li>" << title << "</li>"; + out() << " <li>" << protectEnc(title) << "</li>"; } } else if (node->type() == Node::Namespace) { out() << " <li><a href=\"namespaces.html\">Namespaces</a></li>"; - out() << " <li>" << title << "</li>"; + out() << " <li>" << protectEnc(title) << "</li>"; } } diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 94c8f47..2d729fa 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -169,4 +169,5 @@ HTML.footer = " <!-- /div -->\n" \ " </form>\n" \ " </div>\n" \ " <div id=\"blurpage\">\n" \ - " </div>\n" + " </div>\n" \ + " </div>\n" |