Do not consider sign in qIsNull.
authorMitch Curtis <mitch.curtis@nokia.com>
Wed, 1 Aug 2012 14:02:10 +0000 (16:02 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 22 Aug 2012 02:04:57 +0000 (04:04 +0200)
commit09dd19df5c4b708960e5aade568eb15d996ef200
tree3a997704b1324dfb45f69d892128399affcac242
parent7f469ef4cc614925d7a4fdb3380ff5470e25b03b
Do not consider sign in qIsNull.

The current implementation of qIsNull only returns true if the value is
positive zero. This behaviour is not useful for use cases like
QPointF::isNull, where QPointF(-0, -0).isNull() will return false.
There doesn't seem to be a reason why the function exhibits this
behaviour (-0.0 is not accounted for in the unit tests), and for the
case of QSizeF::scale it causes a bug: qIsNull is used to check for
division by 0.0 before it proceeds, which fails in the case of -0.0.

Task-number: QTBUG-7303
Change-Id: I767e5280bd26614e8e78ae62b274eb9bc4ade385
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
src/corelib/global/qglobal.h
tests/auto/corelib/global/qglobal/tst_qglobal.cpp
tests/auto/corelib/tools/qpointf/tst_qpointf.cpp
tests/auto/corelib/tools/qsizef/tst_qsizef.cpp
tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp