Module: wine Branch: master Commit: ac6a0d8923068ef99ccdb626fd2f2264ac2d198d URL: http://source.winehq.org/git/wine.git/?a=commit;h=ac6a0d8923068ef99ccdb626fd...
Author: Huw Davies huw@codeweavers.com Date: Wed Oct 5 10:08:25 2016 +0100
riched20: Alter ME_SaveTempStyle() to accept the new style.
Signed-off-by: Huw Davies huw@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/riched20/editor.c | 6 +++--- dlls/riched20/editor.h | 2 +- dlls/riched20/style.c | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 4adc74f..7b934fe 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2392,7 +2392,7 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey) }
style = ME_GetInsertStyle(editor, 0); - ME_SaveTempStyle(editor); + ME_SaveTempStyle(editor, style); ME_ContinueCoalescingTransaction(editor); if (shift_is_down) ME_InsertEndRowFromCursor(editor, 0); @@ -2566,7 +2566,7 @@ static LRESULT ME_Char(ME_TextEditor *editor, WPARAM charCode, if(editor->nTextLimit > ME_GetTextLength(editor) - (to-from)) { ME_Style *style = ME_GetInsertStyle(editor, 0); - ME_SaveTempStyle(editor); + ME_SaveTempStyle(editor, style); ME_ContinueCoalescingTransaction(editor); ME_InsertTextFromCursor(editor, 0, &wstr, 1, style); ME_ReleaseStyle(style); @@ -4538,7 +4538,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, ME_Style *style = ME_GetInsertStyle(editor, 0); hIMC = ITextHost_TxImmGetContext(editor->texthost); ME_DeleteSelection(editor); - ME_SaveTempStyle(editor); + ME_SaveTempStyle(editor, style); if (lParam & (GCS_RESULTSTR|GCS_COMPSTR)) { LPWSTR lpCompStr = NULL; diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index c62b3a4..b0a8a1a 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -76,7 +76,7 @@ ME_Style *ME_ApplyStyle(ME_TextEditor *ed, ME_Style *sSrc, CHARFORMAT2W *style) HFONT ME_SelectStyleFont(ME_Context *c, ME_Style *s) DECLSPEC_HIDDEN; void ME_UnselectStyleFont(ME_Context *c, ME_Style *s, HFONT hOldFont) DECLSPEC_HIDDEN; void ME_InitCharFormat2W(CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN; -void ME_SaveTempStyle(ME_TextEditor *editor) DECLSPEC_HIDDEN; +void ME_SaveTempStyle(ME_TextEditor *editor, ME_Style *style) DECLSPEC_HIDDEN; void ME_ClearTempStyle(ME_TextEditor *editor) DECLSPEC_HIDDEN; void ME_DumpStyleToBuf(CHARFORMAT2W *pFmt, char buf[2048]) DECLSPEC_HIDDEN; void ME_DumpStyle(ME_Style *s) DECLSPEC_HIDDEN; diff --git a/dlls/riched20/style.c b/dlls/riched20/style.c index 06c0e6f..0d2c16a 100644 --- a/dlls/riched20/style.c +++ b/dlls/riched20/style.c @@ -513,12 +513,13 @@ ME_Style *ME_GetInsertStyle(ME_TextEditor *editor, int nCursor) } }
-void ME_SaveTempStyle(ME_TextEditor *editor) +void ME_SaveTempStyle(ME_TextEditor *editor, ME_Style *style) { ME_Style *old_style = editor->pBuffer->pCharStyle; - editor->pBuffer->pCharStyle = ME_GetInsertStyle(editor, 0); - if (old_style) - ME_ReleaseStyle(old_style); + + if (style) ME_AddRefStyle( style ); + editor->pBuffer->pCharStyle = style; + if (old_style) ME_ReleaseStyle( old_style ); }
void ME_ClearTempStyle(ME_TextEditor *editor)