From 4b7300ef770ac6a07d8306222d7b1cce466568db Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Mon, 31 Oct 2011 10:06:50 -0500 Subject: [PATCH] user32: Respect rev for painting selections. --- dlls/user32/edit.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index bfee8f5ff19..23033b8bd1c 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -2136,10 +2136,10 @@ static INT EDIT_PaintText(EDITSTATE *es, HDC dc, INT x, INT y, INT line, INT col */ static void EDIT_PaintLine(EDITSTATE *es, HDC dc, INT line, BOOL rev) { - INT s; - INT e; - INT li; - INT ll; + INT s = 0; + INT e = 0; + INT li = 0; + INT ll = 0; INT x; INT y; LRESULT pos; @@ -2185,12 +2185,16 @@ static void EDIT_PaintLine(EDITSTATE *es, HDC dc, INT line, BOOL rev) x += es->format_rect.left; } - li = EDIT_EM_LineIndex(es, line); - ll = EDIT_EM_LineLength(es, li); - s = min(es->selection_start, es->selection_end); - e = max(es->selection_start, es->selection_end); - s = min(li + ll, max(li, s)); - e = min(li + ll, max(li, e)); + if (rev) + { + li = EDIT_EM_LineIndex(es, line); + ll = EDIT_EM_LineLength(es, li); + s = min(es->selection_start, es->selection_end); + e = max(es->selection_start, es->selection_end); + s = min(li + ll, max(li, s)); + e = min(li + ll, max(li, e)); + } + if (ssa) ScriptStringOut(ssa, x, y, 0, &es->format_rect, s - li, e - li, FALSE); else if (rev && (s != e) && -- 2.11.4.GIT