summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qtreeview.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-08-13 15:37:05 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-08-13 15:37:31 (GMT)
commitf82a226607b079b360c88afbe0423d990071b0ba (patch)
tree7e66ef31a0d83d843fe92ccce870c92206a6dbd5 /src/gui/itemviews/qtreeview.cpp
parent942abf1a3ba60a60207a213dbeb383904f97e47d (diff)
downloadQt-f82a226607b079b360c88afbe0423d990071b0ba.zip
Qt-f82a226607b079b360c88afbe0423d990071b0ba.tar.gz
Qt-f82a226607b079b360c88afbe0423d990071b0ba.tar.bz2
Fix coverity warnings
Diffstat (limited to 'src/gui/itemviews/qtreeview.cpp')
-rw-r--r--src/gui/itemviews/qtreeview.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index cbe1d2a..539a642 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -2797,15 +2797,14 @@ int QTreeView::indexRowSizeHint(const QModelIndex &index) const
if (isRightToLeft()) {
start = (start == -1 ? count - 1 : start);
- end = (end == -1 ? 0 : end);
+ end = 0;
} else {
start = (start == -1 ? 0 : start);
- end = (end == -1 ? count - 1 : end);
+ end = count - 1;
}
- int tmp = start;
- start = qMin(start, end);
- end = qMax(tmp, end);
+ if (end < start)
+ qSwap(end, start);
int height = -1;
QStyleOptionViewItemV4 option = d->viewOptionsV4();