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