user32: Do not simply return 0 in EDIT_EM_PosFromChar if line ssa is NULL.

This commit is contained in:
Aric Stewart 2011-12-20 10:54:39 -06:00 committed by Alexandre Julliard
parent 3f1a8f6668
commit b83c587f6e
1 changed files with 7 additions and 5 deletions

View File

@ -1069,13 +1069,15 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
while (line_def->index != li)
line_def = line_def->next;
if (!line_def->ssa)
return 0;
lw = line_def->width;
w = es->format_rect.right - es->format_rect.left;
if (line_def->ssa)
{
ScriptStringCPtoX(line_def->ssa, (index - 1) - li, TRUE, &x);
x -= es->x_offset;
}
else
x = es->x_offset;
if (es->style & ES_RIGHT)
x = w - (lw - x);