riched20: Don't invalidate while inside TxDraw().

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2021-03-25 09:10:27 +00:00 committed by Alexandre Julliard
parent e668aa9dcb
commit aae4fa9b1c
3 changed files with 5 additions and 5 deletions

View File

@ -202,7 +202,7 @@ void ME_DestroyContext(ME_Context *c) DECLSPEC_HIDDEN;
BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor) DECLSPEC_HIDDEN;
void para_range_invalidate( ME_TextEditor *editor, ME_Paragraph *start_para, ME_Paragraph *last_para ) DECLSPEC_HIDDEN;
void ME_SendRequestResize(ME_TextEditor *editor, BOOL force) DECLSPEC_HIDDEN;
BOOL wrap_marked_paras_dc( ME_TextEditor *editor, HDC hdc ) DECLSPEC_HIDDEN;
BOOL wrap_marked_paras_dc( ME_TextEditor *editor, HDC hdc, BOOL invalidate ) DECLSPEC_HIDDEN;
/* para.c */
void editor_get_selection_paras(ME_TextEditor *editor, ME_Paragraph **para, ME_Paragraph **para_end ) DECLSPEC_HIDDEN;

View File

@ -192,7 +192,7 @@ DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxDraw( ITextServices *iface, DWORD
if (rewrap)
{
editor_mark_rewrap_all( services->editor );
wrap_marked_paras_dc( services->editor, dc );
wrap_marked_paras_dc( services->editor, dc, FALSE );
}
editor_draw( services->editor, dc, update );

View File

@ -1020,7 +1020,7 @@ static void adjust_para_y( ME_Paragraph *para, ME_Context *c, struct repaint_ran
}
}
BOOL wrap_marked_paras_dc( ME_TextEditor *editor, HDC hdc )
BOOL wrap_marked_paras_dc( ME_TextEditor *editor, HDC hdc, BOOL invalidate )
{
ME_Paragraph *para, *next;
struct wine_rb_entry *entry, *next_entry = NULL;
@ -1086,7 +1086,7 @@ BOOL wrap_marked_paras_dc( ME_TextEditor *editor, HDC hdc )
ME_DestroyContext(&c);
if (repaint.start || editor->nTotalLength < editor->nLastTotalLength)
if (invalidate && (repaint.start || editor->nTotalLength < editor->nLastTotalLength))
para_range_invalidate( editor, repaint.start, repaint.end);
return !!repaint.start;
}
@ -1094,7 +1094,7 @@ BOOL wrap_marked_paras_dc( ME_TextEditor *editor, HDC hdc )
BOOL ME_WrapMarkedParagraphs( ME_TextEditor *editor )
{
HDC hdc = ITextHost_TxGetDC( editor->texthost );
BOOL ret = wrap_marked_paras_dc( editor, hdc );
BOOL ret = wrap_marked_paras_dc( editor, hdc, TRUE );
ITextHost_TxReleaseDC( editor->texthost, hdc );
return ret;
}