summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-08-11 21:25:05 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-08-11 21:25:05 (GMT)
commitf77cd44a51c36e661c28e5b65ca4e17445bdffa5 (patch)
treef76080e228e10ce53ba90a746b730d1c8d450a03 /src
parent263bdc38f494e5d0be69b61c92ca6456fc4db330 (diff)
parent87d8bd31efb2a41c7e95d22ec86904c3bb7fdd79 (diff)
downloadQt-f77cd44a51c36e661c28e5b65ca4e17445bdffa5.zip
Qt-f77cd44a51c36e661c28e5b65ca4e17445bdffa5.tar.gz
Qt-f77cd44a51c36e661c28e5b65ca4e17445bdffa5.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Fix some #ifdefs to compile for a specific combination of featuress that was previously unsupported update Russian translations for Qt and tools Updated Slovenian translations for Qt 4.7 doc: The QML Qt element was missing from the documentation. 64-bit versions of PREMUL, BYTE_MUL and INTERPOLATE_PIXEL_256 QXmlStreamReader: avoid unnecessary detaching QSslCertificate: support expiration dates > 2049 Doc: Fixing typo Doc: Fixing bug involving header misplacement in Creator style qdoc: Added list of all members (including inherited) page to QML elements. qdoc: Ensured that text is encoded correctly. qdoc: Fixed non-well-formed markup. Doc: Fixed typo in a shortcut string. Remove useless QString::clear() from QSharedData example snippet. Move note on connectToBus() not actually being able to reconnect to Doc: Added more license information.
Diffstat (limited to 'src')
-rw-r--r--src/corelib/xml/qxmlstream.cpp2
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp7
-rw-r--r--src/gui/kernel/qapplication_win.cpp6
-rw-r--r--src/gui/painting/qdrawhelper_p.h140
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp2
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp121
6 files changed, 150 insertions, 128 deletions
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/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 3822373..de79e4d 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -184,11 +184,12 @@ void QDeclarativeEnginePrivate::defineModule()
}
/*!
-\keyword QmlGlobalQtObject
-\qmlclass Qt QDeclarativeEnginePrivate
+\qmlclass QML:Qt QDeclarativeEnginePrivate
\brief The QML global Qt object provides useful enums and functions from Qt.
-The \c Qt object provides useful enums and functions from Qt, for use in all QML files.
+\keyword QmlGlobalQtObject
+
+\brief The \c Qt object provides useful enums and functions from Qt, for use in all QML files.
The \c Qt object is not a QML element; it cannot be instantiated. It is a global object
with enums and functions. To use it, call the members of the global \c Qt object directly.
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index ec26e81..0c48bfd 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -716,8 +716,10 @@ static void qt_set_windows_updateScrollBar(QWidget *widget)
if (QWidget *w = static_cast<QWidget *>(o))
qt_set_windows_updateScrollBar(w);
}
+#ifndef QT_NO_SCROLLBAR
if (qobject_cast<QScrollBar*>(widget))
widget->updateGeometry();
+#endif
}
@@ -1499,6 +1501,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
switch (message) {
#ifndef Q_WS_WINCE
+#ifndef QT_NO_SESSIONMANAGER
case WM_QUERYENDSESSION: {
if (sm_smActive) // bogus message from windows
RETURN(true);
@@ -1531,6 +1534,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
RETURN(0);
}
+#endif
case WM_DISPLAYCHANGE:
if (QApplication::type() == QApplication::Tty)
break;
@@ -2236,6 +2240,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
}
break;
+#ifndef QT_NO_CONTEXTMENU
case WM_CONTEXTMENU:
{
// it's not VK_APPS or Shift+F10, but a click in the NC area
@@ -2264,6 +2269,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
}
break;
#endif
+#endif
case WM_IME_STARTCOMPOSITION:
case WM_IME_ENDCOMPOSITION:
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