Matt Finnicum : riched20: Modify ME_CharFromPoint to work properly with password controls.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Aug 8 13:21:30 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: cba3b122ed952f0569ca0e68ae202c09a0721940
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=cba3b122ed952f0569ca0e68ae202c09a0721940

Author: Matt Finnicum <mattfinn at gmail.com>
Date:   Tue Aug  8 11:55:08 2006 -0400

riched20: Modify ME_CharFromPoint to work properly with password controls.

---

 dlls/riched20/run.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/dlls/riched20/run.c b/dlls/riched20/run.c
index d74d68f..f9b1ef6 100644
--- a/dlls/riched20/run.c
+++ b/dlls/riched20/run.c
@@ -512,8 +512,20 @@ int ME_CharFromPoint(ME_TextEditor *edit
   }
   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;




More information about the wine-cvs mailing list