Don't translate a null rect.

This was probably because of some forgotten braces, since the
indentation seems to indicate that.
The current behavior might cause a null rect to become not null, which
might cause for QRect::isNull() to give a false positive.
Worst case it might case a program to crash (i.e. div by 0)

Change-Id: Iba49699880250e605b427ff4c1228c68a3471a2f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
This commit is contained in:
Jan Arve Saether 2013-12-20 14:11:09 +01:00 committed by The Qt Project
parent 2af6bf1a59
commit f0cf47092e

View File

@ -1057,9 +1057,10 @@ QRect QAccessibleTableCell::rect() const
QRect r;
r = view->visualRect(m_index);
if (!r.isNull())
if (!r.isNull()) {
r.translate(view->viewport()->mapTo(view, QPoint(0,0)));
r.translate(view->mapToGlobal(QPoint(0, 0)));
}
return r;
}