|
|
3245da2 |
Index: mozilla/gfx/src/gtk/nsFontMetricsPango.cpp
|
|
|
3245da2 |
===================================================================
|
|
|
3245da2 |
RCS file: /cvsroot/mozilla/gfx/src/gtk/nsFontMetricsPango.cpp,v
|
|
|
3245da2 |
retrieving revision 1.24
|
|
|
3245da2 |
diff -d -u -p -6 -r1.24 nsFontMetricsPango.cpp
|
|
|
3245da2 |
--- mozilla/gfx/src/gtk/nsFontMetricsPango.cpp 25 Aug 2006 01:02:34 -0000 1.24
|
|
|
3245da2 |
+++ mozilla/gfx/src/gtk/nsFontMetricsPango.cpp 6 Sep 2006 07:01:49 -0000
|
|
|
3245da2 |
@@ -948,13 +948,12 @@ nsFontMetricsPango::GetClusterInfo(const
|
|
|
3245da2 |
PRInt32
|
|
|
3245da2 |
nsFontMetricsPango::GetPosition(const PRUnichar *aText, PRUint32 aLength,
|
|
|
3245da2 |
nsPoint aPt)
|
|
|
3245da2 |
{
|
|
|
3245da2 |
int trailing = 0;
|
|
|
3245da2 |
int inx = 0;
|
|
|
3245da2 |
- gboolean found = FALSE;
|
|
|
3245da2 |
const gchar *curChar;
|
|
|
3245da2 |
PRInt32 retval = 0;
|
|
|
3245da2 |
|
|
|
3245da2 |
float f = mDeviceContext->AppUnitsToDevUnits();
|
|
|
3245da2 |
|
|
|
3245da2 |
PangoLayout *layout = pango_layout_new(mPangoContext);
|
|
|
3245da2 |
@@ -974,28 +973,18 @@ nsFontMetricsPango::GetPosition(const PR
|
|
|
3245da2 |
}
|
|
|
3245da2 |
|
|
|
3245da2 |
// Set up the pango layout
|
|
|
3245da2 |
pango_layout_set_text(layout, text, strlen(text));
|
|
|
3245da2 |
FixupSpaceWidths(layout, text);
|
|
|
3245da2 |
|
|
|
3245da2 |
- found = pango_layout_xy_to_index(layout, localX, localY,
|
|
|
3245da2 |
- &inx, &trailing);
|
|
|
3245da2 |
+ pango_layout_xy_to_index(layout, localX, localY,
|
|
|
3245da2 |
+ &inx, &trailing);
|
|
|
3245da2 |
|
|
|
3245da2 |
// Convert the index back to the utf-16 index
|
|
|
3245da2 |
curChar = text;
|
|
|
3245da2 |
|
|
|
3245da2 |
- // Jump to the end if it's not found.
|
|
|
3245da2 |
- if (!found) {
|
|
|
3245da2 |
- if (inx == 0)
|
|
|
3245da2 |
- retval = 0;
|
|
|
3245da2 |
- else if (trailing)
|
|
|
3245da2 |
- retval = aLength;
|
|
|
3245da2 |
-
|
|
|
3245da2 |
- goto loser;
|
|
|
3245da2 |
- }
|
|
|
3245da2 |
-
|
|
|
3245da2 |
for (PRUint32 curOffset=0; curOffset < aLength;
|
|
|
3245da2 |
curOffset++, curChar = g_utf8_find_next_char(curChar, NULL)) {
|
|
|
3245da2 |
|
|
|
3245da2 |
// Check for a match before checking for a surrogate pair
|
|
|
3245da2 |
if (curChar - text == inx) {
|
|
|
3245da2 |
retval = curOffset;
|