Aric Stewart : user32: Respect rev for painting selections.
Alexandre Julliard
julliard at winehq.org
Mon Oct 31 12:49:07 CDT 2011
Module: wine
Branch: master
Commit: 4b7300ef770ac6a07d8306222d7b1cce466568db
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4b7300ef770ac6a07d8306222d7b1cce466568db
Author: Aric Stewart <aric at codeweavers.com>
Date: Mon Oct 31 10:06:50 2011 -0500
user32: Respect rev for painting selections.
---
dlls/user32/edit.c | 24 ++++++++++++++----------
1 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c
index bfee8f5..23033b8 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) &&
More information about the wine-cvs
mailing list