diff options
Diffstat (limited to 'plugins/Scriver/src/input.cpp')
-rw-r--r-- | plugins/Scriver/src/input.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
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);
|