Commit ac6a0d89 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

riched20: Alter ME_SaveTempStyle() to accept the new style.

parent 4989c858
......@@ -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;
......
......@@ -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;
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment