From cba3b122ed952f0569ca0e68ae202c09a0721940 Mon Sep 17 00:00:00 2001 From: Matt Finnicum Date: Tue, 8 Aug 2006 11:55:08 -0400 Subject: [PATCH] riched20: Modify ME_CharFromPoint to work properly with password controls. --- dlls/riched20/run.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/run.c b/dlls/riched20/run.c index d74d68f7848..f9b1ef68482 100644 --- a/dlls/riched20/run.c +++ b/dlls/riched20/run.c @@ -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;