Mitigate performance regression in isExpandedEntityValueTooLarge().

512a1ce0698d370c313bb561bbf078935fa0342e fixed a security issue [1],
but also caused a large performance regression. This patch improves
the performance from ~196 seconds to ~.23 seconds for 1000 entities,
using the benchmark in the bug report:

"0": 0 msecs per iteration (total: 0, iterations: 1)
"250": 2,952 msecs per iteration (total: 2,952, iterations: 1)
"500": 23,418 msecs per iteration (total: 23,418, iterations: 1)
"750": 79,913 msecs per iteration (total: 79,913, iterations: 1)
"1000": 196,335 msecs per iteration (total: 196,335, iterations: 1)

"0": 0 msecs per iteration (total: 0, iterations: 1)
"250": 16 msecs per iteration (total: 16, iterations: 1)
"500": 59 msecs per iteration (total: 59, iterations: 1)
"750": 132 msecs per iteration (total: 132, iterations: 1)
"1000": 232 msecs per iteration (total: 232, iterations: 1)

This is a cherry-pick of 62c4e288a11769bde45c9c74d731ed8628303f19.

[1] http://lists.qt-project.org/pipermail/announce/2013-December/000036.html

Task-number: QTBUG-35919

Change-Id: Ibc2fc94dc0d88b227b9510e15bac9c07f4600591
Reviewed-by: Richard J. Moore <rich@kde.org>
Avoid floating point exceptions in rasterizeLine.

Task-number: QTBUG-16757

Change-Id: I3ef988f1e039c12529d62197d85a62f201e4ae12
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
(cherry picked from qtbase/85b4f0d2d3ffd326548ca8f0e15ac27f5fd8d77d)
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Correct wordwrapped text handling in QListView icon mode

Currently a QListView with wordwrapping activated will wrap the text
only to the width of the icon even if the grid size is bigger. With this
patch the option rect is now updated to match the grid size if valid
and the style uses it to determine the correct size when wrapping

[ChangeLog][QtWidgets][QTBUG-4714] Use the grid size for wordwrapping
when available in icon mode
Task-number: QTBUG-4714
Change-Id: I2cb63809d3ee8bd262f38bc11de91df9ff5cf237
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
(cherry picked from qtbase/a761be2fb2191215426f904cb03df0e966214531)
QWizard: Fix frame when using Vista style/MSVC2012

Work around GetSystemMetrics() returning the wrong value using
MSVC2012 and later. The special handling of Windows 8 and later
is then no longer required.

[ChangeLog][QtWidgets][QWizard]  Fixed frame when using Vista style/MSVC2012.

Task-number: QTBUG-36192

Change-Id: I39c2ab70a266f12cd65fa740b10b86edffa60417
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtbase/852308114ff901b86cca99268f498fc1d56b622e)
Make configure.exe only detect each compiler once

When reading the registry on a 64 bit Windows, the same compiler
can be detected twice, breaking the -platform detection even when
only one compiler is in the path.
Fix this by taking advantage of the CompilerInfo struct ordering
and ignore detection of the same compiler.

Change-Id: I583230520d2e0859196f9d7c8af31adbb981a6ca
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
(cherry picked from commit fa5cf01e7468e53508b15726625fd681892119a4)
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
add support for Visual Studio 2013

Add mkspec win32-msvc2013 and make VS 2013 known to configure and
qmake.

Task-number: QTBUG-36135

Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from commit f1cdd4b2976706c6d9c3166a75afff6ec5856f3d)

Change-Id: I6a6d1ce0de0ba85e1b711976c7340893c58e29ae
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
rebuild configure.exe

Change-Id: I3e1cdb9462921a49d37637c8c0ce788208ee200c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
QWindowsVistaStyle: Fixed position of menu gutter when using a custom widget action.

The gutter position was hardcoded to 28 which fits when drawing
on the QMenu with a left margin of 3. It became offset when drawing
on a custom widget with no margin. Calculate position relative
to margin for left to right.

[ChangeLog][QtWidgets][QMenu][Windows] Fixed position of menu gutter when using a custom widget action.

Task-number: QTBUG-36218

Change-Id: Ibb34a9fba2bab7257482b80d2e51e76a9755345c
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtbase/a5c288ea5675a382edf0b3ecae42f461a22a7303)
QWindowVistaStyle: Always initialize text color of menu items.

[ChangeLog][QtWidgets][QMenu][Windows] Correctly use text color set by style sheet for menu items.

Task-number: QTBUG-36142

Change-Id: I142f2fd82164771b45bf599a6afa1121fcfd2187
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
(cherry picked from qtbase/b152b425f74788b2f2845fb7d1a5032d86b8746d)
Correct algorithm for digest auth when using the CONNECT verb

QHttpSocketEngine fails to authenticate to an HTTP proxy that is using
Digest authentication and the CONNECT method (i.e. when you are
tunneling TLS over HTTP). The bug is due to a bad parameter being
passed to QAuthenticatorPrivate::calculateResponse - the requestMethod
parameter is passed in as "CONNECT " instead of "CONNECT" (note the
trailing space).

Because an MD5 hash is derived from this method when using the
qop="auth" flavor of Digest auth, the hash does not match the expected
value and authentication always fails in this configuration.

(cherry picked from commit 5cab14b8a1dfbb03e22b10af385fb90900a9f280)

Change-Id: Ief025ada714e03d96a316116f6b9f1711ab2a7f7
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
win32-msvc2013: force synchronous writes to .pdb files

Synchronize .pdb file writing, otherwise parallel builds
will fail, when different compiler instances try to access
the same .pdb file.

See also
http://msdn.microsoft.com/en-us/library/vstudio/dn502518.aspx

Task-number: QTBUG-36398

Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
(cherry picked from commit 59ae8323b7a57cc04d19fc1f552aeaeda9dad3f7)

Change-Id: I7263b875a1015724bae6c37fb540d52507a1c7da
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>