riched20: Don't create a display context in InvalidateParagraphRange().

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2020-10-09 12:59:21 +01:00 committed by Alexandre Julliard
parent b466eefbdf
commit c3e6cb5b70

View file

@ -1093,28 +1093,25 @@ void ME_InvalidateParagraphRange(ME_TextEditor *editor,
ME_DisplayItem *start_para,
ME_DisplayItem *last_para)
{
ME_Context c;
RECT rc;
int ofs;
ME_InitContext(&c, editor, ITextHost_TxGetDC(editor->texthost));
rc = c.rcView;
rc = editor->rcFormat;
ofs = editor->vert_si.nPos;
if (start_para) {
if (start_para)
{
start_para = ME_GetOuterParagraph(start_para);
last_para = ME_GetOuterParagraph(last_para);
rc.top = c.rcView.top + start_para->member.para.pt.y - ofs;
rc.top += start_para->member.para.pt.y - ofs;
} else {
rc.top = c.rcView.top + editor->nTotalLength - ofs;
rc.top += editor->nTotalLength - ofs;
}
if (editor->nTotalLength < editor->nLastTotalLength)
rc.bottom = c.rcView.top + editor->nLastTotalLength - ofs;
rc.bottom = editor->rcFormat.top + editor->nLastTotalLength - ofs;
else
rc.bottom = c.rcView.top + last_para->member.para.pt.y + last_para->member.para.nHeight - ofs;
rc.bottom = editor->rcFormat.top + last_para->member.para.pt.y + last_para->member.para.nHeight - ofs;
ITextHost_TxInvalidateRect(editor->texthost, &rc, TRUE);
ME_DestroyContext(&c);
}