Huw Davies : riched20: Don't invalidate while inside TxDraw().
Alexandre Julliard
julliard at winehq.org
Thu Mar 25 16:49:21 CDT 2021
Module: wine
Branch: master
Commit: aae4fa9b1cdf0012a3fc07c553b08ea211fa03b0
URL: https://source.winehq.org/git/wine.git/?a=commit;h=aae4fa9b1cdf0012a3fc07c553b08ea211fa03b0
Author: Huw Davies <huw at codeweavers.com>
Date: Thu Mar 25 09:10:27 2021 +0000
riched20: Don't invalidate while inside TxDraw().
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/riched20/editor.h | 2 +-
dlls/riched20/txtsrv.c | 2 +-
dlls/riched20/wrap.c | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h
index 929e10a3179..bf713880f8f 100644
--- a/dlls/riched20/editor.h
+++ b/dlls/riched20/editor.h
@@ -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;
diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c
index 6ef7b7ef029..79ade0f6117 100644
--- a/dlls/riched20/txtsrv.c
+++ b/dlls/riched20/txtsrv.c
@@ -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 );
diff --git a/dlls/riched20/wrap.c b/dlls/riched20/wrap.c
index 468b267ceae..9456d54d815 100644
--- a/dlls/riched20/wrap.c
+++ b/dlls/riched20/wrap.c
@@ -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;
}
More information about the wine-cvs
mailing list