summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-05-03 14:33:15 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-05-03 14:33:15 +0300
commit87c02d014a70340c62ec4db161a5bae90dd5cf88 (patch)
treecf67602ddbd789fb56d171fc1a8223cc43097bce
parent123e58d3532de25c3c5b9fb3f5a7ca3b8c5a3764 (diff)
winapi perversion removed (fixes #809)
-rw-r--r--plugins/Scriver/src/msgdialog.cpp16
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)&gt, 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) {