summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-12-13 16:13:40 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-12-13 16:13:40 +0300
commit23eae978b38168c428c56aa81a29903b2a17452e (patch)
tree273b6c8a35a174a642d0ebe360c30004c71b3366 /src
parent51bab6ee87839b792533d6587602266f2faacf10 (diff)
minor fix for garbage in context menu in group chats
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/auth.cpp4
-rw-r--r--src/mir_app/src/authdialogs.cpp2
-rw-r--r--src/mir_app/src/srmm_base.cpp7
3 files changed, 8 insertions, 5 deletions
diff --git a/src/mir_app/src/auth.cpp b/src/mir_app/src/auth.cpp
index 119b86e061..ad06a211f5 100644
--- a/src/mir_app/src/auth.cpp
+++ b/src/mir_app/src/auth.cpp
@@ -32,13 +32,13 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
INT_PTR ShowReqWindow(WPARAM, LPARAM lParam)
{
- CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_AUTHREQ), NULL, DlgProcAuthReq, (LPARAM)((CLISTEVENT *)lParam)->hDbEvent);
+ CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_AUTHREQ), NULL, DlgProcAuthReq, ((CLISTEVENT *)lParam)->hDbEvent);
return 0;
}
INT_PTR ShowAddedWindow(WPARAM, LPARAM lParam)
{
- CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_ADDED), NULL, DlgProcAdded, (LPARAM)((CLISTEVENT *)lParam)->hDbEvent);
+ CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_ADDED), NULL, DlgProcAdded, ((CLISTEVENT *)lParam)->hDbEvent);
return 0;
}
diff --git a/src/mir_app/src/authdialogs.cpp b/src/mir_app/src/authdialogs.cpp
index 81ab47bfd3..4f9bcefe43 100644
--- a/src/mir_app/src/authdialogs.cpp
+++ b/src/mir_app/src/authdialogs.cpp
@@ -160,7 +160,7 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
hDbEvent = lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
- //blob is: uin(DWORD), hcontact(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ)
+ // blob is: uin(DWORD), hcontact(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ)
DBEVENTINFO dbei = {};
dbei.cbBlob = db_event_getBlobSize(hDbEvent);
dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp
index f74de86add..5555b430a5 100644
--- a/src/mir_app/src/srmm_base.cpp
+++ b/src/mir_app/src/srmm_base.cpp
@@ -148,6 +148,8 @@ static LRESULT CALLBACK Srmm_ButtonSubclassProc(HWND hwnd, UINT msg, WPARAM wPar
/////////////////////////////////////////////////////////////////////////////////////////
+static wchar_t szTrimString[] = L":;,.!?\'\"><()[]- \r\n";
+
EXTERN_C MIR_APP_DLL(LRESULT) CALLBACK stubLogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
CSrmmBaseDialog *pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
@@ -221,8 +223,6 @@ LRESULT CSrmmBaseDialog::WndProc_Log(UINT msg, WPARAM wParam, LPARAM lParam)
int end = m_log.SendMsg(EM_FINDWORDBREAK, WB_RIGHT, iCharIndex);
if (end - start > 0) {
- static wchar_t szTrimString[] = L":;,.!?\'\"><()[]- \r\n";
-
CHARRANGE cr;
cr.cpMin = start;
cr.cpMax = end;
@@ -232,6 +232,9 @@ LRESULT CSrmmBaseDialog::WndProc_Log(UINT msg, WPARAM wParam, LPARAM lParam)
tr.lpstrText = (wchar_t*)pszWord;
int iRes = m_log.SendMsg(EM_GETTEXTRANGE, 0, (LPARAM)&tr);
if (iRes > 0) {
+ wchar_t *p = wcschr(pszWord, '\r');
+ if (p) *p = 0;
+
size_t iLen = mir_wstrlen(pszWord) - 1;
while (wcschr(szTrimString, pszWord[iLen])) {
pszWord[iLen] = '\0';