diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-09 15:13:13 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-09 15:13:13 +0300 |
commit | 017f8e72ac56a88ecaea40dd1c52b1da0ae46986 (patch) | |
tree | 63f9429a30caa5a96dc18431c225b8d8aa57d83c /plugins/TabSRMM/src/msgdlgutils.cpp | |
parent | 6bf18e4265c8a0938d12e98eef1562b1ee4bc97b (diff) |
common rtf management code moved to the core
Diffstat (limited to 'plugins/TabSRMM/src/msgdlgutils.cpp')
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index cd1a49147b..30c5fff688 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -764,29 +764,6 @@ void CTabBaseDlg::FlashOnClist(MEVENT hEvent, DBEVENTINFO *dbei) // caller must mir_free the returned pointer.
// UNICODE version returns UTF-8 encoded string.
-static DWORD CALLBACK Message_StreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
-{
- static DWORD dwRead;
- char **ppText = (char **)dwCookie;
-
- if (*ppText == nullptr) {
- *ppText = (char *)mir_alloc(cb + 2);
- memcpy(*ppText, pbBuff, cb);
- *pcb = cb;
- dwRead = cb;
- *(*ppText + cb) = '\0';
- }
- else {
- char *p = (char *)mir_realloc(*ppText, dwRead + cb + 2);
- memcpy(p + dwRead, pbBuff, cb);
- *ppText = p;
- *pcb = cb;
- dwRead += cb;
- *(*ppText + dwRead) = '\0';
- }
- return 0;
-}
-
char* TSAPI Message_GetFromStream(HWND hwndRtf, DWORD dwPassedFlags)
{
if (hwndRtf == 0)
@@ -800,7 +777,7 @@ char* TSAPI Message_GetFromStream(HWND hwndRtf, DWORD dwPassedFlags) char *pszText = nullptr;
EDITSTREAM stream = { 0 };
- stream.pfnCallback = Message_StreamCallback;
+ stream.pfnCallback = Srmm_MessageStreamCallback;
stream.dwCookie = (DWORD_PTR)&pszText; // pass pointer to pointer
SendMessage(hwndRtf, EM_STREAMOUT, dwFlags, (LPARAM)&stream);
return pszText; // pszText contains the text
|