Aric Stewart : usp10: Better handle cases in single line edit controls where es-> x_offset exceeds line length.

Alexandre Julliard julliard at winehq.org
Tue Jan 10 13:11:20 CST 2012


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Mon Jan  9 13:30:31 2012 -0600

usp10: Better handle cases in single line edit controls where es->x_offset exceeds line length.

---

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

diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c
index 0fcc9db..81cb6cc 100644
--- a/dlls/user32/edit.c
+++ b/dlls/user32/edit.c
@@ -1093,6 +1093,7 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
 			{
 				if (es->x_offset >= get_text_length(es))
 				{
+					int leftover = es->x_offset - get_text_length(es);
 					if (es->ssa)
 					{
 						const SIZE *size;
@@ -1101,8 +1102,10 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
 					}
 					else
 						xoff = 0;
+					xoff += es->char_width * leftover;
 				}
-				ScriptStringCPtoX(es->ssa, es->x_offset, FALSE, &xoff);
+				else
+					ScriptStringCPtoX(es->ssa, es->x_offset, FALSE, &xoff);
 			}
 			else
 				xoff = 0;




More information about the wine-cvs mailing list