Commit 6df4148b authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

richedit: Prevent redundant rewraps when scrollbar is shown.

A common case for richedit controls are that a large amount of text is set initially with word wrap enabled. This causes the initially wrapping of the text, which also calculates the text length. After this the vertical scrollbar will be shown, which causes the text to be rewrapped again. After this there are two redundant rewraps that are done which this patch eliminates.
parent a16db0af
......@@ -1099,14 +1099,7 @@ void ME_UpdateScrollBar(ME_TextEditor *editor)
bScrollBarWillBeVisible = TRUE;
}
if (bScrollBarWasVisible != bScrollBarWillBeVisible)
{
ShowScrollBar(hWnd, SB_VERT, bScrollBarWillBeVisible);
ME_MarkAllForWrapping(editor);
ME_WrapMarkedParagraphs(editor);
}
si.nMin = 0;
si.nMin = 0;
si.nMax = editor->nTotalLength;
si.nPos = editor->vert_si.nPos;
si.nPage = editor->sizeWindow.cy;
......@@ -1122,6 +1115,9 @@ void ME_UpdateScrollBar(ME_TextEditor *editor)
if (bScrollBarWillBeVisible || bScrollBarWasVisible)
SetScrollInfo(hWnd, SB_VERT, &si, TRUE);
}
if (bScrollBarWasVisible != bScrollBarWillBeVisible)
ShowScrollBar(hWnd, SB_VERT, bScrollBarWillBeVisible);
}
int ME_GetYScrollPos(ME_TextEditor *editor)
......
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