Oops! Good Call, Phil.

Attached is an updated patch.
--Matt

On 8/7/06, Phil Krylov <[EMAIL PROTECTED]> wrote:
Hi Matt,

On 07/08/06, Matt Finnicum <[EMAIL PROTECTED]> wrote:
> This patch modifies ME_CharFromPoint to work properly with password
> controls (the patch i sent in / got committed a couple days ago).

Should not the temp string be freed afterwards?

-- Ph.

From 880850b5980515549833854c81e8d445cba758cb Mon Sep 17 00:00:00 2001
From: Matthew Finnicum <[EMAIL PROTECTED]>
Date: Mon, 7 Aug 2006 10:12:44 -0400
Subject: [PATCH] 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;
-- 
1.4.1.1



Reply via email to