summaryrefslogtreecommitdiffstats
path: root/src/gui
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/gui
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/gui')
-rw-r--r--src/gui/text/qtextdocument_p.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp
index e70c5e63b5..901375d8c8 100644
--- a/src/gui/text/qtextdocument_p.cpp
+++ b/src/gui/text/qtextdocument_p.cpp
@@ -133,7 +133,7 @@ static bool isValidBlockSeparator(const QChar &ch)
|| ch == QTextEndOfFrame;
}
-#ifndef QT_NO_DEBUG
+#if !defined(QT_NO_DEBUG) || defined(QT_FORCE_ASSERTS)
static bool noBlockInString(const QString &str)
{
return !str.contains(QChar::ParagraphSeparator)
@@ -322,9 +322,7 @@ void QTextDocumentPrivate::setLayout(QAbstractTextDocumentLayout *layout)
void QTextDocumentPrivate::insert_string(int pos, uint strPos, uint length, int format, QTextUndoCommand::Operation op)
{
// ##### optimize when only appending to the fragment!
-#ifndef QT_NO_DEBUG
Q_ASSERT(noBlockInString(text.mid(strPos, length)));
-#endif
split(pos);
uint x = fragments.insert_single(pos, length);
@@ -480,9 +478,7 @@ void QTextDocumentPrivate::insert(int pos, const QString &str, int format)
if (str.size() == 0)
return;
-#ifndef QT_NO_DEBUG
Q_ASSERT(noBlockInString(str));
-#endif
int strPos = text.length();
text.append(str);
@@ -500,9 +496,7 @@ int QTextDocumentPrivate::remove_string(int pos, uint length, QTextUndoCommand::
Q_ASSERT(blocks.size(b) > length);
Q_ASSERT(x && fragments.position(x) == (uint)pos && fragments.size(x) == length);
-#ifndef QT_NO_DEBUG
Q_ASSERT(noBlockInString(text.mid(fragments.fragment(x)->stringPosition, length)));
-#endif
blocks.setSize(b, blocks.size(b)-length);
@@ -636,9 +630,7 @@ void QTextDocumentPrivate::move(int pos, int to, int length, QTextUndoCommand::O
if (key+1 != blocks.position(b)) {
// qDebug("remove_string from %d length %d", key, X->size_array[0]);
-#ifndef QT_NO_DEBUG
Q_ASSERT(noBlockInString(text.mid(X->stringPosition, X->size_array[0])));
-#endif
w = remove_string(key, X->size_array[0], op);
if (needsInsert) {