wok view qt4/stuff/fix-qtbug-15857.patch @ rev 8997

asterisk: fix extract-cfile.awk
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Mar 03 14:42:56 2011 +0100 (2011-03-03)
parents
children
line source
1 From 6ae84f1183e91c910ca92a55e37f8254ace805c0 Mon Sep 17 00:00:00 2001
2 From: Jiang Jiang <jiang.jiang@nokia.com>
3 Date: Mon, 6 Dec 2010 13:07:36 +0100
4 Subject: [PATCH] Fix QTextEdit::selectAll crash from textChanged()
6 Doing selectAll() after the entire block of text has been removed
7 will cause this crash, because we didn't check if the block we
8 found is valid or not.
10 Task-number: QTBUG-15857
11 Reviewed-by: Eskil
12 ---
13 src/gui/text/qtextcursor.cpp | 3 +++
14 1 files changed, 3 insertions(+), 0 deletions(-)
16 diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp
17 index 769ab2f..f73cc4b 100644
18 --- a/src/gui/text/qtextcursor.cpp
19 +++ b/src/gui/text/qtextcursor.cpp
20 @@ -363,6 +363,9 @@ bool QTextCursorPrivate::movePosition(QTextCursor::MoveOperation op, QTextCursor
21 bool adjustX = true;
22 QTextBlock blockIt = block();
24 + if (!blockIt.isValid())
25 + return false;
26 +
27 if (op >= QTextCursor::Left && op <= QTextCursor::WordRight
28 && blockIt.textDirection() == Qt::RightToLeft) {
29 if (op == QTextCursor::Left)
30 --
31 1.6.1