summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Scriver/src/input.cpp2
-rw-r--r--plugins/Scriver/src/utils.cpp13
-rw-r--r--plugins/Scriver/src/utils.h1
3 files changed, 14 insertions, 2 deletions
diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp
index 69f6691c09..69f9219bf2 100644
--- a/plugins/Scriver/src/input.cpp
+++ b/plugins/Scriver/src/input.cpp
@@ -230,7 +230,7 @@ int InputAreaShortcuts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, Common
if (cmdListNew != NULL) {
SendMessage(hwnd, WM_SETREDRAW, FALSE, 0);
- int iLen = SetRichText(hwnd, ptrT(mir_utf8decodeT(cmdListNew->szCmd)));
+ int iLen = SetRichTextRTF(hwnd, cmdListNew->szCmd);
SendMessage(hwnd, EM_SCROLLCARET, 0, 0);
SendMessage(hwnd, WM_SETREDRAW, TRUE, 0);
diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp
index f0f01ef9dc..6d7ae724fe 100644
--- a/plugins/Scriver/src/utils.cpp
+++ b/plugins/Scriver/src/utils.cpp
@@ -117,7 +117,18 @@ int SetRichText(HWND hwnd, const TCHAR *text)
st.flags = ST_DEFAULT;
st.codepage = 1200;
SendMessage(hwnd, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)text);
- return GetRichTextLength(hwnd, st.codepage, FALSE);
+
+ return GetRichTextLength(hwnd, 1200, FALSE);
+}
+
+int SetRichTextRTF(HWND hwnd, const char *text)
+{
+ SETTEXTEX st;
+ st.flags = ST_DEFAULT;
+ st.codepage = CP_UTF8;
+ SendMessage(hwnd, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)text);
+
+ return GetRichTextLength(hwnd, 1200, FALSE);
}
static DWORD CALLBACK RichTextStreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG * pcb)
diff --git a/plugins/Scriver/src/utils.h b/plugins/Scriver/src/utils.h
index db7c357bd7..07847abb8d 100644
--- a/plugins/Scriver/src/utils.h
+++ b/plugins/Scriver/src/utils.h
@@ -43,6 +43,7 @@ char* GetRichTextRTF(HWND hwnd);
char* GetRichTextUtf(HWND hwnd);
TCHAR *GetRichTextWord(HWND hwnd, POINTL *pt);
int SetRichText(HWND hwnd, const TCHAR *text);
+int SetRichTextRTF(HWND hwnd, const char *text);
void SearchWord(TCHAR * word, int engine);
HDWP ResizeToolbar(HWND hwnd, HDWP hdwp, int width, int vPos, int height, int cControls, const ToolbarButton * buttons, int controlVisibility);
void ShowToolbarControls(HWND hwndDlg, int cControls, const ToolbarButton * buttons, int controlVisibility, int state);