Module: wine Branch: master Commit: c3e6cb5b70a99feb863a158104d8db58165079be URL: https://source.winehq.org/git/wine.git/?a=commit;h=c3e6cb5b70a99feb863a15810...
Author: Huw Davies huw@codeweavers.com Date: Fri Oct 9 12:59:21 2020 +0100
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
---
dlls/riched20/wrap.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/dlls/riched20/wrap.c b/dlls/riched20/wrap.c index 819915d4c0..5ff9623e33 100644 --- a/dlls/riched20/wrap.c +++ b/dlls/riched20/wrap.c @@ -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); }