Commit 67024f0f authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

richedit: Prevented an assertion error on startup when run on Windows.

The call to GetClientRect returns 0 values for the returned RECT when called in WM_NCCREATE in on Windows, which ended up causing an assertion error when Wine's riched20.dll replaces the native version. Moving the call to WM_CREATE fixes this problem (probably because NCCALCSIZE is called in between).
parent 1840a5bc
......@@ -1666,7 +1666,6 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) {
ed->mode = TM_RICHTEXT | TM_MULTILEVELUNDO | TM_MULTICODEPAGE;
ed->AutoURLDetect_bEnable = FALSE;
ed->bHaveFocus = FALSE;
GetClientRect(hWnd, &ed->rcFormat);
for (i=0; i<HFONT_CACHE_SIZE; i++)
{
ed->pFontCache[i].nRefs = 0;
......@@ -2934,6 +2933,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
return (wParam >= 0x40000) ? 0 : MAKELONG( pt.x, pt.y );
}
case WM_CREATE:
GetClientRect(hWnd, &editor->rcFormat);
if (GetWindowLongW(hWnd, GWL_STYLE) & WS_HSCROLL)
{ /* Squelch the default horizontal scrollbar it would make */
ShowScrollBar(editor->hWnd, SB_HORZ, FALSE);
......
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