From ea6c2a63fc0cdb452c7ed7ccfc8bab9cc1ef52f7 Mon Sep 17 00:00:00 2001 From: mae Date: Wed, 9 Sep 2009 17:42:07 +0200 Subject: Fix crash (assert) in QTextDocument When loading binary files as text, QTextCursor did not check for beginning and end of frame (QChar(0xfdd0) and QChar(0xfdd1)), while QTextDocument asserted that those characters were absent. The patch makes QTextCursor::insertText() treat frame bounderies like paragraph separators. Reviewed-by: ck --- src/gui/text/qtextcursor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp index 4e367c9..8b85d2d 100644 --- a/src/gui/text/qtextcursor.cpp +++ b/src/gui/text/qtextcursor.cpp @@ -1328,6 +1328,8 @@ void QTextCursor::insertText(const QString &text, const QTextCharFormat &_format if (ch == QLatin1Char('\n') || ch == QChar::ParagraphSeparator + || ch == QTextBeginningOfFrame + || ch == QTextEndOfFrame || ch == QLatin1Char('\r')) { if (!hasEditBlock) { -- cgit v0.12