Commit cba3b122 authored by Matt Finnicum's avatar Matt Finnicum Committed by Alexandre Julliard

riched20: Modify ME_CharFromPoint to work properly with password controls.

parent 1209e669
......@@ -512,8 +512,20 @@ int ME_CharFromPoint(ME_TextEditor *editor, int cx, ME_Run *run)
}
hDC = GetDC(editor->hWnd);
hOldFont = ME_SelectStyleFont(editor, hDC, run->style);
GetTextExtentExPointW(hDC, run->strText->szData, run->strText->nLen,
cx, &fit, NULL, &sz);
if (editor->cPasswordMask)
{
ME_String *strMasked = ME_MakeStringR(editor->cPasswordMask,ME_StrVLen(run->strText));
GetTextExtentExPointW(hDC, strMasked->szData, run->strText->nLen,
cx, &fit, NULL, &sz);
ME_DestroyString(strMasked);
}
else
{
GetTextExtentExPointW(hDC, run->strText->szData, run->strText->nLen,
cx, &fit, NULL, &sz);
}
ME_UnselectStyleFont(editor, hDC, run->style, hOldFont);
ReleaseDC(editor->hWnd, hDC);
return fit;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment