From f6ccc9a04a25f10090c2619f07956b87a18311ce Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 21 Mar 2015 13:03:07 +0000 Subject: all SRMMs to send messages right trimmed git-svn-id: http://svn.miranda-ng.org/main/trunk@12466 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Scriver/src/msgdialog.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'plugins/Scriver/src') diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 3ee6777259..e40d7cf57d 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -1634,12 +1634,14 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP pf2.dwMask = PFM_RTLPARA; SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_GETPARAFORMAT, 0, (LPARAM)&pf2); + ptrA szSendBuffer((char*)mir_alloc(bufSize)); + MessageSendQueueItem msi = { 0 }; msi.flags = PREF_TCHAR; if (pf2.wEffects & PFE_RTLPARA) msi.flags |= PREF_RTL; msi.sendBufferSize = bufSize; - msi.sendBuffer = (char*)mir_alloc(msi.sendBufferSize); + msi.sendBuffer = szSendBuffer; GETTEXTEX gt = { 0 }; gt.flags = GT_USECRLF; @@ -1652,10 +1654,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (RTL_Detect((wchar_t*)&msi.sendBuffer[ansiBufSize])) msi.flags |= PREF_RTL; - if (msi.sendBuffer[0] == 0) { - mir_free(msi.sendBuffer); + if (msi.sendBuffer[0] == 0) break; - } /* Store messaging history */ char *msgText = GetRichTextEncoded(GetDlgItem(hwndDlg, IDC_MESSAGE), dat->codePage); @@ -1665,7 +1665,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP cmdListNew = tcmdlist_last(dat->cmdList); } if (msgText != NULL) { - dat->cmdList = tcmdlist_append(dat->cmdList, msgText, 20, FALSE); + dat->cmdList = tcmdlist_append(dat->cmdList, rtrim(msgText), 20, FALSE); mir_free(msgText); } dat->cmdListCurrent = NULL; @@ -1681,7 +1681,6 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendMessage(dat->hwndParent, DM_SENDMESSAGE, 0, (LPARAM)&msi); else SendMessage(hwndDlg, DM_SENDMESSAGE, 0, (LPARAM)&msi); - mir_free(msi.sendBuffer); } return TRUE; -- cgit v1.2.3