From 09cace2f7d8fdbfb047eba9a6396d79d59422443 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 27 May 2015 14:57:44 +0000 Subject: massive ansi cleaning for Scriver git-svn-id: http://svn.miranda-ng.org/main/trunk@13860 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Scriver/src/input.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'plugins/Scriver/src/input.cpp') diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp index 81c3b5c8d7..69f6691c09 100644 --- a/plugins/Scriver/src/input.cpp +++ b/plugins/Scriver/src/input.cpp @@ -210,16 +210,10 @@ int InputAreaShortcuts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, Common cmdListNew = tcmdlist_last(windowData->cmdList); } if (cmdListNew != NULL) { - char *textBuffer; - if (windowData->flags & CWDF_RTF_INPUT) - textBuffer = GetRichTextRTF(hwnd); - else - textBuffer = GetRichTextEncoded(hwnd, windowData->codePage); - - if (textBuffer != NULL) { + char *textBuffer = GetRichTextUtf(hwnd); + if (textBuffer != NULL) + // takes textBuffer to a queue, no leak here windowData->cmdList = tcmdlist_append(windowData->cmdList, textBuffer, 20, TRUE); - mir_free(textBuffer); - } } } else if (windowData->cmdListCurrent->prev != NULL) @@ -234,12 +228,9 @@ int InputAreaShortcuts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, Common } } if (cmdListNew != NULL) { - int iLen; SendMessage(hwnd, WM_SETREDRAW, FALSE, 0); - if (windowData->flags & CWDF_RTF_INPUT) - iLen = SetRichTextRTF(hwnd, cmdListNew->szCmd); - else - iLen = SetRichTextEncoded(hwnd, cmdListNew->szCmd); + + int iLen = SetRichText(hwnd, ptrT(mir_utf8decodeT(cmdListNew->szCmd))); SendMessage(hwnd, EM_SCROLLCARET, 0, 0); SendMessage(hwnd, WM_SETREDRAW, TRUE, 0); -- cgit v1.2.3