QHeaderView - Do not try to remove non-existing section

The end parameter passed to removeSectionsFromSpans is off by one.
removeSectionsFromSpans can currently handle/ignore it, but it is
still wrong.

Change-Id: I9148bd106504a37a5c8fd72928ab84c669eebcdb
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
Thorbjørn Lund Martsum 2011-12-15 08:11:16 +01:00 committed by Qt by Nokia
parent 5caa75f665
commit 6cab0bed1d

View File

@ -1940,7 +1940,7 @@ void QHeaderView::initializeSections(int start, int end)
if (end + 1 < d->sectionCount) {
int newCount = end + 1;
d->removeSectionsFromSpans(newCount, d->sectionCount);
d->removeSectionsFromSpans(newCount, d->sectionCount - 1);
if (!d->hiddenSectionSize.isEmpty()) {
if (d->sectionCount - newCount > d->hiddenSectionSize.count()) {
for (int i = end + 1; i < d->sectionCount; ++i)