summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qtableview.cpp
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2010-01-22 16:36:05 (GMT)
committerGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2010-01-25 09:06:22 (GMT)
commit517631a6021a480e4098e39e7d6f65d91c35559d (patch)
treec6165b4d1fadcfc87fbeebceebb5af1ac839503c /src/gui/itemviews/qtableview.cpp
parent533188de9886af3556ac277f8dc226119ebce16c (diff)
downloadQt-517631a6021a480e4098e39e7d6f65d91c35559d.zip
Qt-517631a6021a480e4098e39e7d6f65d91c35559d.tar.gz
Qt-517631a6021a480e4098e39e7d6f65d91c35559d.tar.bz2
Another ASSERT while deleting spans
That rare case when we are deleting the last span was not being taken care of. Unbelievable but true. Auto-test included. Reviewed-by: Thierry Reviewed-by: leo Task-number: QTBUG-6004
Diffstat (limited to 'src/gui/itemviews/qtableview.cpp')
-rw-r--r--src/gui/itemviews/qtableview.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp
index 7eefb0b..3111896 100644
--- a/src/gui/itemviews/qtableview.cpp
+++ b/src/gui/itemviews/qtableview.cpp
@@ -114,7 +114,9 @@ void QSpanCollection::updateSpan(QSpanCollection::Span *span, int old_height)
}
} else if (old_height > span->height()) {
//remove the span from all the subspans lists that intersect the columns not covered anymore
- Index::iterator it_y = index.lowerBound(qMin(-span->bottom(), 0));
+ Index::iterator it_y = index.lowerBound(-span->bottom());
+ if (it_y == index.end())
+ it_y = index.find(-span->top()); // This is the only span remaining and we are deleting it.
Q_ASSERT(it_y != index.end()); //it_y must exist since the span is in the list
while (-it_y.key() <= span->top() + old_height -1) {
if (-it_y.key() > span->bottom()) {