[qt] - upstream fix for QTextCursor regression (QTBUG-15857, kde#249373)

Rex Dieter rdieter at fedoraproject.org
Wed Jan 26 13:47:18 UTC 2011


commit 5a3b34906e5213103a5b163c956c521447b5e6cb
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Wed Jan 26 07:46:41 2011 -0600

    - upstream fix for QTextCursor regression (QTBUG-15857, kde#249373)

 qt-everywhere-opensource-4.7.1-QTBUG-15857-2.patch |   44 ++++++++++++++++++++
 qt.spec                                            |   13 ++++-
 2 files changed, 54 insertions(+), 3 deletions(-)
---
diff --git a/qt-everywhere-opensource-4.7.1-QTBUG-15857-2.patch b/qt-everywhere-opensource-4.7.1-QTBUG-15857-2.patch
new file mode 100644
index 0000000..cf54adf
--- /dev/null
+++ b/qt-everywhere-opensource-4.7.1-QTBUG-15857-2.patch
@@ -0,0 +1,44 @@
+From 34c297faca93e1286573b2a01127e4e7af00aff2 Mon Sep 17 00:00:00 2001
+From: Jiang Jiang <jiang.jiang at nokia.com>
+Date: Mon, 24 Jan 2011 19:09:38 +0100
+Subject: [PATCH] Fix cursor position adjustment when removing strings
+
+Commit 0ba1b4d0 introduced a regression to QTextDocument: it postponed
+cursor position adjustment until the move operation is done, but
+contentsChanged will be triggered by finishEdit() in this move
+operation, thus cursor positions in this signal handler will be in
+inconsistent states (normally we should first update cursor position
+then trigger contentsChanged). In this case we should also postpone
+finishEdit() handling after cursor positions have been adjusted, then
+the states expose to applications will be consistent.
+
+Task-number: QTBUG-15857
+Reviewed-by: Eskil
+---
+ src/gui/text/qtextdocument_p.cpp           |    4 +++-
+ tests/auto/qtextcursor/tst_qtextcursor.cpp |   28 ++++++++++++++++++++++++++++
+ 2 files changed, 31 insertions(+), 1 deletions(-)
+
+diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp
+index 498a432..2172f74 100644
+--- a/src/gui/text/qtextdocument_p.cpp
++++ b/src/gui/text/qtextdocument_p.cpp
+@@ -663,7 +663,8 @@ void QTextDocumentPrivate::move(int pos, int to, int length, QTextUndoCommand::O
+ 
+     Q_ASSERT(blocks.length() == fragments.length());
+ 
+-    finishEdit();
++    if (!blockCursorAdjustment)
++        finishEdit();
+ }
+ 
+ void QTextDocumentPrivate::remove(int pos, int length, QTextUndoCommand::Operation op)
+@@ -678,6 +679,7 @@ void QTextDocumentPrivate::remove(int pos, int length, QTextUndoCommand::Operati
+             curs->changed = true;
+         }
+     }
++    finishEdit();
+ }
+ 
+ void QTextDocumentPrivate::setCharFormat(int pos, int length, const QTextCharFormat &newFormat, FormatChangeMode mode)
+
diff --git a/qt.spec b/qt.spec
index 5f13f56..b93e805 100644
--- a/qt.spec
+++ b/qt.spec
@@ -18,7 +18,7 @@ Summary: Qt toolkit
 Name:    qt
 Epoch:   1
 Version: 4.7.1
-Release: 10%{?dist}
+Release: 11%{?dist}
 
 # See LGPL_EXCEPTIONS.txt, LICENSE.GPL3, respectively, for exception details
 License: (LGPLv2 with exceptions or GPLv3 with exceptions) and ASL 2.0 and BSD and FTL and MIT
@@ -98,9 +98,12 @@ Patch100: qt-everywhere-opensource-src-4.7.1-ml_IN-bz528303.patch
 # fix QTextCursor crash in Lokalize and Psi (QTBUG-15857, kde#249373, #660028)
 # http://qt.gitorious.org/qt/qt/commit/6ae84f1183e91c910ca92a55e37f8254ace805c0
 Patch101: qt-everywhere-opensource-src-4.7.1-qtextcursor-crash.patch
+# followup for regressions
+# http://qt.gitorious.org/qt/qt/commit/34c297faca93e1286573b2a01127e4e7af00aff2.patch
+Patch102: qt-everywhere-opensource-4.7.1-QTBUG-15857-2.patch
 
 # qsortfilterproxymodel merge, http://qt.gitorious.org/qt/qt/merge_requests/934
-Patch102: qt-everywhere-opensource-src-4.7.1-qsortfilterproxymodel_merge934.patch
+Patch103: qt-everywhere-opensource-src-4.7.1-qsortfilterproxymodel_merge934.patch
 
 # kde-qt git patches
 Patch202: 0002-This-patch-makes-override-redirect-windows-popup-men.patch
@@ -471,7 +474,8 @@ Qt libraries used for drawing widgets and OpenGL items.
 # upstream patches
 %patch100 -p1 -b .ml_IN-rendering
 %patch101 -p1 -b .qtextcursor-crash
-%patch102 -p1 -b .qsortfilterproxymodel_merge934
+%patch102 -p1 -b .QTBUG-15857-2
+%patch103 -p1 -b .qsortfilterproxymodel_merge934
 
 # kde-qt branch
 %if 0%{?kde_qt}
@@ -1153,6 +1157,9 @@ fi
 
 
 %changelog
+* Wed Jan 26 2011 Rex Dieter <rdieter at fedoraproject.org> 4.7.1-11
+- upstream fix for QTextCursor regression (QTBUG-15857, kde#249373)
+
 * Tue Jan 25 2011 Rex Dieter <rdieter at fedoraproject.org> 4.7.1-10
 - -config subpkg
 - qt-x11 pulls in phonon (#672088)


More information about the scm-commits mailing list