Commit 3ebb8784 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

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

parent fbbf3ba4
...@@ -1093,6 +1093,7 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap) ...@@ -1093,6 +1093,7 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
{ {
if (es->x_offset >= get_text_length(es)) if (es->x_offset >= get_text_length(es))
{ {
int leftover = es->x_offset - get_text_length(es);
if (es->ssa) if (es->ssa)
{ {
const SIZE *size; const SIZE *size;
...@@ -1101,8 +1102,10 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap) ...@@ -1101,8 +1102,10 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
} }
else else
xoff = 0; 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 else
xoff = 0; xoff = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment