mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 08:54:05 +00:00
riched20: Factor out device context acquisition from ME_MakeFirstParagraph.
This lets ME_MakeEditor() reuse the device context throughout the editor initialization process.
This commit is contained in:
parent
94d61d1b28
commit
03036f42e1
|
@ -2931,6 +2931,7 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
|
|||
int i;
|
||||
LONG selbarwidth;
|
||||
HRESULT hr;
|
||||
HDC hdc;
|
||||
|
||||
ed->sizeWindow.cx = ed->sizeWindow.cy = 0;
|
||||
if (ITextHost_QueryInterface( texthost, &IID_ITextHost2, (void **)&ed->texthost ) == S_OK)
|
||||
|
@ -2957,7 +2958,10 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
|
|||
ed->nZoomNumerator = ed->nZoomDenominator = 0;
|
||||
ed->nAvailWidth = 0; /* wrap to client area */
|
||||
list_init( &ed->style_list );
|
||||
ME_MakeFirstParagraph(ed);
|
||||
|
||||
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)
|
||||
|
|
|
@ -209,7 +209,7 @@ void editor_get_selection_para_fmt( ME_TextEditor *editor, PARAFORMAT2 *fmt );
|
|||
void editor_mark_rewrap_all( ME_TextEditor *editor );
|
||||
void editor_set_default_para_fmt(ME_TextEditor *editor, PARAFORMAT2 *pFmt);
|
||||
BOOL editor_set_selection_para_fmt( ME_TextEditor *editor, const PARAFORMAT2 *fmt );
|
||||
void ME_MakeFirstParagraph(ME_TextEditor *editor);
|
||||
void ME_MakeFirstParagraph(ME_TextEditor *editor, HDC hdc);
|
||||
void ME_DumpParaStyle(ME_Paragraph *s);
|
||||
void ME_DumpParaStyleToBuf(const PARAFORMAT2 *pFmt, char buf[2048]);
|
||||
int get_total_width(ME_TextEditor *editor);
|
||||
|
|
|
@ -148,7 +148,7 @@ ME_Row *para_end_row( ME_Paragraph *para )
|
|||
return &item->member.row;
|
||||
}
|
||||
|
||||
void ME_MakeFirstParagraph(ME_TextEditor *editor)
|
||||
void ME_MakeFirstParagraph(ME_TextEditor *editor, HDC hdc)
|
||||
{
|
||||
ME_Context c;
|
||||
CHARFORMAT2W cf;
|
||||
|
@ -160,7 +160,6 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor)
|
|||
ME_Run *run;
|
||||
ME_Style *style;
|
||||
int eol_len;
|
||||
HDC hdc = ITextHost_TxGetDC( editor->texthost );
|
||||
|
||||
ME_InitContext( &c, editor, hdc );
|
||||
|
||||
|
@ -223,7 +222,6 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor)
|
|||
para_mark_add( editor, para );
|
||||
ME_DestroyContext(&c);
|
||||
wrap_marked_paras_dc( editor, hdc, FALSE );
|
||||
ITextHost_TxReleaseDC( editor->texthost, hdc );
|
||||
}
|
||||
|
||||
static void para_mark_rewrap_paras( ME_TextEditor *editor, ME_Paragraph *first, const ME_Paragraph *end )
|
||||
|
|
Loading…
Reference in a new issue