diff options
author | George Hazan <ghazan@miranda.im> | 2017-05-03 14:33:15 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-05-03 14:33:15 +0300 |
commit | 87c02d014a70340c62ec4db161a5bae90dd5cf88 (patch) | |
tree | cf67602ddbd789fb56d171fc1a8223cc43097bce /plugins | |
parent | 123e58d3532de25c3c5b9fb3f5a7ca3b8c5a3764 (diff) |
winapi perversion removed (fixes #809)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Scriver/src/msgdialog.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 9a92590931..cebfea6c55 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -434,26 +434,18 @@ void CSrmmWindow::onClick_Ok(CCtrlButton *pButton) pf2.dwMask = PFM_RTLPARA;
m_message.SendMsg(EM_GETPARAFORMAT, 0, (LPARAM)&pf2);
- int bufSize = m_message.GetRichTextLength(1200) + 2;
- ptrW ptszUnicode((wchar_t*)mir_alloc(bufSize * sizeof(wchar_t)));
-
MessageSendQueueItem msi = { 0 };
if (pf2.wEffects & PFE_RTLPARA)
msi.flags |= PREF_RTL;
- GETTEXTEX gt = { 0 };
- gt.flags = GT_DEFAULT;
- gt.cb = bufSize * sizeof(wchar_t);
- gt.codepage = 1200; // Unicode
- m_message.SendMsg(EM_GETTEXTEX, (WPARAM)>, ptszUnicode);
- if (Utils_IsRtl(ptszUnicode))
- msi.flags |= PREF_RTL;
-
- msi.sendBuffer = mir_utf8encodeW(ptszUnicode);
+ msi.sendBuffer = m_message.GetRichTextUtf();
msi.sendBufferSize = (int)mir_strlen(msi.sendBuffer);
if (msi.sendBufferSize == 0)
return;
+ if (Utils_IsRtl(ptrW(mir_utf8decodeW(msi.sendBuffer))))
+ msi.flags |= PREF_RTL;
+
/* Store messaging history */
TCmdList *cmdListNew = tcmdlist_last(cmdList);
while (cmdListNew != nullptr && cmdListNew->temporary) {
|