From eccbb5307a048e70ac4adb0d3fd333be28245fa8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 28 Mar 2017 14:21:33 +0300 Subject: massive cleanup of useless cbSize fields --- plugins/SmileyAdd/src/dlgboxsubclass.cpp | 37 +++++++++++++++----------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'plugins/SmileyAdd/src/dlgboxsubclass.cpp') diff --git a/plugins/SmileyAdd/src/dlgboxsubclass.cpp b/plugins/SmileyAdd/src/dlgboxsubclass.cpp index 5fddca1ebe..9f8eab1afe 100644 --- a/plugins/SmileyAdd/src/dlgboxsubclass.cpp +++ b/plugins/SmileyAdd/src/dlgboxsubclass.cpp @@ -190,7 +190,7 @@ static int MsgDlgHook(WPARAM, LPARAM lParam) const MessageWindowEventData *wndEvtData = (MessageWindowEventData*)lParam; switch (wndEvtData->uType) { case MSG_WINDOW_EVT_OPENING: - if (wndEvtData->cbSize >= sizeof(MessageWindowEventData)) { + { MsgWndData *msgwnd = new MsgWndData(); msgwnd->hwnd = wndEvtData->hwndWindow; msgwnd->hContact = wndEvtData->hContact; @@ -204,34 +204,31 @@ static int MsgDlgHook(WPARAM, LPARAM lParam) mir_subclassWindow(msgwnd->hwnd, MessageDlgSubclass); msgwnd->CreateSmileyButton(); - { - mir_cslock lck(csWndList); - g_MsgWndList.insert(msgwnd); - } - SetRichOwnerCallback(wndEvtData->hwndWindow, wndEvtData->hwndInput, wndEvtData->hwndLog); - - if (wndEvtData->hwndLog) - SetRichCallback(wndEvtData->hwndLog, wndEvtData->hContact, false, false); - if (wndEvtData->hwndInput) - SetRichCallback(wndEvtData->hwndInput, wndEvtData->hContact, false, false); + mir_cslock lck(csWndList); + g_MsgWndList.insert(msgwnd); } + + SetRichOwnerCallback(wndEvtData->hwndWindow, wndEvtData->hwndInput, wndEvtData->hwndLog); + + if (wndEvtData->hwndLog) + SetRichCallback(wndEvtData->hwndLog, wndEvtData->hContact, false, false); + if (wndEvtData->hwndInput) + SetRichCallback(wndEvtData->hwndInput, wndEvtData->hContact, false, false); break; case MSG_WINDOW_EVT_OPEN: - if (wndEvtData->cbSize >= sizeof(MessageWindowEventData)) { - SetRichOwnerCallback(wndEvtData->hwndWindow, wndEvtData->hwndInput, wndEvtData->hwndLog); - if (wndEvtData->hwndLog) - SetRichCallback(wndEvtData->hwndLog, wndEvtData->hContact, true, true); - if (wndEvtData->hwndInput) { - SetRichCallback(wndEvtData->hwndInput, wndEvtData->hContact, true, true); - SendMessage(wndEvtData->hwndInput, WM_REMAKERICH, 0, 0); - } + SetRichOwnerCallback(wndEvtData->hwndWindow, wndEvtData->hwndInput, wndEvtData->hwndLog); + if (wndEvtData->hwndLog) + SetRichCallback(wndEvtData->hwndLog, wndEvtData->hContact, true, true); + if (wndEvtData->hwndInput) { + SetRichCallback(wndEvtData->hwndInput, wndEvtData->hContact, true, true); + SendMessage(wndEvtData->hwndInput, WM_REMAKERICH, 0, 0); } break; case MSG_WINDOW_EVT_CLOSE: - if (wndEvtData->cbSize >= sizeof(MessageWindowEventData) && wndEvtData->hwndLog) { + if (wndEvtData->hwndLog) { CloseRichCallback(wndEvtData->hwndLog); CloseRichOwnerCallback(wndEvtData->hwndWindow); } -- cgit v1.2.3