summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-03-17 13:12:49 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2010-03-17 13:18:11 (GMT)
commitf9b0efc17962df74a67d81daca5814af93a5fb97 (patch)
treed160550030c0815544e580d734526f95d9b3bb38 /src/gui/itemviews
parentee379340fcc5ebf8625906f42540c0fb3577f9ac (diff)
downloadQt-f9b0efc17962df74a67d81daca5814af93a5fb97.zip
Qt-f9b0efc17962df74a67d81daca5814af93a5fb97.tar.gz
Qt-f9b0efc17962df74a67d81daca5814af93a5fb97.tar.bz2
Fixed a potential crash in headerview when inserting a section
This could happen if a section was moved andthen hidden Task-number: QTBUG-8650 Reviewed-by: Andy Shaw
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r--src/gui/itemviews/qheaderview.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp
index eb3db21..586e5d4 100644
--- a/src/gui/itemviews/qheaderview.cpp
+++ b/src/gui/itemviews/qheaderview.cpp
@@ -1698,13 +1698,10 @@ void QHeaderView::sectionsInserted(const QModelIndex &parent,
if (!d->sectionHidden.isEmpty()) {
QBitArray sectionHidden(d->sectionHidden);
sectionHidden.resize(sectionHidden.count() + insertCount);
- //sectionHidden.fill(false, logicalFirst, logicalLast + 1);
- for (int i = logicalFirst; i <= logicalLast; ++i)
- // visual == logical in this range (see previous block)
- sectionHidden.setBit(i, false);
+ sectionHidden.fill(false, logicalFirst, logicalLast + 1);
for (int j = logicalLast + 1; j < sectionHidden.count(); ++j)
- sectionHidden.setBit(d->visualIndex(j),
- d->sectionHidden.testBit(d->visualIndex(j - insertCount)));
+ //here we simply copy the old sectionHidden
+ sectionHidden.setBit(j, d->sectionHidden.testBit(j - insertCount));
d->sectionHidden = sectionHidden;
}