Commit 548d7179 authored by Jinoh Kang's avatar Jinoh Kang Committed by Alexandre Julliard

riched20: Don't call wrap_marked_paras_dc() before the editor is fully initialized.

Today, CreateTextServices() sometimes triggers an assertion failure in select_style(). When ME_MakeEditor() calls ME_MakeFirstParagraph(), the editor (ME_TextEditor) is not in a fully initialized state. For example, the font cache (pFontCache) is not fully initialized, which sometimes makes select_style() believe that the cache slots are fully occupied. Fix this by delaying the call to wrap_marked_paras_dc() until the editor is fully initialized. Also, delay the call to ITextHost::TxReleaseDC() until after wrap_marked_paras_dc(), since we need the device context a bit longer. Fixes: b70eb32c
parent 03036f42
......@@ -2961,7 +2961,6 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
hdc = ITextHost_TxGetDC( ed->texthost );
ME_MakeFirstParagraph( ed, hdc );
ITextHost_TxReleaseDC( ed->texthost, hdc );
/* The four cursors are for:
* 0 - The position where the caret is shown
* 1 - The anchored end of the selection (for normal selection)
......@@ -3061,6 +3060,9 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
list_init( &ed->reobj_list );
OleInitialize(NULL);
wrap_marked_paras_dc( ed, hdc, FALSE );
ITextHost_TxReleaseDC( ed->texthost, hdc );
return ed;
}
......
......@@ -221,7 +221,6 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor, HDC hdc)
wine_rb_init( &editor->marked_paras, para_mark_compare );
para_mark_add( editor, para );
ME_DestroyContext(&c);
wrap_marked_paras_dc( editor, hdc, FALSE );
}
static void para_mark_rewrap_paras( ME_TextEditor *editor, ME_Paragraph *first, const ME_Paragraph *end )
......
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