and https://bugzilla.mozilla.org/show_bug.cgi?id=335810

Patch by behdad, tagoh, and x00000000@freenet.de seemingly independent of each other.
r+sr=roc
This commit is contained in:
caillon%redhat.com 2006-09-11 23:02:36 +00:00
Родитель 6561df9300
Коммит 9872dd284b
1 изменённых файлов: 2 добавлений и 13 удалений

Просмотреть файл

@ -951,7 +951,6 @@ nsFontMetricsPango::GetPosition(const PRUnichar *aText, PRUint32 aLength,
{
int trailing = 0;
int inx = 0;
gboolean found = FALSE;
const gchar *curChar;
PRInt32 retval = 0;
@ -977,22 +976,12 @@ nsFontMetricsPango::GetPosition(const PRUnichar *aText, PRUint32 aLength,
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)) {