Thomas Faber : riched20: Do not return incorrect values from ME_CharFromPoint[Cursor].

Alexandre Julliard julliard at winehq.org
Mon Oct 24 13:43:56 CDT 2011


Module: wine
Branch: master
Commit: 5e0050d0010a3007d70b6f2245832337fc82cb05
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5e0050d0010a3007d70b6f2245832337fc82cb05

Author: Thomas Faber <thfabba at gmx.de>
Date:   Sat Oct 22 21:41:28 2011 +0200

riched20: Do not return incorrect values from ME_CharFromPoint[Cursor].

---

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

diff --git a/dlls/riched20/run.c b/dlls/riched20/run.c
index 4a9ae7a..8a1f91f 100644
--- a/dlls/riched20/run.c
+++ b/dlls/riched20/run.c
@@ -434,7 +434,7 @@ int ME_CharFromPoint(ME_Context *c, int cx, ME_Run *run)
   int fit = 0;
   HGDIOBJ hOldFont;
   SIZE sz;
-  if (!run->strText->nLen)
+  if (!run->strText->nLen || cx <= 0)
     return 0;
 
   if (run->nFlags & MERF_TAB ||
@@ -492,7 +492,7 @@ int ME_CharFromPointCursor(ME_TextEditor *editor, int cx, ME_Run *run)
   ME_Context c;
   HGDIOBJ hOldFont;
   SIZE sz, sz2, sz3;
-  if (!run->strText->nLen)
+  if (!run->strText->nLen || cx <= 0)
     return 0;
 
   if (run->nFlags & (MERF_TAB | MERF_ENDCELL))




More information about the wine-cvs mailing list