summaryrefslogtreecommitdiff
path: root/plugins/Scriver
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-03-21 13:03:07 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-03-21 13:03:07 +0000
commitf6ccc9a04a25f10090c2619f07956b87a18311ce (patch)
tree5c7f1ed137d08609b295fb4f5cf8f855465f5487 /plugins/Scriver
parent517640c8d103686ed84725236a8e6d8c03bbf906 (diff)
all SRMMs to send messages right trimmed
git-svn-id: http://svn.miranda-ng.org/main/trunk@12466 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Scriver')
-rw-r--r--plugins/Scriver/src/msgdialog.cpp11
1 files changed, 5 insertions, 6 deletions
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;