riched20: make EM_EXLINEFROMCHAR handle special case of lParam == -1

Murph mattfinn at gmail.com
Mon Aug 21 07:25:51 CDT 2006


Hi,
EM_EXLINEFROMCHAR should treat a lParam of -1 as meaning "whichever
line the caret is at". This isn't mentioned in MSDN, but it follows
suit with EM_LINEFROMCHAR, and is demonstrated in bug 5987 (which this
patch fixes).
--Matt Finnicum
-------------- next part --------------
From 53c918f45e192cd619b278200bfae45c39a6ef1d Mon Sep 17 00:00:00 2001
From: Matthew Finnicum <MattFinn at gmail.com>
Date: Mon, 21 Aug 2006 07:22:22 -0500
Subject: [PATCH] riched20: make EM_EXLINEFROMCHAR handle special case of lParam == -1

---
 dlls/riched20/editor.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index bf406bf..1ee39aa 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -2151,7 +2151,10 @@ LRESULT WINAPI RichEditANSIWndProc(HWND 
   }
   case EM_EXLINEFROMCHAR:
   {
-    return ME_RowNumberFromCharOfs(editor, lParam);
+    if (lParam == -1)
+      return ME_RowNumberFromCharOfs(editor, ME_GetCursorOfs(editor,1));
+    else    
+      return ME_RowNumberFromCharOfs(editor, lParam);
   }
   case EM_LINEINDEX:
   {
-- 
1.4.2


More information about the wine-patches mailing list