Contents of /trunk/mozilla-firefox/patches/mozilla-firefox-2.0.0.5-pango-cursor.patch
Parent Directory | Revision Log
Revision 278 -
(show annotations)
(download)
Mon Jul 23 20:24:48 2007 UTC (17 years, 2 months ago) by niro
File size: 1835 byte(s)
Mon Jul 23 20:24:48 2007 UTC (17 years, 2 months ago) by niro
File size: 1835 byte(s)
mozilla-firefox-2.0.0.5-r1
1 | # Upstream bug #335810 |
2 | |
3 | Index: mozilla/gfx/src/gtk/nsFontMetricsPango.cpp |
4 | =================================================================== |
5 | RCS file: /cvsroot/mozilla/gfx/src/gtk/nsFontMetricsPango.cpp,v |
6 | retrieving revision 1.24 |
7 | diff -d -u -p -6 -r1.24 nsFontMetricsPango.cpp |
8 | --- mozilla/gfx/src/gtk/nsFontMetricsPango.cpp 25 Aug 2006 01:02:34 -0000 1.24 |
9 | +++ mozilla/gfx/src/gtk/nsFontMetricsPango.cpp 6 Sep 2006 07:01:49 -0000 |
10 | @@ -948,13 +948,12 @@ nsFontMetricsPango::GetClusterInfo(const |
11 | PRInt32 |
12 | nsFontMetricsPango::GetPosition(const PRUnichar *aText, PRUint32 aLength, |
13 | nsPoint aPt) |
14 | { |
15 | int trailing = 0; |
16 | int inx = 0; |
17 | - gboolean found = FALSE; |
18 | const gchar *curChar; |
19 | PRInt32 retval = 0; |
20 | |
21 | float f = mDeviceContext->AppUnitsToDevUnits(); |
22 | |
23 | PangoLayout *layout = pango_layout_new(mPangoContext); |
24 | @@ -974,28 +973,18 @@ nsFontMetricsPango::GetPosition(const PR |
25 | } |
26 | |
27 | // Set up the pango layout |
28 | pango_layout_set_text(layout, text, strlen(text)); |
29 | FixupSpaceWidths(layout, text); |
30 | |
31 | - found = pango_layout_xy_to_index(layout, localX, localY, |
32 | - &inx, &trailing); |
33 | + pango_layout_xy_to_index(layout, localX, localY, |
34 | + &inx, &trailing); |
35 | |
36 | // Convert the index back to the utf-16 index |
37 | curChar = text; |
38 | |
39 | - // Jump to the end if it's not found. |
40 | - if (!found) { |
41 | - if (inx == 0) |
42 | - retval = 0; |
43 | - else if (trailing) |
44 | - retval = aLength; |
45 | - |
46 | - goto loser; |
47 | - } |
48 | - |
49 | for (PRUint32 curOffset=0; curOffset < aLength; |
50 | curOffset++, curChar = g_utf8_find_next_char(curChar, NULL)) { |
51 | |
52 | // Check for a match before checking for a surrogate pair |
53 | if (curChar - text == inx) { |
54 | retval = curOffset; |