From f0cf47092e0a9ab814427728fa3a37a8464fc5af Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Fri, 20 Dec 2013 14:11:09 +0100 Subject: [PATCH] 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 --- src/plugins/accessible/widgets/itemviews.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/accessible/widgets/itemviews.cpp b/src/plugins/accessible/widgets/itemviews.cpp index b477a6acb7..7cd47f3fec 100644 --- a/src/plugins/accessible/widgets/itemviews.cpp +++ b/src/plugins/accessible/widgets/itemviews.cpp @@ -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; }