From af693f3f152e5a0f7e98e8f800e3573bd4b33901 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 20 Dec 2013 23:09:18 +0000 Subject: another ansi url removed git-svn-id: http://svn.miranda-ng.org/main/trunk@7310 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/controls.cpp | 2 +- plugins/TabSRMM/src/controls.h | 2 +- plugins/TabSRMM/src/sidebar.cpp | 4 +-- plugins/TabSRMM/src/tabctrl.cpp | 4 +-- plugins/TabSRMM/src/utils.cpp | 64 ++++++++++++++++++---------------------- 5 files changed, 34 insertions(+), 42 deletions(-) diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index 9bc16310f8..3801fa25f7 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -187,7 +187,7 @@ LONG_PTR CMenuBar::processMsg(const UINT msg, const WPARAM wParam, const LPARAM return ::SendMessage(m_pContainer->hwnd, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y)); } } - return(-1); + return -1; } /** diff --git a/plugins/TabSRMM/src/controls.h b/plugins/TabSRMM/src/controls.h index 0c566ffdfb..f549ff8e7b 100644 --- a/plugins/TabSRMM/src/controls.h +++ b/plugins/TabSRMM/src/controls.h @@ -88,7 +88,7 @@ public: if (m_TbButtons[i].idCommand == id ) return(i); } - return(-1); + return -1; } public: static HHOOK m_hHook; diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp index 60ced8c387..c8e154078e 100644 --- a/plugins/TabSRMM/src/sidebar.cpp +++ b/plugins/TabSRMM/src/sidebar.cpp @@ -310,7 +310,7 @@ void CSideBarButton::renderIconAndNick(const HDC hdc, const RECT *rcItem) const int CSideBarButton::testCloseButton() const { if (m_id == IDC_SIDEBARUP || m_id == IDC_SIDEBARDOWN) // scroller buttons don't have a close button - return(-1); + return -1; if (m_sideBar->getContainer()->dwFlagsEx & TCF_CLOSEBUTTON && !(getLayout()->dwFlags & CSideBar::SIDEBARLAYOUT_NOCLOSEBUTTONS)) { POINT pt; @@ -332,7 +332,7 @@ int CSideBarButton::testCloseButton() const return 1; } } - return(-1); + return -1; } /** * call back from the button window procedure. Activate my session diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp index d1154b760d..945b7c0c98 100644 --- a/plugins/TabSRMM/src/tabctrl.cpp +++ b/plugins/TabSRMM/src/tabctrl.cpp @@ -47,7 +47,7 @@ static int TabCtrl_TestForCloseButton(const TabControlData *tabdat, HWND hwnd, P RECT rcTab; if (tci.flags & TCHT_NOWHERE) - return(-1); + return -1; TabCtrl_GetItemRect(hwnd, iTab, &rcTab); if (tabdat->dwStyle & TCS_BUTTONS) { @@ -63,7 +63,7 @@ static int TabCtrl_TestForCloseButton(const TabControlData *tabdat, HWND hwnd, P if (PtInRect(&rcTab, tci.pt)) return(iTab); } - return(-1); + return -1; } /* diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index ba7c6d6391..6e8176d2cc 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -874,15 +874,15 @@ HICON Utils::iconFromAvatar(const TWindowData *dat) ::ImageList_Destroy(hIml_c); } } - return(hIcon); + return hIcon; } AVATARCACHEENTRY* Utils::loadAvatarFromAVS(const HANDLE hContact) { - if (ServiceExists(MS_AV_GETAVATARBITMAP)) - return(reinterpret_cast(CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0))); - else + if (!ServiceExists(MS_AV_GETAVATARBITMAP)) return 0; + + return (AVATARCACHEENTRY*)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0); } void Utils::getIconSize(HICON hIcon, int& sizeX, int& sizeY) @@ -1053,20 +1053,21 @@ const wchar_t* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRi */ LRESULT Utils::CmdDispatcher(UINT uType, HWND hwndDlg, UINT cmd, WPARAM wParam, LPARAM lParam, TWindowData *dat, TContainerData *pContainer) { - switch(uType) { - case CMD_CONTAINER: - if (pContainer && hwndDlg) - return(DM_ContainerCmdHandler(pContainer, cmd, wParam, lParam)); - break; - case CMD_MSGDIALOG: - if (pContainer && hwndDlg && dat) - return(DM_MsgWindowCmdHandler(hwndDlg, pContainer, dat, cmd, wParam, lParam)); - break; - case CMD_INFOPANEL: - if (MsgWindowMenuHandler(dat, cmd, MENU_LOGMENU) == 0) { - return(DM_MsgWindowCmdHandler(hwndDlg, pContainer, dat, cmd, wParam, lParam)); - } - break; + switch (uType) { + case CMD_CONTAINER: + if (pContainer && hwndDlg) + return(DM_ContainerCmdHandler(pContainer, cmd, wParam, lParam)); + break; + + case CMD_MSGDIALOG: + if (pContainer && hwndDlg && dat) + return(DM_MsgWindowCmdHandler(hwndDlg, pContainer, dat, cmd, wParam, lParam)); + break; + + case CMD_INFOPANEL: + if (MsgWindowMenuHandler(dat, cmd, MENU_LOGMENU) == 0) + return(DM_MsgWindowCmdHandler(hwndDlg, pContainer, dat, cmd, wParam, lParam)); + break; } return 0; } @@ -1080,9 +1081,8 @@ LRESULT Utils::CmdDispatcher(UINT uType, HWND hwndDlg, UINT cmd, WPARAM wParam, void Utils::sanitizeFilename(wchar_t* tszFilename) { static wchar_t *forbiddenCharacters = L"%/\\':|\"<>?"; - int i; - for (i=0; i < lstrlenW(forbiddenCharacters); i++) { + for (int i=0; i < lstrlenW(forbiddenCharacters); i++) { wchar_t* szFound = 0; while ((szFound = wcschr(tszFilename, (int)forbiddenCharacters[i])) != NULL) @@ -1108,9 +1108,7 @@ void Utils::ensureTralingBackslash(wchar_t *szPathname) */ HMODULE Utils::loadSystemLibrary(const wchar_t* szFilename) { - wchar_t sysPathName[MAX_PATH + 2]; - HMODULE _h = 0; - + wchar_t sysPathName[MAX_PATH + 2]; if (0 == ::GetSystemDirectoryW(sysPathName, MAX_PATH)) return 0; @@ -1119,7 +1117,7 @@ HMODULE Utils::loadSystemLibrary(const wchar_t* szFilename) return 0; lstrcatW(sysPathName, szFilename); - _h = LoadLibraryW(sysPathName); + HMODULE _h = LoadLibraryW(sysPathName); if (0 == _h) return 0; @@ -1230,7 +1228,7 @@ LRESULT CWarning::show(const int uId, DWORD dwFlags, const wchar_t* tszTxt) * block the shutdown) */ if (CMimAPI::m_shutDown) - return(-1); + return -1; if (tszTxt) _s = const_cast(tszTxt); @@ -1254,20 +1252,17 @@ LRESULT CWarning::show(const int uId, DWORD dwFlags, const wchar_t* tszTxt) _s = (dwFlags & CWF_UNTRANSLATED ? const_cast(tszTxt) : TranslateW(tszTxt)); } else - return(-1); + return -1; } if ((wcslen(_s) > 3) && ((separator_pos = wcschr(_s, '|')) != 0)) { - if (uId >= 0) { mask = getMask(); val = ((__int64)1L) << uId; } - else - mask = val = 0; + else mask = val = 0; if (0 == (mask & val) || dwFlags & CWF_NOALLOWHIDE) { - wchar_t *s = reinterpret_cast(mir_alloc((wcslen(_s) + 1) * 2)); wcscpy(s, _s); separator_pos = wcschr(s, '|'); @@ -1290,7 +1285,7 @@ LRESULT CWarning::show(const int uId, DWORD dwFlags, const wchar_t* tszTxt) mir_free(s); } } - return(-1); + return -1; } /** @@ -1465,12 +1460,9 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP case WM_LBUTTONUP: ENLINK *e = reinterpret_cast(lParam); - const wchar_t* wszUrl = Utils::extractURLFromRichEdit(e, ::GetDlgItem(hwnd, IDC_WARNTEXT)); + const wchar_t *wszUrl = Utils::extractURLFromRichEdit(e, ::GetDlgItem(hwnd, IDC_WARNTEXT)); if (wszUrl) { - char* szUrl = mir_t2a(wszUrl); - - CallService(MS_UTILS_OPENURL, 1, (LPARAM)szUrl); - mir_free(szUrl); + CallService(MS_UTILS_OPENURL, OUF_UNICODE, (LPARAM)wszUrl); mir_free(const_cast(wszUrl)); } } -- cgit v1.2.3