summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-29 17:32:56 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-29 17:32:56 +0000
commit106ade93d5a6f1051db3e1a3b8a70dda51118137 (patch)
treedf0b85f1c169784b26e618fb743b74685fe45523 /plugins
parent024b8c5ae150b43f68c7af37c429c9472c4c2b7e (diff)
fix for the command history in Scriver
git-svn-id: http://svn.miranda-ng.org/main/trunk@13896 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
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);