1 |
johu 12/04/04 11:47:18 |
2 |
|
3 |
Added: qt-gui-4.8.1-fix-calligra-crash.patch |
4 |
Log: |
5 |
Revision bump adds upstream patch to fix crash in calligra. Reported in kde packagers ml and requested by dilfridge. |
6 |
|
7 |
(Portage version: 2.2.0_alpha98/cvs/Linux i686) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 x11-libs/qt-gui/files/qt-gui-4.8.1-fix-calligra-crash.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-libs/qt-gui/files/qt-gui-4.8.1-fix-calligra-crash.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-libs/qt-gui/files/qt-gui-4.8.1-fix-calligra-crash.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: qt-gui-4.8.1-fix-calligra-crash.patch |
16 |
=================================================================== |
17 |
commit cac12f4592477d99ef6fffaad40345bf85ef53b5 |
18 |
Author: Jiang Jiang <jiang.jiang@×××××.com> |
19 |
Date: Mon Apr 2 12:32:05 2012 +0200 |
20 |
|
21 |
Fix a crash in cursorToX() when new block is added |
22 |
|
23 |
When an empty new block is being added, the layoutData->memory data |
24 |
will be 0, thus QTextEngine::attributes() will return 0. We should |
25 |
only access the attributes pointer when some text actually exist. |
26 |
|
27 |
Task-number: QTBUG-24718 |
28 |
Change-Id: I9ce9f7b57bccf24099a02832ce30fb6cebfaad33 |
29 |
|
30 |
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp |
31 |
index ee658d9..16f7150 100644 |
32 |
--- a/src/gui/text/qtextlayout.cpp |
33 |
+++ b/src/gui/text/qtextlayout.cpp |
34 |
@@ -2508,6 +2508,10 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const |
35 |
int pos = *cursorPos; |
36 |
int itm; |
37 |
const HB_CharAttributes *attributes = eng->attributes(); |
38 |
+ if (!attributes) { |
39 |
+ *cursorPos = 0; |
40 |
+ return x.toReal(); |
41 |
+ } |
42 |
while (pos < line.from + line.length && !attributes[pos].charStop) |
43 |
pos++; |
44 |
if (pos == line.from + (int)line.length) { |