From 3245da27eeb982b43e15a902e3a7d42b488b0aa2 Mon Sep 17 00:00:00 2001 From: Christopher Aillon Date: Wed, 6 Sep 2006 07:22:56 +0000 Subject: - Fix for cursor position in editor widgets by tagoh and behdad (#198759) --- firefox-1.5-pango-cursor-position.patch | 52 +++++++++++++++++++++++++++++++++ firefox.spec | 7 ++++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 firefox-1.5-pango-cursor-position.patch diff --git a/firefox-1.5-pango-cursor-position.patch b/firefox-1.5-pango-cursor-position.patch new file mode 100644 index 0000000..d287fd3 --- /dev/null +++ b/firefox-1.5-pango-cursor-position.patch @@ -0,0 +1,52 @@ +Index: mozilla/gfx/src/gtk/nsFontMetricsPango.cpp +=================================================================== +RCS file: /cvsroot/mozilla/gfx/src/gtk/nsFontMetricsPango.cpp,v +retrieving revision 1.24 +diff -d -u -p -6 -r1.24 nsFontMetricsPango.cpp +--- mozilla/gfx/src/gtk/nsFontMetricsPango.cpp 25 Aug 2006 01:02:34 -0000 1.24 ++++ mozilla/gfx/src/gtk/nsFontMetricsPango.cpp 6 Sep 2006 07:01:49 -0000 +@@ -948,13 +948,12 @@ nsFontMetricsPango::GetClusterInfo(const + PRInt32 + nsFontMetricsPango::GetPosition(const PRUnichar *aText, PRUint32 aLength, + nsPoint aPt) + { + int trailing = 0; + int inx = 0; +- gboolean found = FALSE; + const gchar *curChar; + PRInt32 retval = 0; + + float f = mDeviceContext->AppUnitsToDevUnits(); + + PangoLayout *layout = pango_layout_new(mPangoContext); +@@ -974,28 +973,18 @@ nsFontMetricsPango::GetPosition(const PR + } + + // Set up the pango layout + pango_layout_set_text(layout, text, strlen(text)); + FixupSpaceWidths(layout, text); + +- found = pango_layout_xy_to_index(layout, localX, localY, +- &inx, &trailing); ++ pango_layout_xy_to_index(layout, localX, localY, ++ &inx, &trailing); + + // Convert the index back to the utf-16 index + curChar = text; + +- // Jump to the end if it's not found. +- if (!found) { +- if (inx == 0) +- retval = 0; +- else if (trailing) +- retval = aLength; +- +- goto loser; +- } +- + for (PRUint32 curOffset=0; curOffset < aLength; + curOffset++, curChar = g_utf8_find_next_char(curChar, NULL)) { + + // Check for a match before checking for a surrogate pair + if (curChar - text == inx) { + retval = curOffset; diff --git a/firefox.spec b/firefox.spec index c19d576..80f684b 100644 --- a/firefox.spec +++ b/firefox.spec @@ -11,7 +11,7 @@ Summary: Mozilla Firefox Web browser. Name: firefox Version: 1.5.0.6 -Release: 10 +Release: 11 URL: http://www.mozilla.org/projects/firefox/ License: MPL/LGPL Group: Applications/Internet @@ -55,6 +55,7 @@ Patch42: firefox-1.1-uriloader.patch # font system fixes Patch81: firefox-1.5-nopangoxft.patch Patch82: firefox-1.5-pango-mathml.patch +Patch83: firefox-1.5-pango-cursor-position.patch # patches from upstream (Patch100+) Patch101: firefox-1.5-pango-ua.patch @@ -131,6 +132,7 @@ removed in favor of xulrunner-devel. %patch42 -p0 %patch81 -p1 %patch82 -p1 +%patch83 -p1 %patch101 -p0 -b .pango-ua %patch102 -p0 -b .pango-about @@ -349,6 +351,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Sep 6 2006 Christopher Aillon 1.5.0.6-11 +- Fix for cursor position in editor widgets by tagoh and behdad (#198759) + * Sun Sep 3 2006 Christopher Aillon 1.5.0.6-10 - Enable GCC visibility - export XLIB_SKIP_ARGB_VISUALS=1 as a temporary workaround to prevent -- cgit