[PATCH 4/5] riched20: Don't create a display context in InvalidateParagraphRange().
Huw Davies
huw at codeweavers.com
Fri Oct 9 06:59:21 CDT 2020
Signed-off-by: Huw Davies <huw at codeweavers.com>
---
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 819915d4c09..5ff9623e336 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);
}
--
2.23.0
More information about the wine-devel
mailing list