summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qheaderview.cpp
diff options
context:
space:
mode:
authorHarald Fernengel <harald.fernengel@nokia.com>2011-11-16 11:56:48 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-16 15:27:23 +0100
commitcd6bd7aa1154c7869e8f71c4dc2201d0959b4ebe (patch)
tree1c8a36ab797e1007ce029629379a834b5529f9f3 /src/widgets/itemviews/qheaderview.cpp
parentf1f95d70476eba6ac58aaf72b39063ae68432ac3 (diff)
Revert logic when building with --force-asserts
This reverts commit f109f5b8a9c7e6939dfd6c6f72a3b67548f5483c. Instead of disabling the asserts, rather enable the debug code so the asserts actually trigger. Change-Id: I6f62588d836de5c926294241e8d7196a963e4aac Reviewed-by: Eckhart Koppen <eckhart.koppen@nokia.com>
Diffstat (limited to 'src/widgets/itemviews/qheaderview.cpp')
-rw-r--r--src/widgets/itemviews/qheaderview.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 2ad75b7263..ec8480db97 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -3093,7 +3093,7 @@ void QHeaderViewPrivate::createSectionSpan(int start, int end, int size, QHeader
SectionSpan span(size, (end - start) + 1, mode);
int start_section = 0;
-#ifndef QT_NO_DEBUG
+#if !defined(QT_NO_DEBUG) || defined(QT_FORCE_ASSERTS)
int initial_section_count = headerSectionCount(); // ### debug code
#endif
@@ -3115,16 +3115,12 @@ void QHeaderViewPrivate::createSectionSpan(int start, int end, int size, QHeader
sectionSpans[i].resizeMode = mode;
// ### check if we can merge the section with any of its neighbours
removeSpans(spansToRemove);
-#ifndef QT_NO_DEBUG
Q_ASSERT(initial_section_count == headerSectionCount());
-#endif
return;
} else if (start > start_section && end < end_section) {
if (sectionSpans.at(i).sectionSize() == span.sectionSize()
&& sectionSpans.at(i).resizeMode == span.resizeMode) {
-#ifndef QT_NO_DEBUG
Q_ASSERT(initial_section_count == headerSectionCount());
-#endif
return;
}
// the new span is in the middle of the old span, so we have to split it
@@ -3142,7 +3138,7 @@ void QHeaderViewPrivate::createSectionSpan(int start, int end, int size, QHeader
sectionSpans[i].resizeMode = span_mode;
length += first_span_size;
// middle span (the new span)
-#ifndef QT_NO_DEBUG
+#if !defined(QT_NO_DEBUG) || defined(QT_FORCE_ASSERTS)
int mid_span_count = span.count;
#endif
int mid_span_size = span.size;
@@ -3153,13 +3149,9 @@ void QHeaderViewPrivate::createSectionSpan(int start, int end, int size, QHeader
int last_span_size = section_size * last_span_count;
sectionSpans.insert(i + 2, SectionSpan(last_span_size, last_span_count, span_mode));
length += last_span_size;
-#ifndef QT_NO_DEBUG
Q_ASSERT(span_count == first_span_count + mid_span_count + last_span_count);
-#endif
removeSpans(spansToRemove);
-#ifndef QT_NO_DEBUG
Q_ASSERT(initial_section_count == headerSectionCount());
-#endif
return;
} else if (start > start_section && start <= end_section && end >= end_section) {
// the new span covers the last part of the existing span
@@ -3175,9 +3167,7 @@ void QHeaderViewPrivate::createSectionSpan(int start, int end, int size, QHeader
sectionSpans.insert(i + 1, span); // insert after
length += span.size;
removeSpans(spansToRemove);
-#ifndef QT_NO_DEBUG
Q_ASSERT(initial_section_count == headerSectionCount());
-#endif
return;
}
} else if (end < end_section && end >= start_section && start <= start_section) {
@@ -3193,9 +3183,7 @@ void QHeaderViewPrivate::createSectionSpan(int start, int end, int size, QHeader
sectionSpans.insert(i, span); // insert before
length += span.size;
removeSpans(spansToRemove);
-#ifndef QT_NO_DEBUG
Q_ASSERT(initial_section_count == headerSectionCount());
-#endif
return;
}
start_section += section_count;