Commit f24678b2 authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

richedit: Scroll cursor into view even with redraw turned off.

parent 582bdade
......@@ -159,7 +159,6 @@ void ME_UpdateRepaint(ME_TextEditor *editor)
BOOL wrappedParagraphs;
wrappedParagraphs = ME_WrapMarkedParagraphs(editor);
if (!editor->bRedraw) return;
if (wrappedParagraphs)
ME_UpdateScrollBar(editor);
......@@ -174,7 +173,8 @@ void ME_UpdateRepaint(ME_TextEditor *editor)
ME_SendOldNotify(editor, EN_CHANGE);
editor->nEventMask |= ENM_CHANGE;
}
ME_Repaint(editor);
if (editor->bRedraw)
ME_Repaint(editor);
ME_SendSelChange(editor);
}
......@@ -185,10 +185,10 @@ ME_RewrapRepaint(ME_TextEditor *editor)
* looks, but not content. Like resizing. */
ME_MarkAllForWrapping(editor);
ME_WrapMarkedParagraphs(editor);
ME_UpdateScrollBar(editor);
if (editor->bRedraw)
{
ME_WrapMarkedParagraphs(editor);
ME_UpdateScrollBar(editor);
ME_Repaint(editor);
}
}
......@@ -1093,6 +1093,7 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type)
|| (winStyle & ES_DISABLENOSCROLL);
if (bScrollBarIsVisible != bScrollBarWillBeVisible)
{
/* FIXME: ShowScrollBar will redraw the scrollbar when editor->bRedraw is FALSE */
ShowScrollBar(hWnd, SB_VERT, bScrollBarWillBeVisible);
}
ME_UpdateScrollBar(editor);
......@@ -1126,6 +1127,7 @@ void ME_UpdateScrollBar(ME_TextEditor *editor)
if (bScrollBarWasVisible != bScrollBarWillBeVisible)
{
/* FIXME: ShowScrollBar will redraw the scrollbar when editor->bRedraw is FALSE */
ShowScrollBar(hWnd, SB_VERT, bScrollBarWillBeVisible);
ME_MarkAllForWrapping(editor);
ME_WrapMarkedParagraphs(editor);
......@@ -1144,13 +1146,14 @@ void ME_UpdateScrollBar(ME_TextEditor *editor)
editor->vert_si.nPage = si.nPage;
if (bScrollBarWillBeVisible)
{
SetScrollInfo(hWnd, SB_VERT, &si, TRUE);
SetScrollInfo(hWnd, SB_VERT, &si, editor->bRedraw);
}
else
{
if (bScrollBarWasVisible && !(si.fMask & SIF_DISABLENOSCROLL))
{
SetScrollInfo(hWnd, SB_VERT, &si, TRUE);
SetScrollInfo(hWnd, SB_VERT, &si, editor->bRedraw);
/* FIXME: ShowScrollBar will redraw the scrollbar when editor->bRedraw is FALSE */
ShowScrollBar(hWnd, SB_VERT, FALSE);
ME_ScrollAbs(editor, 0);
}
......
......@@ -5189,7 +5189,7 @@ static void test_eventMask(void)
SendMessage(eventMaskEditHwnd, WM_SETREDRAW, FALSE, 0);
queriedEventMask = 0; /* initialize to something other than we expect */
SendMessage(eventMaskEditHwnd, EM_REPLACESEL, 0, (LPARAM) text);
todo_wine ok(queriedEventMask == (eventMask & ~ENM_CHANGE),
ok(queriedEventMask == (eventMask & ~ENM_CHANGE),
"wrong event mask (0x%x) during WM_COMMAND\n", queriedEventMask);
SendMessage(eventMaskEditHwnd, WM_SETREDRAW, TRUE, 0);
......@@ -5568,7 +5568,7 @@ static void test_word_wrap(void)
ok(lines == 1, "Line wasn't expected to wrap (lines=%d).\n", lines);
MoveWindow(hwnd, 0, 0, 200, 80, FALSE);
lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
todo_wine ok(lines > 1, "Line was expected to wrap (lines=%d).\n", lines);
ok(lines > 1, "Line was expected to wrap (lines=%d).\n", lines);
SendMessage(hwnd, WM_SETREDRAW, TRUE, 0);
DestroyWindow(hwnd);
......@@ -5588,15 +5588,9 @@ static void test_auto_yscroll(void)
ok(lines == 8, "%d lines instead of 8\n", lines);
ret = SendMessage(hwnd, EM_GETSCROLLPOS, 0, (LPARAM)&pt);
ok(ret == 1, "EM_GETSCROLLPOS returned %d instead of 1\n", ret);
if (!redraw)
todo_wine ok(pt.y != 0, "Didn't scroll down after replacing text.\n");
else
ok(pt.y != 0, "Didn't scroll down after replacing text.\n");
ok(pt.y != 0, "Didn't scroll down after replacing text.\n");
ret = GetWindowLong(hwnd, GWL_STYLE);
if (!redraw)
todo_wine ok(ret & WS_VSCROLL, "Scrollbar was not shown yet (style=%x).\n", (UINT)ret);
else
ok(ret & WS_VSCROLL, "Scrollbar was not shown yet (style=%x).\n", (UINT)ret);
ok(ret & WS_VSCROLL, "Scrollbar was not shown yet (style=%x).\n", (UINT)ret);
SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM)NULL);
lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 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