From 77ece3939612fb0133d20815883e4ed50a10230e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 23 Jan 2014 20:05:16 +0000 Subject: fixes bug #188 completely git-svn-id: http://svn.miranda-ng.org/main/trunk@7842 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp | 98 ++++++++--------- plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp | 2 +- plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp | 8 +- plugins/Clist_modern/src/hdr/modern_clui.h | 2 +- .../Clist_modern/src/hdr/modern_skinned_profile.h | 4 +- plugins/Clist_modern/src/modern_aniavatars.cpp | 40 +++---- plugins/Clist_modern/src/modern_awaymsg.cpp | 4 +- plugins/Clist_modern/src/modern_cachefuncs.cpp | 56 +++++----- plugins/Clist_modern/src/modern_clc.cpp | 116 ++++++++++----------- plugins/Clist_modern/src/modern_clcidents.cpp | 8 +- plugins/Clist_modern/src/modern_clcitems.cpp | 34 +++--- plugins/Clist_modern/src/modern_clcmsgs.cpp | 8 +- plugins/Clist_modern/src/modern_clcpaint.cpp | 98 ++++++++--------- plugins/Clist_modern/src/modern_clcutils.cpp | 26 ++--- plugins/Clist_modern/src/modern_clistevents.cpp | 8 +- plugins/Clist_modern/src/modern_clistmenus.cpp | 6 +- plugins/Clist_modern/src/modern_clistmod.cpp | 12 +-- plugins/Clist_modern/src/modern_clistopts.cpp | 38 +++---- plugins/Clist_modern/src/modern_clistsettings.cpp | 50 ++++----- plugins/Clist_modern/src/modern_clisttray.cpp | 10 +- plugins/Clist_modern/src/modern_clui.cpp | 112 ++++++++++---------- plugins/Clist_modern/src/modern_contact.cpp | 4 +- plugins/Clist_modern/src/modern_docking.cpp | 4 +- plugins/Clist_modern/src/modern_gdiplus.cpp | 4 +- plugins/Clist_modern/src/modern_gettextasync.cpp | 8 +- plugins/Clist_modern/src/modern_image_array.cpp | 10 +- plugins/Clist_modern/src/modern_newrowopts.cpp | 8 +- plugins/Clist_modern/src/modern_popup.cpp | 2 +- plugins/Clist_modern/src/modern_row.cpp | 90 ++++++++-------- .../Clist_modern/src/modern_rowheight_funcs.cpp | 22 ++-- plugins/Clist_modern/src/modern_rowtemplateopt.cpp | 16 +-- plugins/Clist_modern/src/modern_skinbutton.cpp | 52 ++++----- plugins/Clist_modern/src/modern_skineditor.cpp | 20 ++-- plugins/Clist_modern/src/modern_skinengine.cpp | 86 +++++++-------- plugins/Clist_modern/src/modern_skinopt.cpp | 18 ++-- plugins/Clist_modern/src/modern_skinselector.cpp | 36 +++---- plugins/Clist_modern/src/modern_statusbar.cpp | 18 ++-- .../Clist_modern/src/modern_statusbar_options.cpp | 6 +- plugins/Clist_modern/src/modern_tbbutton.cpp | 37 ++++--- plugins/Clist_modern/src/modern_toolbar.cpp | 8 +- plugins/Clist_modern/src/modern_utils.cpp | 10 +- plugins/Clist_modern/src/modern_viewmodebar.cpp | 22 ++-- plugins/Clist_modern/src/modern_xptheme.cpp | 4 +- 43 files changed, 615 insertions(+), 610 deletions(-) (limited to 'plugins') diff --git a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp index 1fd4275f57..935dca24d4 100644 --- a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp @@ -113,7 +113,7 @@ int CLUIFrames_OnMoving( HWND hwnd, RECT *r) g_CluiData.mutexPreventDockMoving = 0; for (i=0; i < g_nFramesCount; i++) { - if ( !g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != NULL && g_pfwFrames[i].OwnerWindow != (HWND)-2) + if (!g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != NULL && g_pfwFrames[i].OwnerWindow != (HWND)-2) { int x; int y; @@ -143,12 +143,12 @@ int SetAlpha(BYTE Alpha) for (i=0; i < g_nFramesCount; i++) { - if ( !g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != NULL && g_pfwFrames[i].OwnerWindow != (HWND)-2 && g_pfwFrames[i].visible && !g_pfwFrames[i].needhide ) + if (!g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != NULL && g_pfwFrames[i].OwnerWindow != (HWND)-2 && g_pfwFrames[i].visible && !g_pfwFrames[i].needhide ) { HWND hwnd = g_pfwFrames[i].OwnerWindow; long l; l = GetWindowLongPtr(hwnd,GWL_EXSTYLE); - if ( !(l&WS_EX_LAYERED)) + if (!(l&WS_EX_LAYERED)) { HWND parent = NULL; if (g_CluiData.fOnDesktop) @@ -176,7 +176,7 @@ int CLUIFrames_RepaintSubContainers() { int i; for (i=0; i < g_nFramesCount; i++) - if ( !g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != (HWND)0 && g_pfwFrames[i].OwnerWindow != (HWND)-2 && g_pfwFrames[i].visible && !g_pfwFrames[i].needhide ) + if (!g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != (HWND)0 && g_pfwFrames[i].OwnerWindow != (HWND)-2 && g_pfwFrames[i].visible && !g_pfwFrames[i].needhide ) { RedrawWindow(g_pfwFrames[i].hWnd,NULL,NULL,RDW_ALLCHILDREN|RDW_UPDATENOW|RDW_INVALIDATE|RDW_FRAME); }; @@ -206,7 +206,7 @@ int CLUIFrames_SetParentForContainers( HWND parent ) else g_CluiData.fOnDesktop = 0; for (i=0; i < g_nFramesCount; i++) { - if ( !g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != (HWND)0 && g_pfwFrames[i].OwnerWindow != (HWND)-2 && g_pfwFrames[i].visible && !g_pfwFrames[i].needhide ) + if (!g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != (HWND)0 && g_pfwFrames[i].OwnerWindow != (HWND)-2 && g_pfwFrames[i].visible && !g_pfwFrames[i].needhide ) { HWND hwnd = g_pfwFrames[i].OwnerWindow; SetParent(hwnd,parent); @@ -220,7 +220,7 @@ int CLUIFrames_OnShowHide( HWND hwnd, int mode ) int i; int prevFrameCount; for (i=0; i < g_nFramesCount; i++) { - if ( !g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != (HWND)0 && g_pfwFrames[i].OwnerWindow != (HWND)-2) + if (!g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != (HWND)0 && g_pfwFrames[i].OwnerWindow != (HWND)-2) { { //Try to avoid crash on exit due to unlock. @@ -293,7 +293,7 @@ int QueueAllFramesUpdating(BYTE queue) int i; for (i=0; i < g_nFramesCount; i++) { - if ( !g_CluiData.fLayered) + if (!g_CluiData.fLayered) { if (queue) InvalidateRect(g_pfwFrames[i].hWnd,NULL,FALSE); @@ -499,9 +499,9 @@ static void PositionThumb( FRAMEWND *pThumb, short nX, short nY ) pt.y = rcThumb.top; bDocked = FALSE; - if ( !bLeading && PtInRect( &rcLeft, pt )) + if (!bLeading && PtInRect( &rcLeft, pt )) { - if ( !bDockedLeft ) + if (!bDockedLeft ) { nNewX = rc.left - nWidth; bDocked = TRUE; @@ -523,7 +523,7 @@ static void PositionThumb( FRAMEWND *pThumb, short nX, short nY ) } } - if ( !bLeading && PtInRect( &rcTop, pt )) + if (!bLeading && PtInRect( &rcTop, pt )) { nNewY = rc.top; bDockedRight = bDocked; @@ -566,12 +566,12 @@ static void PositionThumb( FRAMEWND *pThumb, short nX, short nY ) pt.x = rcThumb.right; pt.y = rcThumb.bottom; - if ( !bLeading && PtInRect( &rcLeft, pt )) + if (!bLeading && PtInRect( &rcLeft, pt )) { nNewX = rc.left - nWidth; } - if ( !bLeading && PtInRect( &rcTop, pt )) + if (!bLeading && PtInRect( &rcTop, pt )) { nNewY = rc.top - nHeight; @@ -1108,15 +1108,15 @@ static INT_PTR _us_DoGetFrameOptions(WPARAM wParam,LPARAM lParam) case FO_FLAGS: retval = 0; if (g_pfwFrames[pos].visible) retval |= F_VISIBLE; - if ( !g_pfwFrames[pos].collapsed) retval |= F_UNCOLLAPSED; + if (!g_pfwFrames[pos].collapsed) retval |= F_UNCOLLAPSED; if (g_pfwFrames[pos].Locked) retval |= F_LOCKED; if (g_pfwFrames[pos].TitleBar.ShowTitleBar) retval |= F_SHOWTB; if (g_pfwFrames[pos].TitleBar.ShowTitleBarTip) retval |= F_SHOWTBTIP; - if ( !g_CluiData.fLayered) { - if ( !(GetWindowLongPtr(g_pfwFrames[pos].hWnd,GWL_STYLE)&WS_BORDER)) + if (!g_CluiData.fLayered) { + if (!(GetWindowLongPtr(g_pfwFrames[pos].hWnd,GWL_STYLE)&WS_BORDER)) retval |= F_NOBORDER; } - else if ( !g_pfwFrames[pos].UseBorder) + else if (!g_pfwFrames[pos].UseBorder) retval |= F_NOBORDER; break; @@ -1221,7 +1221,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam) { int style = (int)GetWindowLongPtr(fw.hWnd,GWL_STYLE); style &= (~WS_BORDER); - if ( !(lParam & F_NOBORDER ) && !g_CluiData.fLayered ) + if (!(lParam & F_NOBORDER ) && !g_CluiData.fLayered ) style |= WS_BORDER; SetWindowLongPtr(fw.hWnd,GWL_STYLE,(long)style); @@ -1303,7 +1303,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam) int oldHeight = fw.height; retval = fw.height; fw.height = lParam; - if ( !CLUIFramesFitInSize()) fw.height = retval; + if (!CLUIFramesFitInSize()) fw.height = retval; retval = fw.height; if (fw.height != oldHeight && !fw.floating) CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0); @@ -1312,7 +1312,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam) { retval = fw.HeightWhenCollapsed; fw.HeightWhenCollapsed = lParam; - if ( !CLUIFramesFitInSize()) fw.HeightWhenCollapsed = retval; + if (!CLUIFramesFitInSize()) fw.HeightWhenCollapsed = retval; retval = fw.HeightWhenCollapsed; } @@ -1331,7 +1331,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam) } case FO_ALIGN: - if ( !(lParam&alTop || lParam&alBottom || lParam&alClient)) + if (!(lParam&alTop || lParam&alBottom || lParam&alClient)) { TRACE("Wrong align option \r\n"); return (-1); @@ -1411,7 +1411,7 @@ static int _us_DoShowHideFrame(WPARAM wParam,LPARAM lParam) if (g_pfwFrames[pos].floating) CLUIFrameResizeFloatingFrame(pos); - if ( !g_pfwFrames[pos].floating) + if (!g_pfwFrames[pos].floating) CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); } return 0; @@ -1591,7 +1591,7 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam) { RECT rc; if (CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) {return 0;}; - if ( !g_CluiData.fDocked && g_CluiData.fAutoSize) {return 0;}; + if (!g_CluiData.fDocked && g_CluiData.fAutoSize) {return 0;}; GetWindowRect(pcli->hwndContactList,&rc); if (g_pfwFrames[FrameId].collapsed == TRUE) { @@ -1631,10 +1631,10 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam) g_pfwFrames[FrameId].collapsed = TRUE; } - if ( !g_pfwFrames[FrameId].floating) + if (!g_pfwFrames[FrameId].floating) { - if ( !CLUIFramesFitInSize()) { + if (!CLUIFramesFitInSize()) { //cant collapse,we can resize only for height < alclient frame height int alfrm = CLUIFramesGetalClientFrame(); @@ -1664,7 +1664,7 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam) if (g_pfwFrames[FrameId].collapsed == FALSE) { - if ( !g_pfwFrames[FrameId].floating) + if (!g_pfwFrames[FrameId].floating) { } else @@ -1679,7 +1679,7 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam) };//floating test //CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0); - if ( !g_pfwFrames[FrameId].floating) + if (!g_pfwFrames[FrameId].floating) { CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0); } @@ -1785,7 +1785,7 @@ static int _us_DoAddFrame(WPARAM wParam,LPARAM lParam) if (pcli->hwndContactList == 0) return -1; if (_fCluiFramesModuleNotStarted) return -1; if (clfrm->cbSize != sizeof(CLISTFrame)) return -1; - if ( !(_hTitleBarFont)) _hTitleBarFont = CLUILoadTitleBarFont(); + if (!(_hTitleBarFont)) _hTitleBarFont = CLUILoadTitleBarFont(); g_pfwFrames = (FRAMEWND*)realloc(g_pfwFrames,sizeof(FRAMEWND)*(g_nFramesCount+1)); @@ -2102,7 +2102,7 @@ static BOOL CLUIFramesFitInSize(void) sumheight += (g_pfwFrames[i].height)+(g_nTitleBarHeight*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar))+2/*+btoint(Frames[i].UseBorder)*2*/; if (sumheight>_nContactListHeight-tbh-2) { - if ( !g_CluiData.fDocked && g_CluiData.fAutoSize) + if (!g_CluiData.fDocked && g_CluiData.fAutoSize) { return TRUE; //Can be required to enlarge } @@ -2211,7 +2211,7 @@ static int CLUIFramesResizeFrames(const RECT newsize) for (i=0; i < g_nFramesCount; i++) { - if ( !g_pfwFrames[i].floating) + if (!g_pfwFrames[i].floating) { g_pfwFrames[i].needhide = FALSE; g_pfwFrames[i].wndSize.left = newsize.left; @@ -2435,7 +2435,7 @@ int SizeFramesByWindowRect(RECT *r, HDWP * PosBatch, int mode) int dy; dx = 0;//rcNewWindowRect.left-rcOldWindowRect.left; dy = 0;//_window_rect.top-rcOldWindowRect.top; - if ( !g_pfwFrames[i].floating) + if (!g_pfwFrames[i].floating) { if (g_pfwFrames[i].visible && !g_pfwFrames[i].needhide && !IsWindowVisible(g_pfwFrames[i].hWnd)) { @@ -2444,7 +2444,7 @@ int SizeFramesByWindowRect(RECT *r, HDWP * PosBatch, int mode) } if (g_pfwFrames[i].OwnerWindow && (INT_PTR)(g_pfwFrames[i].OwnerWindow) != -2 ) { - if ( !(mode&2)) + if (!(mode&2)) { HWND hwnd; hwnd = GetParent(g_pfwFrames[i].OwnerWindow); @@ -2512,9 +2512,9 @@ int CheckFramesPos(RECT *wr) int dy; dx = 0;//rcNewWindowRect.left-rcOldWindowRect.left; dy = 0;//_window_rect.top-rcOldWindowRect.top; - if ( !g_pfwFrames[i].floating && g_pfwFrames[i].visible) + if (!g_pfwFrames[i].floating && g_pfwFrames[i].visible) { - if ( !(g_pfwFrames[i].OwnerWindow && (INT_PTR)(g_pfwFrames[i].OwnerWindow) != -2)) + if (!(g_pfwFrames[i].OwnerWindow && (INT_PTR)(g_pfwFrames[i].OwnerWindow) != -2)) { RECT r; GetWindowRect(g_pfwFrames[i].hWnd,&r); @@ -2654,7 +2654,7 @@ int OnFrameTitleBarBackgroundChange(WPARAM wParam,LPARAM lParam) if (g_CluiData.fDisableSkinEngine) { if ( db_get_b(NULL,"FrameTitleBar","UseBitmap",CLCDEFAULT_USEBITMAP)) { - if ( !db_get_s(NULL,"FrameTitleBar","BkBitmap",&dbv)) { + if (!db_get_s(NULL,"FrameTitleBar","BkBitmap",&dbv)) { hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal); db_free(&dbv); } @@ -2791,7 +2791,7 @@ void DrawBackGround(HWND hwnd,HDC mhdc, HBITMAP hBmpBackground, COLORREF bkColou DeleteDC(hdcMem); paintst.fErase = FALSE; //DeleteObject(hFont); - if ( !mhdc) + if (!mhdc) { EndPaint(hwnd,&paintst); } @@ -2844,7 +2844,7 @@ int DrawTitleBar(HDC hdcMem2,RECT *rect,int Frameid) { if (g_CluiData.fDisableSkinEngine) { - if ( !hBmpBackground && bkUseWinColours && xpt_IsThemed(_hFrameTitleTheme)) + if (!hBmpBackground && bkUseWinColours && xpt_IsThemed(_hFrameTitleTheme)) { int state = CS_ACTIVE; // if (GetForegroundWindow() != pcli->hwndContactList) state = CS_INACTIVE; @@ -2854,7 +2854,7 @@ int DrawTitleBar(HDC hdcMem2,RECT *rect,int Frameid) else DrawBackGround(g_pfwFrames[pos].TitleBar.hwnd,hdcMem, hBmpBackground, bkColour, backgroundBmpUse); } - else if ( !g_CluiData.fLayered) + else if (!g_CluiData.fLayered) { ske_BltBackImage(g_pfwFrames[pos].TitleBar.hwnd,hdcMem,&rc); } @@ -2867,7 +2867,7 @@ int DrawTitleBar(HDC hdcMem2,RECT *rect,int Frameid) SetTextColor(hdcMem,SelBkColour); { RECT textrc = rc; - if ( !AlignCOLLIconToLeft) + if (!AlignCOLLIconToLeft) { if (g_pfwFrames[pos].TitleBar.hicon != NULL) @@ -2891,7 +2891,7 @@ int DrawTitleBar(HDC hdcMem2,RECT *rect,int Frameid) ske_TextOut(hdcMem,textrc.left,textrc.top,g_pfwFrames[pos].TitleBar.tbname,lstrlen(g_pfwFrames[pos].TitleBar.tbname)); } - if ( !AlignCOLLIconToLeft) + if (!AlignCOLLIconToLeft) { mod_DrawIconEx_helper(hdcMem,g_pfwFrames[pos].TitleBar.wndSize.right-GetSystemMetrics(SM_CXSMICON)-2,rc.top+((g_nTitleBarHeight>>1)-(GetSystemMetrics(SM_CXSMICON)>>1)),g_pfwFrames[pos].collapsed?LoadSkinnedIcon(SKINICON_OTHER_GROUPOPEN):LoadSkinnedIcon(SKINICON_OTHER_GROUPSHUT),GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON), 0, NULL,DI_NORMAL); } @@ -2938,7 +2938,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam switch(msg) { case WM_CREATE: - if ( !_hFrameTitleTheme) + if (!_hFrameTitleTheme) _hFrameTitleTheme = xpt_AddThemeHandle(hwnd,L"WINDOW"); SendMessage(hwnd,WM_SETFONT,(WPARAM)_hTitleBarFont,0); return FALSE; @@ -3109,7 +3109,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam ); oldflags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,g_pfwFrames[pos].id),0); - if ( !(oldflags&F_SHOWTBTIP)) + if (!(oldflags&F_SHOWTBTIP)) { oldflags |= F_SHOWTBTIP; //CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,Frames[pos].id),(LPARAM)oldflags); @@ -3180,7 +3180,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam //IntersectRect( &rcOverlap, &rcwnd, &rcMiranda ) - if ( !IntersectRect( &rcOverlap, &rcwnd, &rcMiranda )) + if (!IntersectRect( &rcOverlap, &rcwnd, &rcMiranda )) { GetCursorPos(&curpt); GetWindowRect( g_pfwFrames[pos].hWnd, &rcwnd ); @@ -3246,7 +3246,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam nLeft += (short)dX; nTop += (short)dY; - if ( !(wParam&MK_CONTROL)) + if (!(wParam&MK_CONTROL)) PositionThumb( &g_pfwFrames[pos], nLeft, nTop ); else SetWindowPos( g_pfwFrames[pos].ContainerWnd, @@ -3301,7 +3301,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam if (newh>0) { prevold = g_pfwFrames[Framemod].height; g_pfwFrames[Framemod].height = newh; - if ( !CLUIFramesFitInSize()) { g_pfwFrames[Framemod].height = prevold; return TRUE;} + if (!CLUIFramesFitInSize()) { g_pfwFrames[Framemod].height = prevold; return TRUE;} g_pfwFrames[Framemod].height = newh; if (newh>3) g_pfwFrames[Framemod].collapsed = TRUE; @@ -3349,7 +3349,7 @@ static int CLUIFrameResizeFloatingFrame(int framepos) { RECT rect; - if ( !g_pfwFrames[framepos].floating){return 0;}; + if (!g_pfwFrames[framepos].floating){return 0;}; if (g_pfwFrames[framepos].ContainerWnd == 0){return 0;}; GetClientRect(g_pfwFrames[framepos].ContainerWnd,&rect); @@ -3489,7 +3489,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP framepos = id2pos(Frameid); if (framepos < 0 || framepos >= g_nFramesCount){break;}; - if ( !g_pfwFrames[framepos].minmaxenabled){break;}; + if (!g_pfwFrames[framepos].minmaxenabled){break;}; if (g_pfwFrames[framepos].ContainerWnd == 0){break;}; if (g_pfwFrames[framepos].Locked) @@ -3686,7 +3686,7 @@ static int _us_DoSetFrameFloat(WPARAM wParam,LPARAM lParam) SetParent(g_pfwFrames[pos].TitleBar.hwnd,pcli->hwndContactList); SetWindowLongPtr(g_pfwFrames[pos].OwnerWindow,GWLP_USERDATA,g_pfwFrames[pos].id); g_pfwFrames[pos].floating = FALSE; - if ( !(lParam&2)) + if (!(lParam&2)) { DestroyWindow(g_pfwFrames[pos].ContainerWnd); g_pfwFrames[pos].ContainerWnd = 0; @@ -3716,7 +3716,7 @@ static int _us_DoSetFrameFloat(WPARAM wParam,LPARAM lParam) GetWindowRect(g_pfwFrames[pos].hWnd,&rectw); GetWindowRect(g_pfwFrames[pos].TitleBar.hwnd,&recttb); - if ( !g_pfwFrames[pos].TitleBar.ShowTitleBar){ + if (!g_pfwFrames[pos].TitleBar.ShowTitleBar){ recttb.top = recttb.bottom = recttb.left = recttb.right = 0; }; @@ -3936,7 +3936,7 @@ int UnLoadCLUIFramesModule(void) static int _us_DoSetFramePaintProc(WPARAM wParam, LPARAM lParam) { - if ( !wParam) return 0; + if (!wParam) return 0; // LOOK REQUIRED OR SYNC CALL NEEDED FRAMEWND *frm = FindFrameByItsHWND((HWND)wParam); diff --git a/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp b/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp index 7d520cacb2..46b17483e0 100644 --- a/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp +++ b/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp @@ -28,7 +28,7 @@ static INT_PTR AddContextFrameMenuItem(WPARAM wParam, LPARAM lParam) CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam; TMO_MenuItem tmi; - if ( !pcli->pfnConvertMenu(mi, &tmi)) + if (!pcli->pfnConvertMenu(mi, &tmi)) return NULL; tmi.root = (mi->flags & CMIF_ROOTHANDLE) ? mi->hParentMenu : NULL; diff --git a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp index f6974a6eb1..5773392e1a 100644 --- a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp +++ b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp @@ -86,7 +86,7 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam,LPARAM lParam) { TMO_MenuItem tmi; CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam; - if ( !pcli->pfnConvertMenu(mi, &tmi)) + if (!pcli->pfnConvertMenu(mi, &tmi)) return NULL; lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)mir_calloc(sizeof(GroupMenuExecParam)); @@ -150,7 +150,7 @@ INT_PTR GroupMenuExecService(WPARAM wParam,LPARAM lParam) { if (wParam != 0) { lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)wParam; - if ( !mir_strcmp(mmep->szServiceName,"Help/AboutCommand")) { + if (!mir_strcmp(mmep->szServiceName,"Help/AboutCommand")) { //bug in help.c,it used wparam as parent window handle without reason. mmep->Param1 = 0; CallService(mmep->szServiceName,mmep->Param1,lParam); @@ -434,7 +434,7 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam,LPARAM lParam) { TMO_MenuItem tmi; CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam; - if ( !pcli->pfnConvertMenu(mi, &tmi)) + if (!pcli->pfnConvertMenu(mi, &tmi)) return NULL; lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)mir_calloc(sizeof(SubGroupMenuExecParam)); @@ -489,7 +489,7 @@ INT_PTR SubGroupMenuExecService(WPARAM wParam,LPARAM lParam) { if (wParam != 0) { lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)wParam; - if ( !mir_strcmp(mmep->szServiceName, "Help/AboutCommand")) { + if (!mir_strcmp(mmep->szServiceName, "Help/AboutCommand")) { //bug in help.c,it used wparam as parent window handle without reason. mmep->Param1 = 0; CallService(mmep->szServiceName,mmep->Param1,lParam); diff --git a/plugins/Clist_modern/src/hdr/modern_clui.h b/plugins/Clist_modern/src/hdr/modern_clui.h index 0844ce63ab..f67a575d6a 100644 --- a/plugins/Clist_modern/src/hdr/modern_clui.h +++ b/plugins/Clist_modern/src/hdr/modern_clui.h @@ -62,7 +62,7 @@ public: static LRESULT CALLBACK cli_ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { CLUI * This = m_pCLUI; - if ( !m_hWnd ) m_hWnd = hwnd; + if (!m_hWnd ) m_hWnd = hwnd; BOOL bHandled = FALSE; LRESULT lRes= This->PreProcessWndProc( msg, wParam, lParam, bHandled ); diff --git a/plugins/Clist_modern/src/hdr/modern_skinned_profile.h b/plugins/Clist_modern/src/hdr/modern_skinned_profile.h index 95ab85c606..78fdb1578d 100644 --- a/plugins/Clist_modern/src/hdr/modern_skinned_profile.h +++ b/plugins/Clist_modern/src/hdr/modern_skinned_profile.h @@ -32,7 +32,7 @@ public: #ifdef _UNICODE MString( const char * str) { - if ( !str ) + if (!str ) _buffer = NULL; else { @@ -83,7 +83,7 @@ public: } void Unlock() // Leave Section { - if ( !_ifLocked ) return; + if (!_ifLocked ) return; if ( _ifCSOwner ) LeaveCriticalSection( &_CS ); else _pLinkedCS->Unlock(); _ifLocked = false; diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp index 62d8422a90..08415dda17 100644 --- a/plugins/Clist_modern/src/modern_aniavatars.cpp +++ b/plugins/Clist_modern/src/modern_aniavatars.cpp @@ -35,7 +35,7 @@ BOOL GDIPlus_IsAnimatedGif (TCHAR * szName); /* Next is module */ #define ANIAVAWINDOWCLASS _T("MirandaModernAniAvatar") -#define aacheck if ( !s_bModuleStarted) return +#define aacheck if (!s_bModuleStarted) return #define AAO_HAS_BORDER 0x01 #define AAO_ROUND_CORNERS 0x02 @@ -205,7 +205,7 @@ static void _AniAva_AnimationTreadProc(void*) // Init AniAva module int AniAva_InitModule() { - if ( !(db_get_b(NULL, "CList", "AvatarsAnimated", ServiceExists(MS_AV_GETAVATARBITMAP)) && + if (!(db_get_b(NULL, "CList", "AvatarsAnimated", ServiceExists(MS_AV_GETAVATARBITMAP)) && db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT))) return 0; @@ -264,7 +264,7 @@ int AniAva_UpdateOptions() AniAva_InitModule(); bReloadAvatars = TRUE; } - else if ( !bBeEnabled && s_bModuleStarted) { + else if (!bBeEnabled && s_bModuleStarted) { AniAva_UnloadModule(); bReloadAvatars = TRUE; } @@ -287,7 +287,7 @@ int AniAva_UpdateOptions() int AniAva_AddAvatar(HANDLE hContact, TCHAR * szFilename, int width, int heigth) { aacheck 0; - if ( !GDIPlus_IsAnimatedGif (szFilename)) + if (!GDIPlus_IsAnimatedGif (szFilename)) return 0; mir_cslock lck(s_CS); @@ -375,7 +375,7 @@ int AniAva_SetAvatarPos(HANDLE hContact, RECT *rc, int overlayIdx, BYTE bAlpha) ANIAVA_OBJECT *pai = FindAvatarByContact( hContact ); if (pai) { ANIAVA_POSINFO * api = (ANIAVA_POSINFO *)malloc(sizeof(ANIAVA_POSINFO)); - if ( !pai->hWindow) { + if (!pai->hWindow) { HWND hwnd; HWND parent; ANIAVATARIMAGEINFO avii = {0}; @@ -721,7 +721,7 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /*= NULL hBmp = ske_CreateDIB32( szWnd.cx, szWnd.cy ); hOldBmp = (HBITMAP)SelectObject(tempDC,hBmp); if (s_bFlags & AAO_ROUND_CORNERS) - if ( !cornerRadius) //auto radius + if (!cornerRadius) //auto radius cornerRadius = min(szWnd.cx, szWnd.cy )/5; if (s_bFlags & AAO_HAS_BORDER) { @@ -755,7 +755,7 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /*= NULL ske_SetRgnOpaque( tempDC, hRgn, TRUE ); } // draw avatar - if ( !(s_bFlags & AAO_OPAQUE)) + if (!(s_bFlags & AAO_OPAQUE)) BitBlt(tempDC, 0, 0, szWnd.cx, szWnd.cy , s_hAniAvaDC , dat->ptFromPoint.x+dat->sizeAvatar.cx*dat->currentFrame, dat->ptFromPoint.y, SRCCOPY); else { BLENDFUNCTION abf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA }; @@ -802,12 +802,12 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /*= NULL ske_AlphaBlend( hdcParent, rcInParent->left, rcInParent->top, szWnd.cx, szWnd.cy, copyFromDC, pt_from.x, pt_from.y, szWnd.cx, szWnd.cy, abf); } } - else if ( !UpdateLayeredWindow(dat->hWindow, hDC_animation, &ptWnd, &szWnd, copyFromDC, &pt_from, RGB(0, 0, 0), &bf, ULW_ALPHA )) { + else if (!UpdateLayeredWindow(dat->hWindow, hDC_animation, &ptWnd, &szWnd, copyFromDC, &pt_from, RGB(0, 0, 0), &bf, ULW_ALPHA )) { LONG exStyle; exStyle = GetWindowLongPtr(dat->hWindow,GWL_EXSTYLE); exStyle |= WS_EX_LAYERED; SetWindowLongPtr(dat->hWindow,GWL_EXSTYLE,exStyle); - if ( !IMMEDIATE_DRAW ) + if (!IMMEDIATE_DRAW ) SetWindowPos( pcli->hwndContactTree, dat->hWindow, 0, 0, 0, 0, SWP_ASYNCWINDOWPOS | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOSENDCHANGING ); UpdateLayeredWindow(dat->hWindow, hDC_animation, &ptWnd, &szWnd, copyFromDC, &pt_from, RGB(0, 0, 0), &bf, ULW_ALPHA ); } @@ -824,7 +824,7 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /*= NULL DeleteDC(tempDC); } } - if ( !dat->bPlaying) { + if (!dat->bPlaying) { ShowWindow(dat->hWindow, SW_HIDE); KillTimer(dat->hWindow,2); //stop animation till set pos will be called } @@ -911,7 +911,7 @@ static int _AniAva_SortAvatarInfo(const ANIAVA_INFO *aai1, const ANIAVA_INFO *aa void _AniAva_InvalidateParent(ANIAVA_WINDOWINFO * dat) { - if ( !IMMEDIATE_DRAW ) return; + if (!IMMEDIATE_DRAW ) return; HWND hwndParent = pcli->hwndContactTree; RECT rcPos = dat->rcPos; pcli->pfnInvalidateRect( hwndParent, &rcPos, FALSE ); @@ -937,7 +937,7 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR dat->bPaused--; if (dat->bPaused) return 0; if (dat->bPended) - if ( !IMMEDIATE_DRAW ) + if (!IMMEDIATE_DRAW ) _AniAva_RenderAvatar(dat); dat->bPended = FALSE; return 0; @@ -966,20 +966,20 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR case AAM_SETPOSITION: { ANIAVA_POSINFO * papi = (ANIAVA_POSINFO *)lParam; - if ( !dat->delaysInterval) return 0; - if ( !papi) return 0; + if (!dat->delaysInterval) return 0; + if (!papi) return 0; dat->rcPos = papi->rcPos; dat->overlayIconIdx = papi->idxOverlay; dat->bAlpha = papi->bAlpha; free(papi); - if ( !dat->bPlaying) { + if (!dat->bPlaying) { dat->bPlaying = TRUE; ShowWindow(hwnd,SW_SHOWNA); dat->currentFrame = 0; KillTimer(hwnd,2); SetTimer(hwnd,2,dat->delaysInterval[0],NULL); } - if ( !IMMEDIATE_DRAW ) + if (!IMMEDIATE_DRAW ) _AniAva_RenderAvatar(dat); } return 0; @@ -993,7 +993,7 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR else { LONG exStyle = GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE); SetWindowPos(pcli->hwndContactList,hwnd, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE/*|SWP_ASYNCWINDOWPOS*/); - if ( !(exStyle & WS_EX_TOPMOST)) + if (!(exStyle & WS_EX_TOPMOST)) SetWindowPos(pcli->hwndContactList,HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE/*|SWP_ASYNCWINDOWPOS*/); } return 0; @@ -1008,7 +1008,7 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR else { LONG exStyle = GetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE); SetWindowPos(pcli->hwndContactList,hwnd, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE/*|SWP_ASYNCWINDOWPOS*/); - if ( !(exStyle&WS_EX_TOPMOST)) + if (!(exStyle&WS_EX_TOPMOST)) SetWindowPos(pcli->hwndContactList,HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE/*|SWP_ASYNCWINDOWPOS*/); } } @@ -1040,7 +1040,7 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR break; case WM_TIMER: - if ( !IsWindowVisible(hwnd)) { + if (!IsWindowVisible(hwnd)) { DestroyWindow(hwnd); return 0; } @@ -1048,7 +1048,7 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR if (dat->currentFrame >= dat->nFramesCount) dat->currentFrame = 0; - if ( !IMMEDIATE_DRAW) + if (!IMMEDIATE_DRAW) _AniAva_RenderAvatar(dat); else _AniAva_InvalidateParent(dat); diff --git a/plugins/Clist_modern/src/modern_awaymsg.cpp b/plugins/Clist_modern/src/modern_awaymsg.cpp index 934db73c7f..7953807781 100644 --- a/plugins/Clist_modern/src/modern_awaymsg.cpp +++ b/plugins/Clist_modern/src/modern_awaymsg.cpp @@ -100,7 +100,7 @@ static void amThreadProc(void *) HANDLE ACK = 0; if (dnce.ApparentMode != ID_STATUS_OFFLINE) //don't ask if contact is always invisible (should be done with protocol) ACK = (HANDLE)CallContactService(hContact,PSS_GETAWAYMSG, 0, 0); - if ( !ACK) { + if (!ACK) { ACKDATA ack; ack.hContact = hContact; ack.type = ACKTYPE_AWAYMSG; @@ -148,7 +148,7 @@ BOOL amWakeThread() */ void amRequestAwayMsg(HANDLE hContact) { - if ( !g_CluiData.bInternalAwayMsgDiscovery || !hContact) + if (!g_CluiData.bInternalAwayMsgDiscovery || !hContact) return; //Do not re-ask for chat rooms diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index 1333682716..f41b7c1db9 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -73,7 +73,7 @@ void Cache_GetTimezone(ClcData *dat, HANDLE hContact) void Cache_GetText(ClcData *dat, ClcContact *contact, BOOL forceRenew) { Cache_GetFirstLineText(dat, contact); - if ( !dat->force_in_dialog) { + if (!dat->force_in_dialog) { ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry(contact->hContact); if ((dat->second_line_show && (forceRenew || pdnce->szSecondLineText == NULL)) || (dat->third_line_show && (forceRenew || pdnce->szThirdLineText == NULL))) gtaAddRequest(dat,contact, contact->hContact); @@ -133,7 +133,7 @@ void CSmileyString::_CopySmileyList( SortedList *plInput ) { // ASSERT( plText == NULL ); - if ( !plInput || plInput->realCount == 0 ) return; + if (!plInput || plInput->realCount == 0 ) return; plText = List_Create( 0, 1 ); for ( int i=0; i < plInput->realCount; i++ ) { @@ -165,7 +165,7 @@ void CSmileyString::DestroySmileyList() if ( plText->items[i] != NULL ) { ClcContactTextPiece *piece = (ClcContactTextPiece *) plText->items[i]; - if ( !IsBadWritePtr(piece, sizeof(ClcContactTextPiece))) { + if (!IsBadWritePtr(piece, sizeof(ClcContactTextPiece))) { if (piece->type == TEXT_PIECE_TYPE_SMILEY && piece->smiley != g_hListeningToIcon) DestroyIcon_protect(piece->smiley); mir_free(piece); @@ -193,7 +193,7 @@ void CSmileyString::ReplaceSmileys(struct SHORTDATA *dat, ClcCacheEntry *pdnce, DestroySmileyList(); - if ( !dat->text_replace_smileys || !replace_smileys || szText == NULL) + if (!dat->text_replace_smileys || !replace_smileys || szText == NULL) return; int text_size = (int)_tcslen( szText ); @@ -295,9 +295,9 @@ int GetStatusName(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus if (nStatus == ID_STATUS_OFFLINE || nStatus == 0) noXstatus = TRUE; text[0] = '\0'; // Get XStatusName - if ( !noAwayMsg && !noXstatus && xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto) { + if (!noAwayMsg && !noXstatus && xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto) { DBVARIANT dbv = {0}; - if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) { + if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) { //lstrcpyn(text, dbv.pszVal, text_size); CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1); db_free(&dbv); @@ -315,9 +315,9 @@ int GetStatusName(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus } // Get XStatusName - if ( !noAwayMsg && !noXstatus && !xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto) { + if (!noAwayMsg && !noXstatus && !xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto) { DBVARIANT dbv = {0}; - if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) { + if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) { CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1); db_free(&dbv); @@ -342,7 +342,7 @@ void GetListeningTo(TCHAR *text, int text_size, ClcCacheEntry *pdnce) if (wStatus == ID_STATUS_OFFLINE || wStatus == 0) return; - if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "ListeningTo", &dbv)) { + if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "ListeningTo", &dbv)) { CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1); db_free(&dbv); } @@ -363,9 +363,9 @@ int GetStatusMessage(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xst if (wStatus == ID_STATUS_OFFLINE || wStatus == 0) noAwayMsg = TRUE; // Get XStatusMsg - if ( !noAwayMsg && xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto) { + if (!noAwayMsg && xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto) { // Try to get XStatusMsg - if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) { + if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) { //lstrcpyn(text, dbv.pszVal, text_size); CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1); db_free(&dbv); @@ -377,7 +377,7 @@ int GetStatusMessage(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xst // Get StatusMsg if (pdnce->hContact && text[0] == '\0') { - if ( !db_get_ts(pdnce->hContact, "CList", "StatusMsg", &dbv)) { + if (!db_get_ts(pdnce->hContact, "CList", "StatusMsg", &dbv)) { //lstrcpyn(text, dbv.pszVal, text_size); CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1); db_free(&dbv); @@ -388,9 +388,9 @@ int GetStatusMessage(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xst } // Get XStatusMsg - if ( !noAwayMsg && !xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto && text[0] == '\0') { + if (!noAwayMsg && !xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto && text[0] == '\0') { // Try to get XStatusMsg - if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) { + if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) { //lstrcpyn(text, dbv.pszVal, text_size); CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1); db_free(&dbv); @@ -419,7 +419,7 @@ int Cache_GetLineText( DBVARIANT dbv = {0}; // Try to get XStatusMsg - if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) { + if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) { if (dbv.ptszVal != NULL && dbv.ptszVal[0] != 0) { TCHAR *tmp = NEWTSTR_ALLOCA(text); mir_sntprintf(text, text_size, _T("%s: %s"), tmp, dbv.ptszVal); @@ -434,7 +434,7 @@ int Cache_GetLineText( case TEXT_NICKNAME: if (pdnce->hContact && pdnce->m_cache_cszProto) { DBVARIANT dbv = {0}; - if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) { + if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) { lstrcpyn(text, dbv.ptszVal, text_size); db_free(&dbv); CopySkipUnprintableChars(text, text, text_size-1); @@ -448,7 +448,7 @@ int Cache_GetLineText( DBVARIANT dbv = {0}; // Try to get XStatusName - if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) { + if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) { if (dbv.pszVal != NULL && dbv.pszVal[0] != 0) { TCHAR *tmp = NEWTSTR_ALLOCA(text); mir_sntprintf(text, text_size, _T("%s: %s"), dbv.pszVal, tmp); @@ -460,7 +460,7 @@ int Cache_GetLineText( else if (use_name_and_message_for_xstatus && xstatus_has_priority) { DBVARIANT dbv = {0}; // Try to get XStatusName - if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) { + if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) { if (dbv.pszVal != NULL && dbv.pszVal[0] != 0) mir_sntprintf(text, text_size, _T("%s"), dbv.pszVal); CopySkipUnprintableChars(text, text, text_size-1); @@ -520,7 +520,7 @@ void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact) TCHAR *name = pcli->pfnGetContactDisplayName(contact->hContact,0); if (dat->first_line_append_nick && (!dat->force_in_dialog)) { DBVARIANT dbv = {0}; - if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) { + if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) { TCHAR nick[SIZEOF(contact->szText)]; lstrcpyn(nick, dbv.ptszVal, SIZEOF(contact->szText)); db_free(&dbv); @@ -536,7 +536,7 @@ void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact) } else lstrcpyn(contact->szText, name, SIZEOF(contact->szText)); - if ( !dat->force_in_dialog) { + if (!dat->force_in_dialog) { struct SHORTDATA data = {0}; Sync(CLUI_SyncGetShortData,(WPARAM)pcli->hwndContactTree,(LPARAM)&data); contact->ssText.ReplaceSmileys(&data, pdnce, contact->szText, dat->first_line_draw_smileys); @@ -622,8 +622,8 @@ static int CopySkipUnprintableChars(TCHAR *to, TCHAR * buf, DWORD size) DWORD i; BOOL keep = 0; TCHAR * cp = to; - if ( !to) return 0; - if ( !buf) { + if (!to) return 0; + if (!buf) { to[0] = '\0'; return 0; } @@ -632,7 +632,7 @@ static int CopySkipUnprintableChars(TCHAR *to, TCHAR * buf, DWORD size) if (buf[i] == 0) break; if (buf[i] > 0 && buf[i] < ' ') { *cp = ' '; - if ( !keep) cp++; + if (!keep) cp++; keep = 1; } else { @@ -673,22 +673,22 @@ static BOOL ExecuteOnAllContacts(ClcData *dat, ExecuteOnAllContactsFuncPtr func, static BOOL ExecuteOnAllContactsOfGroup(ClcGroup *group, ExecuteOnAllContactsFuncPtr func, void *param) { - if ( !group) + if (!group) return TRUE; for (int scanIndex = 0 ; scanIndex < group->cl.count ; scanIndex++) { if (group->cl.items[scanIndex]->type == CLCIT_CONTACT) { - if ( !func(group->cl.items[scanIndex], FALSE, param)) + if (!func(group->cl.items[scanIndex], FALSE, param)) return FALSE; if (group->cl.items[scanIndex]->SubAllocated > 0) { for (int i=0 ; i < group->cl.items[scanIndex]->SubAllocated ; i++) - if ( !func(&group->cl.items[scanIndex]->subcontacts[i], TRUE, param)) + if (!func(&group->cl.items[scanIndex]->subcontacts[i], TRUE, param)) return FALSE; } } else if (group->cl.items[scanIndex]->type == CLCIT_GROUP) - if ( !ExecuteOnAllContactsOfGroup(group->cl.items[scanIndex]->group, func, param)) + if (!ExecuteOnAllContactsOfGroup(group->cl.items[scanIndex]->group, func, param)) return FALSE; } @@ -818,7 +818,7 @@ void Cache_GetAvatar(ClcData *dat, ClcContact *contact) contact->avatar_pos = AVATAR_POS_DONT_HAVE; if (dat->avatars_show && !db_get_b(contact->hContact, "CList", "HideContactAvatar", 0)) { DBVARIANT dbv; - if ( !db_get_ts(contact->hContact, "ContactPhoto", "File", &dbv)) { + if (!db_get_ts(contact->hContact, "ContactPhoto", "File", &dbv)) { HBITMAP hBmp = (HBITMAP) CallService(MS_UTILS_LOADBITMAPT, 0, (LPARAM)dbv.ptszVal); if (hBmp != NULL) { // Make bounds diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 7737335a23..7a364dd2bb 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -202,62 +202,62 @@ static int clcHookSettingChanged(WPARAM wParam,LPARAM lParam) if ((HANDLE)wParam == NULL) { if (g_szMetaModuleName && !mir_strcmp(cws->szModule, g_szMetaModuleName)) { - if ( !mir_strcmp(cws->szSetting, "Enabled")) + if (!mir_strcmp(cws->szSetting, "Enabled")) pcli->pfnClcBroadcast( INTM_RELOADOPTIONS, wParam, lParam); } - else if ( !mir_strcmp(cws->szModule, "CListGroups")) + else if (!mir_strcmp(cws->szModule, "CListGroups")) { pcli->pfnClcBroadcast( INTM_GROUPSCHANGED,wParam,lParam); } - else if ( !strcmp(cws->szSetting,"XStatusId") || !strcmp(cws->szSetting,"XStatusName")) + else if (!strcmp(cws->szSetting,"XStatusId") || !strcmp(cws->szSetting,"XStatusName")) { cliCluiProtocolStatusChanged(0, cws->szModule); } } else // (HANDLE)wParam != NULL { - if ( !strcmp(cws->szSetting,"TickTS")) + if (!strcmp(cws->szSetting,"TickTS")) { pcli->pfnClcBroadcast( INTM_STATUSCHANGED,wParam,0); } else if (g_szMetaModuleName && !strcmp(cws->szModule,g_szMetaModuleName)) { - if ( !strcmp(cws->szSetting,"Handle")) + if (!strcmp(cws->szSetting,"Handle")) { pcli->pfnClcBroadcast( INTM_NAMEORDERCHANGED, 0, 0); } - else if ( !strcmp(cws->szSetting,"Default")) + else if (!strcmp(cws->szSetting,"Default")) { pcli->pfnClcBroadcast( INTM_NAMEORDERCHANGED, 0, 0); } } - else if ( !strcmp(cws->szModule,"UserInfo")) + else if (!strcmp(cws->szModule,"UserInfo")) { - if ( !strcmp(cws->szSetting,"Timezone")) + if (!strcmp(cws->szSetting,"Timezone")) pcli->pfnClcBroadcast( INTM_TIMEZONECHANGED,wParam,0); } - else if ( !strcmp(cws->szModule,"CList")) + else if (!strcmp(cws->szModule,"CList")) { - if ( !strcmp(cws->szSetting,"StatusMsg")) + if (!strcmp(cws->szSetting,"StatusMsg")) pcli->pfnClcBroadcast( INTM_STATUSMSGCHANGED,wParam,0); } - else if ( !strcmp(cws->szModule,"ContactPhoto")) + else if (!strcmp(cws->szModule,"ContactPhoto")) { - if ( !strcmp(cws->szSetting,"File")) + if (!strcmp(cws->szSetting,"File")) pcli->pfnClcBroadcast( INTM_AVATARCHANGED,wParam,0); } else { if ((!strcmp(cws->szSetting,"XStatusName") || !strcmp(cws->szSetting,"XStatusMsg"))) pcli->pfnClcBroadcast( INTM_STATUSMSGCHANGED,wParam,0); - else if ( !strcmp(cws->szSetting,"XStatusId")) + else if (!strcmp(cws->szSetting,"XStatusId")) pcli->pfnClcBroadcast( INTM_STATUSCHANGED,wParam,0); - else if ( !strcmp(cws->szSetting,"Timezone")) + else if (!strcmp(cws->szSetting,"Timezone")) pcli->pfnClcBroadcast( INTM_TIMEZONECHANGED,wParam,0); - else if ( !strcmp(cws->szSetting,"ListeningTo")) + else if (!strcmp(cws->szSetting,"ListeningTo")) pcli->pfnClcBroadcast( INTM_STATUSMSGCHANGED,wParam,0); - else if ( !strcmp(cws->szSetting,"Transport") || !strcmp(cws->szSetting,"IsTransported")) { + else if (!strcmp(cws->szSetting,"Transport") || !strcmp(cws->szSetting,"IsTransported")) { pcli->pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam); pcli->pfnClcBroadcast( CLM_AUTOREBUILD,wParam,0); } @@ -297,7 +297,7 @@ static int clcHookAvatarChanged(WPARAM wParam, LPARAM lParam) static int clcExitDragToScroll() { - if ( !IsDragToScrollMode) return 0; + if (!IsDragToScrollMode) return 0; IsDragToScrollMode = 0; ReleaseCapture(); return 1; @@ -306,7 +306,7 @@ static int clcExitDragToScroll() static int clcProceedDragToScroll(HWND hwnd, int Y) { int pos,dy; - if ( !IsDragToScrollMode) return 0; + if (!IsDragToScrollMode) return 0; if (GetCapture() != hwnd) clcExitDragToScroll(); dy = StartDragPos-Y; pos = StartScrollPos+dy; @@ -359,7 +359,7 @@ static int clcSearchNextContact(HWND hwnd, ClcData *dat, int index, const TCHAR return foundindex; else if (nLastFound != -1 && fSearchUp && foundindex == index) return nLastFound; - else if ( !fSearchUp && foundindex == index) + else if (!fSearchUp && foundindex == index) fReturnAsFound = TRUE; else nLastFound = foundindex; @@ -368,7 +368,7 @@ static int clcSearchNextContact(HWND hwnd, ClcData *dat, int index, const TCHAR } if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) { - if ( !(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || group->cl.items[group->scanIndex]->group->expanded) + if (!(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || group->cl.items[group->scanIndex]->group->expanded) { group = group->cl.items[group->scanIndex]->group; group->scanIndex = 0; @@ -407,7 +407,7 @@ static LRESULT clcOnCreate(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPA dat->hWnd = hwnd; dat->use_avatar_service = ServiceExists(MS_AV_GETAVATARBITMAP); if (dat->use_avatar_service) - if ( !hAvatarChanged) + if (!hAvatarChanged) hAvatarChanged = HookEvent(ME_AV_AVATARCHANGED, clcHookAvatarChanged); ImageArray_Initialize(&dat->avatar_cache, FALSE, 20); //this array will be used to keep small avatars too @@ -548,7 +548,7 @@ static LRESULT clcOnChar(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARA static LRESULT clcOnPaint(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { if ( IsWindowVisible(hwnd)) { - if ( !g_CluiData.fLayered || GetParent(hwnd) != pcli->hwndContactList) { + if (!g_CluiData.fLayered || GetParent(hwnd) != pcli->hwndContactList) { PAINTSTRUCT ps; HDC hdc = BeginPaint(hwnd,&ps); g_clcPainter.cliPaintClc(hwnd,dat,hdc,&ps.rcPaint); @@ -655,7 +655,7 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LP dat->selection -= contact->isSubcontact; selMoved = 1; } - else if ( !contact->isSubcontact && contact->SubAllocated > 0) { + else if (!contact->isSubcontact && contact->SubAllocated > 0) { if (changeGroupExpand == 1 && !contact->SubExpanded) { dat->selection = cliGetRowsPriorTo(&dat->list,group,-1); selMoved = 1; @@ -706,7 +706,7 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LP else { if (contact->type == CLCIT_GROUP) { if (changeGroupExpand == 1) { - if ( !contact->group->expanded) { + if (!contact->group->expanded) { dat->selection--; selMoved = 1; } @@ -837,7 +837,7 @@ static LRESULT clcOnActivate(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, L static LRESULT clcOnSetCursor(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { - if ( !CLUI_IsInMainWindow(hwnd)) + if (!CLUI_IsInMainWindow(hwnd)) return DefWindowProc(hwnd, msg, wParam, lParam); if (g_CluiData.nBehindEdgeState>0) @@ -884,7 +884,7 @@ static LRESULT clcOnLButtonDown(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam SetFocus(hwnd); if (hit != -1 && !(hitFlags & CLCHT_NOWHERE)) { if ( hit == dat->selection && hitFlags & CLCHT_ONITEMLABEL && dat->exStyle & CLS_EX_EDITLABELS) { - if ( !(dat->dragStage & DRAGSTAGEF_SKIPRENAME)) { + if (!(dat->dragStage & DRAGSTAGEF_SKIPRENAME)) { SetCapture(hwnd); dat->iDragItem = dat->selection; dat->dragStage = DRAGSTAGE_NOTMOVED|DRAGSTAGEF_MAYBERENAME; @@ -952,7 +952,7 @@ static LRESULT clcOnLButtonDown(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam SendMessage(GetParent(hwnd),WM_NOTIFY, 0, (LPARAM)&nm); } - if ( !(hitFlags & (CLCHT_ONITEMICON|CLCHT_ONITEMLABEL|CLCHT_ONITEMCHECK))) { + if (!(hitFlags & (CLCHT_ONITEMICON|CLCHT_ONITEMLABEL|CLCHT_ONITEMCHECK))) { NMCLISTCONTROL nm; nm.hdr.code = NM_CLICK; nm.hdr.hwndFrom = hwnd; @@ -1122,7 +1122,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, ClcContact *contSour; cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL); if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName)) { - if ( !contSour->isSubcontact) + if (!contSour->isSubcontact) hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta else hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DROPMETA)); @@ -1136,7 +1136,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, cliGetRowByIndex(dat,dat->selection,&contDest,NULL); cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL); if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName)) { - if ( !contSour->isSubcontact) + if (!contSour->isSubcontact) hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta else if (contSour->subcontacts == contDest) hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DEFAULTSUB)); ///MakeDefault @@ -1152,7 +1152,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, cliGetRowByIndex(dat, dat->selection, &contDest, NULL); cliGetRowByIndex(dat, dat->iDragItem, &contSour, NULL); if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName)) { - if ( !contSour->isSubcontact) + if (!contSour->isSubcontact) hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta else if (contDest->subcontacts == contSour->subcontacts) break; @@ -1175,7 +1175,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, ClcContact *contact; if (pt.x >= 0 && pt.x < clRect.right && ((pt.y < 0 && pt.y>-dat->dragAutoScrollHeight) || (pt.y >= clRect.bottom && pt.y < clRect.bottom+dat->dragAutoScrollHeight))) { - if ( !dat->dragAutoScrolling) { + if (!dat->dragAutoScrolling) { dat->dragAutoScrolling = (pt.y < 0) ? -1 : 1; CLUI_SafeSetTimer(hwnd,TIMERID_DRAGAUTOSCROLL,dat->scrollTime,NULL); } @@ -1204,7 +1204,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, { ClcContact *contSour; cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL); - if ( !contSour->isSubcontact) + if (!contSour->isSubcontact) hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); } break; @@ -1263,13 +1263,13 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, hcontact = contSour->hContact; if (contSour->type == CLCIT_CONTACT) { if (g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName)) { - if ( !contSour->isSubcontact) { + if (!contSour->isSubcontact) { HANDLE hDest = contDest->hContact; mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do you want contact '%s' to be converted to MetaContact and '%s' be added to it?"),contDest->szText, contSour->szText); res = MessageBox(hwnd,Wording,TranslateT("Converting to MetaContact"),MB_OKCANCEL|MB_ICONQUESTION); if (res == 1) { handle = (HANDLE)CallService(MS_MC_CONVERTTOMETA,(WPARAM)hDest,0); - if ( !handle) return 0; + if (!handle) return 0; CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle); } } @@ -1281,7 +1281,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, res = MessageBox(hwnd,Wording,TranslateT("Converting to MetaContact (Moving)"),MB_OKCANCEL|MB_ICONQUESTION); if (res == 1) { HANDLE handle = (HANDLE)CallService(MS_MC_CONVERTTOMETA,(WPARAM)hdest,0); - if ( !handle) + if (!handle) return 0; CallService(MS_MC_REMOVEFROMMETA, 0, (LPARAM)hcontact); @@ -1301,14 +1301,14 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, cliGetRowByIndex(dat,dat->selection,&contDest,NULL); if (contSour->type == CLCIT_CONTACT) { if (g_szMetaModuleName && strcmp(contSour->proto,g_szMetaModuleName)) { - if ( !contSour->isSubcontact) { + if (!contSour->isSubcontact) { HANDLE handle,hcontact; hcontact = contSour->hContact; handle = contDest->hContact; mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do you want contact '%s' to be added to metacontact '%s'?"),contSour->szText, contDest->szText); res = MessageBox(hwnd,Wording,TranslateT("Adding contact to MetaContact"),MB_OKCANCEL|MB_ICONQUESTION); if (res == 1) { - if ( !handle) return 0; + if (!handle) return 0; CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle); } } @@ -1328,7 +1328,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do you want contact '%s' to be removed from MetaContact '%s' and added to '%s'?"), contSour->szText,contSour->subcontacts->szText,contDest->szText); res = MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION); if (res == 1) { - if ( !handle) return 0; + if (!handle) return 0; CallService(MS_MC_REMOVEFROMMETA, 0, (LPARAM)hcontact); CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle); @@ -1347,13 +1347,13 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, cliGetRowByIndex(dat,dat->selection,&contDest,NULL); if (contSour->type == CLCIT_CONTACT) { if (g_szMetaModuleName && strcmp(contSour->proto,g_szMetaModuleName)) { - if ( !contSour->isSubcontact) { + if (!contSour->isSubcontact) { HANDLE hcontact = contSour->hContact; HANDLE handle = contDest->subcontacts->hContact; mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do you want contact '%s' to be added to MetaContact '%s'?"), contSour->szText,contDest->subcontacts->szText); int res = MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION); if (res == 1) { - if ( !handle) return 0; + if (!handle) return 0; CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle); } } @@ -1365,7 +1365,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do you want contact '%s' to be removed from MetaContact '%s' and added to '%s'?"), contSour->szText,contSour->subcontacts->szText,contDest->subcontacts->szText); int res = MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION); if (res == 1) { - if ( !handle) return 0; + if (!handle) return 0; CallService(MS_MC_REMOVEFROMMETA, 0, (LPARAM)hcontact); CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle); @@ -1449,7 +1449,7 @@ static LRESULT clcOnDestroy(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LP DeleteObject(dat->hMenuBackground); dat->hMenuBackground = NULL; } - if ( !dat->bkChanged && dat->hBmpBackground) { + if (!dat->bkChanged && dat->hBmpBackground) { DeleteObject(dat->hBmpBackground); dat->hBmpBackground = NULL; } @@ -1472,7 +1472,7 @@ static LRESULT clcOnIntmGroupChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM w BYTE flags = 0; ClcContact *contact; - if ( !pcli->pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) + if (!pcli->pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) memset(iExtraImage, 0xFF, sizeof(iExtraImage)); else { memcpy(iExtraImage, contact->iExtraImage, sizeof(iExtraImage)); @@ -1530,7 +1530,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP // XXX CLVM changed - this means an offline msg is flashing, so the contact should be shown - if ( !pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL)) { + if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL)) { if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) { if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1) hSelItem = pcli->pfnContactToHItem(selcontact); @@ -1550,10 +1550,10 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP //item in list already if (contact->iImage == lParam) return 0; - if ( !shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline) && clcItemNotHiddenOffline(dat, group, contact)) + if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline) && clcItemNotHiddenOffline(dat, group, contact)) shouldShow = TRUE; - if ( !shouldShow && !(style & CLS_NOHIDEOFFLINE) && ((style & CLS_HIDEOFFLINE) || group->hideOffline || g_CluiData.bFilterEffective)) { // CLVM changed + if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && ((style & CLS_HIDEOFFLINE) || group->hideOffline || g_CluiData.bFilterEffective)) { // CLVM changed if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1) hSelItem = pcli->pfnContactToHItem(selcontact); pcli->pfnRemoveItemFromGroup(hwnd, group, contact, (style & CLS_CONTACTLIST) == 0); @@ -1563,12 +1563,12 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP } else if (contact) { contact->iImage = lParam; - if ( !pcli->pfnIsHiddenMode(dat, status)) + if (!pcli->pfnIsHiddenMode(dat, status)) contact->flags |= CONTACTF_ONLINE; else contact->flags &= ~CONTACTF_ONLINE; contact->image_is_special = image_is_special; - if ( !image_is_special) { //Only if it is status changing + if (!image_is_special) { //Only if it is status changing dat->needsResort = 1; needRepaint = TRUE; } @@ -1615,7 +1615,7 @@ static LRESULT clcOnIntmAvatarChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM static LRESULT clcOnIntmTimeZoneChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { ClcContact *contact; - if ( !FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE)) + if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE)) return corecli.pfnContactListControlWndProc(hwnd,msg,wParam,lParam); if (contact) { @@ -1633,7 +1633,7 @@ static LRESULT clcOnIntmNameChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP pcli->pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam); ClcContact *contact; - if ( !FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE)) + if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE)) return ret; lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName((HANDLE)wParam,0),SIZEOF(contact->szText)); @@ -1658,7 +1658,7 @@ static LRESULT clcOnIntmStatusMsgChanged(ClcData *dat, HWND hwnd, UINT msg, WPAR HANDLE hContact = (HANDLE)wParam; if (hContact == NULL || IsHContactInfo(hContact) || IsHContactGroup(hContact)) return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam); - if ( !FindItem(hwnd,dat,hContact,&contact,NULL,NULL,FALSE)) + if (!FindItem(hwnd,dat,hContact,&contact,NULL,NULL,FALSE)) return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam); if (contact)//!IsBadWritePtr(contact, sizeof(ClcContact))) { @@ -1674,7 +1674,7 @@ static LRESULT clcOnIntmNotOnListChanged(ClcData *dat, HWND hwnd, UINT msg, WPAR DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING*)lParam; ClcContact *contact; - if ( !FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE)) + if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE)) return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam); if (contact->type != CLCIT_CONTACT) @@ -1706,14 +1706,14 @@ static LRESULT clcOnIntmStatusChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry((HANDLE)wParam); if (pdnce && pdnce->m_cache_cszProto) { pdnce___SetStatus( pdnce, GetStatusForContact(pdnce->hContact,pdnce->m_cache_cszProto)); - if ( !dat->force_in_dialog && (dat->second_line_show || dat->third_line_show)) + if (!dat->force_in_dialog && (dat->second_line_show || dat->third_line_show)) gtaRenewText(pdnce->hContact); SendMessage(hwnd,INTM_ICONCHANGED, wParam, corecli.pfnGetContactIcon((HANDLE)wParam)); ClcContact *contact; if ( FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE)) { if (contact && contact->type == CLCIT_CONTACT) { - if ( !contact->image_is_special && pdnce___GetStatus( pdnce ) > ID_STATUS_OFFLINE) + if (!contact->image_is_special && pdnce___GetStatus( pdnce ) > ID_STATUS_OFFLINE) contact->iImage = corecli.pfnGetContactIcon((HANDLE)wParam); if (contact->isSubcontact && contact->subcontacts && contact->subcontacts->type == CLCIT_CONTACT) pcli->pfnClcBroadcast( INTM_STATUSCHANGED,(WPARAM)contact->subcontacts->hContact,0); //forward status changing to host meta contact @@ -1771,7 +1771,7 @@ int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack) if (ack->type == ACKTYPE_STATUS) { if (ack->result == ACKRESULT_SUCCESS) { for (int i=0; i < pcli->hClcProtoCount; i++) { - if ( !lstrcmpA(pcli->clcProto[i].szProto, ack->szModule)) { + if (!lstrcmpA(pcli->clcProto[i].szProto, ack->szModule)) { pcli->clcProto[i].dwStatus = (WORD) ack->lParam; if (pcli->clcProto[i].dwStatus >= ID_STATUS_OFFLINE) pcli->pfnTrayIconUpdateBase(pcli->clcProto[i].szProto); @@ -1801,7 +1801,7 @@ int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack) if (ack->hContact) { char * val = db_get_sa(ack->hContact,"CList","StatusMsg"); if (val) { - if ( !mir_bool_strcmpi(val,"")) + if (!mir_bool_strcmpi(val,"")) db_set_s(ack->hContact,"CList","StatusMsg",""); else gtaRenewText(ack->hContact); @@ -1826,7 +1826,7 @@ int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack) int ClcGetShortData(ClcData* pData, struct SHORTDATA *pShortData) { - if ( !pData || !pShortData) return -1; + if (!pData || !pShortData) return -1; pShortData->hWnd = pData->hWnd; pShortData->text_replace_smileys = pData->text_replace_smileys; pShortData->text_smiley_height = pData->text_smiley_height; @@ -1865,7 +1865,7 @@ int ClcEnterDragToScroll(HWND hwnd, int Y) ClcData *dat; if (IsDragToScrollMode) return 0; dat = (ClcData*)GetWindowLongPtr(hwnd,0); - if ( !dat) return 0; + if (!dat) return 0; StartDragPos = Y; StartScrollPos = dat->yScroll; IsDragToScrollMode = 1; diff --git a/plugins/Clist_modern/src/modern_clcidents.cpp b/plugins/Clist_modern/src/modern_clcidents.cpp index 5ed82a4aec..165a0ab00b 100644 --- a/plugins/Clist_modern/src/modern_clcidents.cpp +++ b/plugins/Clist_modern/src/modern_clcidents.cpp @@ -128,7 +128,7 @@ int FindItem(HWND hwnd,ClcData *dat,HANDLE hItem,ClcContact **contact,ClcGroup * nowVisible = 1; for (tgroup = group;tgroup;tgroup = tgroup->parent) { - if ( !tgroup->expanded) + if (!tgroup->expanded) { nowVisible = 0; break; @@ -143,7 +143,7 @@ int FindItem(HWND hwnd,ClcData *dat,HANDLE hItem,ClcContact **contact,ClcGroup * (IsHContactInfo(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_INFO && group->cl.items[group->scanIndex]->hContact == (HANDLE)((UINT_PTR)hItem&~HCONTACT_ISINFO))) { if (isVisible) { - if ( !nowVisible) *isVisible = 0; + if (!nowVisible) *isVisible = 0; else { int posy = cliGetRowTopY(dat,index+1); if (posy < dat->yScroll) @@ -161,7 +161,7 @@ int FindItem(HWND hwnd,ClcData *dat,HANDLE hItem,ClcContact **contact,ClcGroup * return 1; } - if ( !isIgnoreSubcontacts && + if (!isIgnoreSubcontacts && IsHContactContact(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->SubAllocated > 0) @@ -204,7 +204,7 @@ int FindItem(HWND hwnd,ClcData *dat,HANDLE hItem,ClcContact **contact,ClcGroup * void ClearRowByIndexCache() { - if ( !CacheIndexClear) + if (!CacheIndexClear) { memset(CacheIndex, 0, sizeof(CacheIndex)); CacheIndexClear = TRUE; diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index e324bbdc5f..bb65dcd753 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -85,7 +85,7 @@ void AddSubcontacts(ClcData *dat, ClcContact *cont, BOOL showOfflineHereGroup) } cont->SubAllocated = i; - if ( !i && cont->subcontacts != NULL) + if (!i && cont->subcontacts != NULL) mir_free_and_nil(cont->subcontacts); } @@ -101,8 +101,8 @@ int cli_AddItemToGroup(ClcGroup *group,int iAboveItem) ClcGroup *cli_AddGroup(HWND hwnd,ClcData *dat,const TCHAR *szName, DWORD flags,int groupId,int calcTotalMembers) { ClearRowByIndexCache(); - if ( !dat->force_in_dialog && !(GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN)) - if ( !lstrcmp(_T("-@-HIDDEN-GROUP-@-"),szName)) { //group is hidden + if (!dat->force_in_dialog && !(GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN)) + if (!lstrcmp(_T("-@-HIDDEN-GROUP-@-"),szName)) { //group is hidden ClearRowByIndexCache(); return NULL; } @@ -152,7 +152,7 @@ static void _LoadDataToContact(ClcContact *cont, ClcGroup *group, ClcData *dat, DWORD idleMode; char * szProto; - if ( !cont) return; + if (!cont) return; cont->type = CLCIT_CONTACT; cont->SubAllocated = 0; cont->isSubcontact = 0; @@ -241,9 +241,9 @@ void * AddTempGroup(HWND hwnd,ClcData *dat,const TCHAR *szName,DWORD flags,int g for (i = 1;; i++) { szGroupName = pcli->pfnGetGroupName(i,&groupFlags); if (szGroupName == NULL) break; - if ( !mir_tstrcmpi(szGroupName,szName)) f = 1; + if (!mir_tstrcmpi(szGroupName,szName)) f = 1; } - if ( !f) + if (!f) { char buf[20]; TCHAR b2[255]; @@ -265,7 +265,7 @@ void cli_AddContactToTree(HWND hwnd,ClcData *dat,HANDLE hContact,int updateTotal if (dat->IsMetaContactsEnabled && cacheEntry && cacheEntry->m_cache_nHiddenSubcontact) return; //contact should not be added - if ( !dat->IsMetaContactsEnabled && cacheEntry && g_szMetaModuleName && !mir_strcmp(cacheEntry->m_cache_cszProto,g_szMetaModuleName)) + if (!dat->IsMetaContactsEnabled && cacheEntry && g_szMetaModuleName && !mir_strcmp(cacheEntry->m_cache_cszProto,g_szMetaModuleName)) return; corecli.pfnAddContactToTree(hwnd,dat,hContact,updateTotalCount,checkHideOffline); @@ -294,7 +294,7 @@ void cli_DeleteItemFromTree(HWND hwnd,HANDLE hItem) __inline BOOL CLCItems_IsShowOfflineGroup(ClcGroup* group) { DWORD groupFlags = 0; - if ( !group) return FALSE; + if (!group) return FALSE; if (group->hideOffline) return FALSE; pcli->pfnGetGroupName(group->groupId,&groupFlags); return (groupFlags&GROUPF_SHOWOFFLINE) != 0; @@ -315,13 +315,13 @@ int RestoreSelection( ClcData *dat, HANDLE hSelected ) ClcContact *selcontact = NULL; ClcGroup *selgroup = NULL; - if ( !hSelected || !pcli->pfnFindItem( dat->hWnd, dat, hSelected, &selcontact, &selgroup, NULL)) + if (!hSelected || !pcli->pfnFindItem( dat->hWnd, dat, hSelected, &selcontact, &selgroup, NULL)) { dat->selection = -1; return dat->selection; } - if ( !selcontact->isSubcontact ) + if (!selcontact->isSubcontact ) { dat->selection = pcli->pfnGetRowsPriorTo( &dat->list, selgroup, List_IndexOf((SortedList*)&selgroup->cl, selcontact )); } @@ -390,12 +390,12 @@ void cliRebuildEntireList(HWND hwnd,ClcData *dat) group = &dat->list; group->totalMembers++; - if ( !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) { + if (!(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) { if (cacheEntry->m_cache_cszProto == NULL) { - if ( !pcli->pfnIsHiddenMode(dat,ID_STATUS_OFFLINE) || cacheEntry->m_cache_nNoHiddenOffline || CLCItems_IsShowOfflineGroup(group)) + if (!pcli->pfnIsHiddenMode(dat,ID_STATUS_OFFLINE) || cacheEntry->m_cache_nNoHiddenOffline || CLCItems_IsShowOfflineGroup(group)) cont = AddContactToGroup(dat,group,cacheEntry); } - else if ( !pcli->pfnIsHiddenMode(dat,wStatus) || cacheEntry->m_cache_nNoHiddenOffline || CLCItems_IsShowOfflineGroup(group)) + else if (!pcli->pfnIsHiddenMode(dat,wStatus) || cacheEntry->m_cache_nNoHiddenOffline || CLCItems_IsShowOfflineGroup(group)) cont = AddContactToGroup(dat,group,cacheEntry); } else cont = AddContactToGroup(dat,group,cacheEntry); @@ -461,7 +461,7 @@ int GetNewSelection(ClcGroup *group, int selection, int direction) if (count >= selection) return count; lastcount = count; count++; - if ( !direction) { + if (!direction) { if (count>selection) return lastcount; } if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (group->cl.items[group->scanIndex]->group->expanded)) { @@ -584,7 +584,7 @@ void cli_SaveStateAndRebuildList(HWND hwnd, ClcData *dat) if (savedInfo[i].parentId == -1) group = &dat->list; else { - if ( !pcli->pfnFindItem(hwnd, dat, (HANDLE) (savedInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL)) + if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) (savedInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL)) continue; group = contact->group; } @@ -605,7 +605,7 @@ void cli_SaveStateAndRebuildList(HWND hwnd, ClcData *dat) WORD pdnce___GetStatus(ClcCacheEntry *pdnce) { - if ( !pdnce) + if (!pdnce) return ID_STATUS_OFFLINE; else return pdnce->m_cache_nStatus; @@ -732,7 +732,7 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, ClcDa filterResult = strstr(g_CluiData.protoFilter, szTemp) ? 1 : 0; } if (g_CluiData.bFilterEffective & CLVM_FILTER_GROUPS) { - if ( !db_get_ts(hContact, "CList", "Group", &dbv)) { + if (!db_get_ts(hContact, "CList", "Group", &dbv)) { mir_sntprintf(szGroupMask, SIZEOF(szGroupMask), _T("%s|"), &dbv.ptszVal[0]); filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0)); mir_free(dbv.ptszVal); diff --git a/plugins/Clist_modern/src/modern_clcmsgs.cpp b/plugins/Clist_modern/src/modern_clcmsgs.cpp index ebfb45bc7a..26e2e403ba 100644 --- a/plugins/Clist_modern/src/modern_clcmsgs.cpp +++ b/plugins/Clist_modern/src/modern_clcmsgs.cpp @@ -108,7 +108,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara { int i; if (wParam != CLGN_ROOT) { - if ( !pcli->pfnFindItem(hwnd, dat, (HANDLE) lParam, &contact, &group, NULL)) + if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) lParam, &contact, &group, NULL)) return (LRESULT) (HANDLE) NULL; i = List_IndexOf((SortedList*)&group->cl,contact); if (i < 0) return 0; @@ -183,12 +183,12 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara ClcGroup *tgroup; int index = -1; int mainindex = -1; - if ( !pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL)) + if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL)) break; for (tgroup = group; tgroup; tgroup = tgroup->parent) pcli->pfnSetGroupExpand(hwnd, dat, tgroup, 1); - if ( !contact->isSubcontact) { + if (!contact->isSubcontact) { index = List_IndexOf((SortedList*)&group->cl,contact); mainindex = index; } @@ -217,7 +217,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara if (LOWORD(lParam) >= dat->extraColumnsCount) return 0; - if ( !pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL)) + if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL)) return 0; contact->iExtraImage[LOWORD(lParam)] = HIWORD(lParam); diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp index 6290654a02..e56b60f31e 100644 --- a/plugins/Clist_modern/src/modern_clcpaint.cpp +++ b/plugins/Clist_modern/src/modern_clcpaint.cpp @@ -129,10 +129,10 @@ BOOL CLCPaint::IsForegroundWindow( HWND hWnd ) HFONT CLCPaint::ChangeToFont( HDC hdc, ClcData *dat, int id, int *fontHeight ) { - if ( !dat) + if (!dat) dat = (ClcData*)GetWindowLongPtr( pcli->hwndContactTree, 0 ); - if ( !dat) + if (!dat) return NULL; HFONT res = ( HFONT )SelectObject( hdc, dat->fontModernInfo[id].hFont ); @@ -257,7 +257,7 @@ void CLCPaint::AddParam( MODERNMASK *mpModernMask, DWORD dwParamHash, const cha BOOL CLCPaint::CheckMiniMode( ClcData *dat, BOOL selected, BOOL hot ) { - if (( !dat->bCompactMode /* not mini*/ ) + if ((!dat->bCompactMode /* not mini*/ ) || (( dat->bCompactMode&0x01 ) && selected /*mini on selected*/ ) /* || ( TRUE && hot )*/ ) return FALSE; return TRUE; @@ -266,7 +266,7 @@ BOOL CLCPaint::CheckMiniMode( ClcData *dat, BOOL selected, BOOL hot ) tPaintCallbackProc CLCPaint::PaintCallbackProc( HWND hWnd, HDC hDC, RECT *rcPaint, HRGN rgn, DWORD dFlags, void * CallBackData ) { ClcData* dat = ( ClcData* )GetWindowLongPtr( hWnd, 0 ); - if ( !dat ) return 0; + if (!dat ) return 0; cliPaintClc( hWnd, dat, hDC, rcPaint ); return NULL; } @@ -367,12 +367,12 @@ int CLCPaint::_GetGeneralisedStatus() int CLCPaint::_GetRealStatus( ClcContact *pContact, int nStatus ) { - if ( !pContact->proto ) + if (!pContact->proto ) return nStatus; for ( int i=0; i < pcli->hClcProtoCount; i++ ) { - if ( !lstrcmpA( pcli->clcProto[i].szProto, pContact->proto )) + if (!lstrcmpA( pcli->clcProto[i].szProto, pContact->proto )) return pcli->clcProto[i].dwStatus; } return nStatus; @@ -395,7 +395,7 @@ RECT CLCPaint::_GetRectangle( ClcData *dat, RECT *row_rc, RECT *free_row_rc, in *left_pos += width_tmp + horizontal_space; free_row_rc->left = row_rc->left + *left_pos; } - else // if ( !left ) + else // if (!left ) { if ( dat->row_align_right_items_to_right ) width_tmp = real_width; @@ -542,7 +542,7 @@ void CLCPaint::_FillParam( MASKPARAM * lpParam, DWORD dwParamHash, const char* { lpParam->bMaskParamFlag = MPF_EQUAL|MPF_HASHED; lpParam->dwId = dwParamHash; - if ( !dwValueHash && szValue && szValue[0] ) lpParam->dwValueHash = mod_CalcHash( szValue ); + if (!dwValueHash && szValue && szValue[0] ) lpParam->dwValueHash = mod_CalcHash( szValue ); else lpParam->dwValueHash = dwValueHash; if ( szValue ) lpParam->szValue = strdupn( szValue, strlen( szValue )); else lpParam->szValue = NULL; @@ -679,7 +679,7 @@ MODERNMASK *CLCPaint::_GetCLCContactRowBackModernMask( ClcGroup *group, ClcConta void CLCPaint::_RTLRect( RECT *rect, int width, int offset ) { int left, right; - if ( !rect ) return; + if (!rect ) return; left = ( width )-rect->right; right = ( width )-rect->left; rect->left = left;//-offset; @@ -716,13 +716,13 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact free_row_rc.top += dg; height -= dg; } - if ( !InClistWindow || !gl_RowRoot || Drawing->type == CLCIT_GROUP ) + if (!InClistWindow || !gl_RowRoot || Drawing->type == CLCIT_GROUP ) { // to do paint simple RECT fr_rc = free_row_rc; //1 draw icon - if ( !( Drawing->type == CLCIT_GROUP && InClistWindow && dat->row_hide_group_icon )) + if (!( Drawing->type == CLCIT_GROUP && InClistWindow && dat->row_hide_group_icon )) { int iImage = -1; // Get image @@ -779,7 +779,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact p_rect.bottom = p_rect.top+ICON_HEIGHT; if (( Drawing->type == CLCIT_GROUP || Drawing->type == CLCIT_CONTACT || Drawing->type == CLCIT_INFO ) - && dat->extraColumnsCount > 0 && ( !InClistWindow || Drawing->type == CLCIT_CONTACT )) + && dat->extraColumnsCount > 0 && (!InClistWindow || Drawing->type == CLCIT_CONTACT )) { int BlendedInActiveState = dat->dbbBlendInActiveState; int BlendValue = dat->dbbBlend25 ? ILD_BLEND25 : ILD_BLEND50; @@ -862,7 +862,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact count_size.cy = count_rc.bottom-count_rc.top; } // modify text rect - //if ( !RTL ) + //if (!RTL ) { SIZE text_size = {0}; int wid = fr_rc.right-fr_rc.left; @@ -902,7 +902,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact - //if ( !( szCounts && strlen( szCounts )>0 )) + //if (!( szCounts && strlen( szCounts )>0 )) //uTextFormat |= ( dat->row_align_group_mode == 2 )?DT_RIGHT:( dat->row_align_group_mode == 1 )?DT_CENTER:DT_LEFT; uTextFormat |= DT_VCENTER; @@ -1019,7 +1019,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact Drawing->pos_rename_rect = rc; } - if (( !InClistWindow || !g_CluiData.fLayered ) && (( Drawing->type == CLCIT_DIVIDER ) || ( Drawing->type == CLCIT_GROUP && dat->exStyle&CLS_EX_LINEWITHGROUPS ))) + if ((!InClistWindow || !g_CluiData.fLayered ) && (( Drawing->type == CLCIT_DIVIDER ) || ( Drawing->type == CLCIT_GROUP && dat->exStyle&CLS_EX_LINEWITHGROUPS ))) { //??? RECT rc = fr_rc; @@ -1125,7 +1125,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact count_size.cy = count_rc.bottom-count_rc.top; } // modify text rect - //if ( !RTL ) + //if (!RTL ) { SIZE text_size = {0}; int wid = p_rect.right-p_rect.left; @@ -1165,7 +1165,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact - //if ( !( szCounts && strlen( szCounts )>0 )) + //if (!( szCounts && strlen( szCounts )>0 )) //uTextFormat |= ( dat->row_align_group_mode == 2 )?DT_RIGHT:( dat->row_align_group_mode == 1 )?DT_CENTER:DT_LEFT; uTextFormat |= DT_VCENTER; @@ -1259,7 +1259,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact || ( Drawing->type == CLCIT_CONTACT && Drawing->iImage != -1 && !( dat->icon_hide_on_avatar && dat->avatars_show && (( dat->use_avatar_service && Drawing->avatar_data != NULL ) || - ( !dat->use_avatar_service && Drawing->avatar_pos != AVATAR_POS_DONT_HAVE ) + (!dat->use_avatar_service && Drawing->avatar_pos != AVATAR_POS_DONT_HAVE ) ) && !Drawing->image_is_special ))) { @@ -1267,7 +1267,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact // Get image if ( Drawing->type == CLCIT_GROUP ) { - if ( !dat->row_hide_group_icon ) iImage = Drawing->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT; + if (!dat->row_hide_group_icon ) iImage = Drawing->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT; else iImage = -1; } else if ( Drawing->type == CLCIT_CONTACT ) @@ -1309,7 +1309,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact } case TC_AVATAR: { - BOOL hasAvatar = ( dat->use_avatar_service && Drawing->avatar_data != NULL ) || ( !dat->use_avatar_service && Drawing->avatar_pos != AVATAR_POS_DONT_HAVE ); + BOOL hasAvatar = ( dat->use_avatar_service && Drawing->avatar_data != NULL ) || (!dat->use_avatar_service && Drawing->avatar_pos != AVATAR_POS_DONT_HAVE ); BYTE blendmode = 255; if ( hottrack ) blendmode = 255; @@ -1318,7 +1318,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact if ( Drawing->type == CLCIT_CONTACT && dat->showIdle && ( Drawing->flags&CONTACTF_IDLE ) && _GetRealStatus( Drawing, ID_STATUS_OFFLINE ) != ID_STATUS_OFFLINE ) blendmode = 128; - if ( !hasAvatar ) //if no avatar then paint icon image + if (!hasAvatar ) //if no avatar then paint icon image { int iImage = Drawing->iImage; if ( iImage != -1 ) @@ -1477,7 +1477,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact { if ( Drawing->type == CLCIT_CONTACT && - ( !Drawing->isSubcontact || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0 )) + (!Drawing->isSubcontact || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0 )) { int BlendedInActiveState = dat->dbbBlendInActiveState; int BlendValue = dat->dbbBlend25 ? ILD_BLEND25 : ILD_BLEND50; @@ -1489,7 +1489,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact COLORREF colourFg = dat->selBkColour; int mode = BlendedInActiveState?BlendValue:ILD_NORMAL; if (Drawing->iExtraImage[iImage] == EMPTY_EXTRA_ICON) { - if ( !dat->MetaIgnoreEmptyExtra) { + if (!dat->MetaIgnoreEmptyExtra) { SetRect( &rc, p_rect.left+x, p_rect.top, p_rect.left+x+ICON_HEIGHT, p_rect.bottom ); x += dat->extraColumnSpacing; if ( dat->text_rtl != 0 ) _RTLRect( &rc, free_row_rc.right, 0 ); @@ -1533,7 +1533,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact case TC_EXTRA9: { if ( Drawing->type == CLCIT_CONTACT && - ( !Drawing->isSubcontact || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0 )) + (!Drawing->isSubcontact || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0 )) { int eNum = gl_RowTabAccess[i]->type-TC_EXTRA1; if ( eNum < dat->extraColumnsCount ) @@ -1569,7 +1569,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact { TCHAR szResult[80]; - if ( !tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0)) + if (!tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0)) { // Select font ChangeToFont(hdcMem, dat, FONTID_CONTACT_TIME, NULL ); @@ -1706,10 +1706,10 @@ int CLCPaint::_DetermineDrawMode( HWND hWnd, ClcData *dat ) paintMode = DM_CONTROL; else if ( g_CluiData.fDisableSkinEngine ) paintMode = DM_CLASSIC; - else if ( !g_CluiData.fLayered ) + else if (!g_CluiData.fLayered ) paintMode = DM_NON_LAYERED; - if ( !(paintMode&DM_CONTROL) && !CLUI_IsInMainWindow( hWnd )) + if (!(paintMode&DM_CONTROL) && !CLUI_IsInMainWindow( hWnd )) paintMode |= DM_FLOAT; LONG lStyle = GetWindowLongPtr( hWnd, GWL_STYLE ); @@ -1749,7 +1749,7 @@ void CLCPaint::_PreparePaintContext( HWND hWnd, ClcData *dat, HDC hdc, int paint pc.tmpforecolour = GetSysColor( COLOR_BTNTEXT ); } else { - pc.tmpbkcolour = (!(paintMode & DM_CONTROL) && dat->bkChanged ) ? dat->bkColour : ( !dat->useWindowsColours ? dat->bkColour : GetSysColor( COLOR_3DFACE )); + pc.tmpbkcolour = (!(paintMode & DM_CONTROL) && dat->bkChanged ) ? dat->bkColour : (!dat->useWindowsColours ? dat->bkColour : GetSysColor( COLOR_3DFACE )); pc.tmpforecolour = dat->fontModernInfo[FONTID_CONTACTS].colour; } @@ -1784,11 +1784,11 @@ void CLCPaint::_DrawBackground( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, FillRect( pc.hdcMem, rcPaint, hBrush ); DeleteObject( hBrush ); ske_SetRectOpaque( pc.hdcMem, rcPaint ); - if ( !( paintMode & DM_GREYALTERNATE)) + if (!( paintMode & DM_GREYALTERNATE)) SkinDrawGlyph( pc.hdcMem, &clRect, rcPaint, "CL,ID=Background,Type=Control"); } else if ( paintMode&DM_CLASSIC) { - if ( !_DrawNonEnginedBackground( hWnd, pc.hdcMem, rcPaint, clRect, dat )) { + if (!_DrawNonEnginedBackground( hWnd, pc.hdcMem, rcPaint, clRect, dat )) { HBRUSH hBrush = CreateSolidBrush( pc.tmpbkcolour ); FillRect( pc.hdcMem, rcPaint, hBrush ); DeleteObject( hBrush ); @@ -1862,7 +1862,7 @@ void CLCPaint::_DrawLines( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT if ( Drawing ) { // Calc row height - if ( !gl_RowRoot ) + if (!gl_RowRoot ) RowHeights_GetRowHeight( dat, hWnd, Drawing, line_num ); else RowHeight_CalcRowHeight( dat, hWnd, Drawing, line_num ); @@ -1909,10 +1909,10 @@ void CLCPaint::_DrawLines( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT else SkinDrawGlyph( pc.hdcMem, &row_rc, rcPaint, "CL,ID=GreyAlternate"); } - if ( ! (paintMode&(DM_CLASSIC|DM_CONTROL))) + if (! (paintMode&(DM_CLASSIC|DM_CONTROL))) { // Row background - if ( !(paintMode&DM_CONTROL)) + if (!(paintMode&DM_CONTROL)) { //Build mpRequest string mpRequest = _GetCLCContactRowBackModernMask( group, Drawing, indent, line_num, selected, hottrack, dat ); { @@ -2111,7 +2111,7 @@ void CLCPaint::_DrawInsertionMark( ClcData *dat, RECT& clRect, _PaintContext& pc void CLCPaint::_CopyPaintToDest( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc ) { - if ( !( paintMode&DM_GRAY ) && ( paintMode & DM_DRAW_OFFSCREEN )) + if (!( paintMode&DM_GRAY ) && ( paintMode & DM_DRAW_OFFSCREEN )) { BitBlt( hdc, rcPaint->left, rcPaint->top, rcPaint->right-rcPaint->left, rcPaint->bottom-rcPaint->top, pc.hdcMem, rcPaint->left, rcPaint->top, SRCCOPY ); } @@ -2147,7 +2147,7 @@ void CLCPaint::_PaintClc( HWND hwnd, ClcData *dat, HDC hdc, RECT *_rcPaint ) g_CluiData.t_now = time( NULL ); if ( _rcPaint && IsRectEmpty( _rcPaint )) return; // check if draw area is not empty - if ( !IsWindowVisible( hwnd )) return; // and window is visible + if (!IsWindowVisible( hwnd )) return; // and window is visible RECT clRect; GetClientRect( hwnd, &clRect ); @@ -2245,7 +2245,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *D int width; int height; BOOL miniMode; - if ( !dat->avatars_show || Drawing->type != CLCIT_CONTACT ) + if (!dat->avatars_show || Drawing->type != CLCIT_CONTACT ) break; miniMode = CheckMiniMode( dat, selected, hottrack ); AniAva_InvalidateAvatarPositions( Drawing->hContact ); @@ -2256,7 +2256,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *D // Has to draw? if (( dat->use_avatar_service && Drawing->avatar_data == NULL ) - || ( !dat->use_avatar_service && Drawing->avatar_pos == AVATAR_POS_DONT_HAVE ) + || (!dat->use_avatar_service && Drawing->avatar_pos == AVATAR_POS_DONT_HAVE ) || miniMode ) { // Don't have to draw avatar @@ -2283,7 +2283,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *D else { // Has to keep the empty space?? - if (( left && !dat->row_align_left_items_to_left ) || ( !left && !dat->row_align_right_items_to_right )) + if (( left && !dat->row_align_left_items_to_left ) || (!left && !dat->row_align_right_items_to_right )) { // Make rectangle rc = _GetRectangle( dat, &row_rc, &free_row_rc, &left_pos, &right_pos, @@ -2328,7 +2328,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *D RECT rc; int iImage = -1; BOOL has_avatar = (( dat->use_avatar_service && Drawing->avatar_data != NULL ) || - ( !dat->use_avatar_service && Drawing->avatar_pos != AVATAR_POS_DONT_HAVE )) + (!dat->use_avatar_service && Drawing->avatar_pos != AVATAR_POS_DONT_HAVE )) && !( CheckMiniMode( dat, selected, hottrack )); if ( Drawing->type == CLCIT_CONTACT @@ -2338,7 +2338,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *D && !Drawing->image_is_special ) { // Don't have to draw, but has to keep the empty space? - if (( left && !dat->row_align_left_items_to_left ) || ( !left && !dat->row_align_right_items_to_right )) + if (( left && !dat->row_align_left_items_to_left ) || (!left && !dat->row_align_right_items_to_right )) { rc = _GetRectangle( dat, &row_rc, &free_row_rc, &left_pos, &right_pos, left, dat->iconXSpace, dat->iconXSpace, ICON_HEIGHT, HORIZONTAL_SPACE ); @@ -2353,7 +2353,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *D if ( Drawing->type == CLCIT_CONTACT && dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space - && ( !Drawing->image_is_special || !has_avatar || + && (!Drawing->image_is_special || !has_avatar || ( dat->avatars_draw_overlay && dat->avatars_maxheight_size >= ICON_HEIGHT + (dat->avatars_draw_border ? 2 : 0) @@ -2394,7 +2394,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *D { TCHAR szResult[80]; - if ( !tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0)) + if (!tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0)) { SIZE text_size; RECT rc; @@ -2436,7 +2436,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *D case ITEM_EXTRA_ICONS: ////////////////////////////////////////////////////////////////////////////////////////////// { // Draw extra icons - if ( !Drawing->isSubcontact || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0 ) + if (!Drawing->isSubcontact || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0 ) { int iImage; int count = 0; @@ -2999,7 +2999,7 @@ void CLCPaint::_DrawContactIcon( HDC hdcMem, ClcData *dat, ClcContact *Drawing, // Get image if ( Drawing->type == CLCIT_GROUP ) { - if ( !dat->row_hide_group_icon ) iImage = Drawing->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT; + if (!dat->row_hide_group_icon ) iImage = Drawing->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT; else iImage = -1; } else if ( Drawing->type == CLCIT_CONTACT ) @@ -3106,10 +3106,10 @@ void CLCPaint::_DrawContactTime( HDC hdcMem, ClcData *dat, ClcContact *Drawing, { TCHAR szResult[80]; ClcCacheEntry *pdnce = (Drawing->type == CLCIT_CONTACT) ? pcli->pfnGetCacheEntry(Drawing->hContact) : NULL; - if ( !pdnce ) + if (!pdnce ) return; - if ( !tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0)) { + if (!tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0)) { // Select font ChangeToFont(hdcMem, dat, FONTID_CONTACT_TIME, NULL ); ske_DrawText(hdcMem, szResult, lstrlen( szResult ), prcItem, DT_NOPREFIX | DT_SINGLELINE ); @@ -3158,9 +3158,9 @@ void CLCPaint::_DrawContactLine( HDC hdcMem, ClcData *dat, ClcContact *Drawing, { //Subtract icon rect from left and right. RECT rcTemp; IntersectRect( &rcTemp, &Drawing->pos_icon, &rc1 ); - if ( !IsRectEmpty( &rcTemp )) rc1.right = rcTemp.left; + if (!IsRectEmpty( &rcTemp )) rc1.right = rcTemp.left; IntersectRect( &rcTemp, &Drawing->pos_icon, &rc2 ); - if ( !IsRectEmpty( &rcTemp )) rc2.left = rcTemp.right; + if (!IsRectEmpty( &rcTemp )) rc2.left = rcTemp.right; } if ( rc1.right-rc1.left >= 6 && !IsRectEmpty( &rc1 )) @@ -3245,7 +3245,7 @@ void CLCPaint::_PaintRowItems ( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact return; } //END OFF Extended LAYOUT - if ( !Drawing->ext_fItemsValid ) _CalcItemsPos( hwnd, hdcMem, dat, Drawing, &row_rc, &free_row_rc, left_pos, right_pos, selected, hottrack ); + if (!Drawing->ext_fItemsValid ) _CalcItemsPos( hwnd, hdcMem, dat, Drawing, &row_rc, &free_row_rc, left_pos, right_pos, selected, hottrack ); _DrawContactItems( hwnd, hdcMem, dat, Drawing, &row_rc, &free_row_rc, left_pos, right_pos, selected, hottrack, rcPaint ); ske_ResetTextEffect(hdcMem ); } diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp index 64670b9e97..cca9ba9184 100644 --- a/plugins/Clist_modern/src/modern_clcutils.cpp +++ b/plugins/Clist_modern/src/modern_clcutils.cpp @@ -150,7 +150,7 @@ void cliScrollTo(HWND hwnd,ClcData *dat,int desty,int noSmooth) if (desty>maxy) desty = maxy; if (desty < 0) desty = 0; if (abs(desty-dat->yScroll) < 4) noSmooth = 1; - if ( !noSmooth && dat->exStyle&CLS_EX_NOSMOOTHSCROLLING) noSmooth = 1; + if (!noSmooth && dat->exStyle&CLS_EX_NOSMOOTHSCROLLING) noSmooth = 1; previousy = dat->yScroll; BOOL keyDown = ( ( GetKeyState( VK_UP ) @@ -162,7 +162,7 @@ void cliScrollTo(HWND hwnd,ClcData *dat,int desty,int noSmooth) | GetKeyState( VK_HOME ) | GetKeyState( VK_END )) & 0x8000 ); - if ( !noSmooth && !keyDown) + if (!noSmooth && !keyDown) { startTick = GetTickCount(); for (;;) { @@ -361,7 +361,7 @@ int GetDropTargetInformation(HWND hwnd,ClcData *dat,POINT pt) dat->selection = dat->iDragItem; dat->iInsertionMark = -1; dat->nInsertionLevel = 0; - if ( !PtInRect(&clRect,pt)) return DROPTARGET_OUTSIDE; + if (!PtInRect(&clRect,pt)) return DROPTARGET_OUTSIDE; hit = cliHitTest(hwnd,dat,pt.x,pt.y,&contact,&group,&hitFlags); cliGetRowByIndex(dat,dat->iDragItem,&movecontact,&movegroup); @@ -473,7 +473,7 @@ void LoadCLCFonts( HWND hwnd, ClcData *dat ) for ( int i=0 ; i <= FONTID_MODERN_MAX; i++ ) { - if ( !dat->fontModernInfo[i].changed && dat->fontModernInfo[i].hFont ) + if (!dat->fontModernInfo[i].changed && dat->fontModernInfo[i].hFont ) { DeleteObject(dat->fontModernInfo[i].hFont); } @@ -624,7 +624,7 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat ) { DBVARIANT dbv = {0}; - if ( !db_get_ts(NULL, "CList","SecondLineText", &dbv)) + if (!db_get_ts(NULL, "CList","SecondLineText", &dbv)) { lstrcpyn(dat->second_line_text, dbv.ptszVal, SIZEOF(dat->second_line_text)-1); dat->second_line_text[SIZEOF(dat->second_line_text)-1] = _T('\0'); @@ -662,7 +662,7 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat ) { DBVARIANT dbv = {0}; - if ( !db_get_ts(NULL, "CList","ThirdLineText", &dbv)) + if (!db_get_ts(NULL, "CList","ThirdLineText", &dbv)) { lstrcpyn(dat->third_line_text, dbv.ptszVal, SIZEOF(dat->third_line_text)-1); dat->third_line_text[SIZEOF(dat->third_line_text)-1] = _T('\0'); @@ -710,13 +710,13 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat ) if (g_CluiData.fDisableSkinEngine) { DBVARIANT dbv; - if ( !dat->bkChanged) + if (!dat->bkChanged) { dat->bkColour = sttGetColor("CLC","BkColour",GetSysColor(COLOR_3DFACE)); { if ( db_get_b(NULL,"CLC","UseBitmap",CLCDEFAULT_USEBITMAP)) { - if ( !db_get_s(NULL,"CLC","BkBitmap",&dbv)) + if (!db_get_s(NULL,"CLC","BkBitmap",&dbv)) { dat->hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal); db_free(&dbv); @@ -732,7 +732,7 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat ) dat->MenuTextHiColor = sttGetColor("Menu","SelTextColour",CLCDEFAULT_MODERN_SELTEXTCOLOUR); if ( db_get_b(NULL,"Menu","UseBitmap",CLCDEFAULT_USEBITMAP)) { - if ( !db_get_s(NULL,"Menu","BkBitmap",&dbv)) { + if (!db_get_s(NULL,"Menu","BkBitmap",&dbv)) { dat->hMenuBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal); db_free(&dbv); } @@ -746,7 +746,7 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat ) dat->selTextColour = db_get_dw(NULL,"CLC","SelTextColour",CLCDEFAULT_MODERN_SELTEXTCOLOUR); dat->hotTextColour = db_get_dw(NULL,"CLC","HotTextColour",CLCDEFAULT_MODERN_HOTTEXTCOLOUR); dat->quickSearchColour = db_get_dw(NULL,"CLC","QuickSearchColour",CLCDEFAULT_MODERN_QUICKSEARCHCOLOUR); - if ( !g_szMetaModuleName && ServiceExists(MS_MC_GETPROTOCOLNAME)) g_szMetaModuleName = (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0); + if (!g_szMetaModuleName && ServiceExists(MS_MC_GETPROTOCOLNAME)) g_szMetaModuleName = (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0); dat->IsMetaContactsEnabled = (!(GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_MANUALUPDATE)) && g_szMetaModuleName && db_get_b(NULL,g_szMetaModuleName,"Enabled",1) && ServiceExists(MS_MC_GETDEFAULTCONTACT); @@ -830,7 +830,7 @@ int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk) } if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) { - if ( !(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || group->cl.items[group->scanIndex]->group->expanded) { + if (!(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || group->cl.items[group->scanIndex]->group->expanded) { group = group->cl.items[group->scanIndex]->group; group->scanIndex = 0; SubCount = 0; @@ -840,7 +840,7 @@ int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk) } if (contact->type == CLCIT_CONTACT && contact->SubAllocated) { - if ( !(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || contact->SubExpanded ) + if (!(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || contact->SubExpanded ) { int i=0; for (i=0; i < contact->SubAllocated; i++) @@ -860,7 +860,7 @@ int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk) int contactScanIndex = group->scanIndex; for (; group; group = group->parent) pcli->pfnSetGroupExpand(hwnd, dat, group, 1); - if ( !contact->SubExpanded) + if (!contact->SubExpanded) ExpandMetaContact(hwnd, contact, dat, 1 ); return pcli->pfnGetRowsPriorTo(&dat->list, contactGroup, contactScanIndex+SubCount+i+1); } diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index a4a0e10380..327d6e4d3f 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -251,7 +251,7 @@ static BOOL sttDrawEventAreaBackground(HWND hwnd, HDC hdc, RECT *rect) if (rect) rc = *rect; else GetClientRect(hwnd,&rc); - if ( !event_area.hBmpBackground && !event_area.useWinColors) + if (!event_area.hBmpBackground && !event_area.useWinColors) { HBRUSH hbr = CreateSolidBrush(event_area.bkColour); FillRect(hdc, &rc, hbr); @@ -279,7 +279,7 @@ static int ehhEventAreaBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam) DBVARIANT dbv; event_area.bkColour = sttGetColor("EventArea","BkColour",CLCDEFAULT_BKCOLOUR); if ( db_get_b(NULL,"EventArea","UseBitmap",CLCDEFAULT_USEBITMAP)) { - if ( !db_get_s(NULL,"EventArea","BkBitmap",&dbv)) { + if (!db_get_s(NULL,"EventArea","BkBitmap",&dbv)) { event_area.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal); db_free(&dbv); } @@ -391,7 +391,7 @@ static void EventArea_HideShowNotifyFrame() desired = FALSE; if (desired) { - if ( !dwVisible) + if (!dwVisible) CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)hNotifyFrame, 0); } else { @@ -538,7 +538,7 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP break; case WM_SIZE: - if ( !g_CluiData.fLayered) + if (!g_CluiData.fLayered) InvalidateRect(hwnd,NULL,FALSE); return DefWindowProc(hwnd, msg, wParam, lParam); diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp index 9516654e00..b4c41cd20c 100644 --- a/plugins/Clist_modern/src/modern_clistmenus.cpp +++ b/plugins/Clist_modern/src/modern_clistmenus.cpp @@ -104,7 +104,7 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam) mi.icolibItem = iconList[bContactRate].hIcolib; mi.pszPopupName = (char *)-1; mi.position = 0; - if ( !bContactRate) + if (!bContactRate) mi.ptszName = FAVMENUROOTNAME; else { int bufsize = (lstrlen(FAVMENUROOTNAME)+lstrlen(rates[bContactRate])+15)*sizeof(TCHAR); @@ -113,7 +113,7 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam) mi.ptszName = name; } mi.flags = CMIF_ROOTPOPUP | CMIF_TCHAR; - if ( !hFavoriteContactMenu) + if (!hFavoriteContactMenu) hFavoriteContactMenu = Menu_AddContactMenuItem(&mi); else { mi.flags |= CMIM_FLAGS | CMIM_NAME; @@ -128,7 +128,7 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam) CallService(MO_SETOPTIONSMENUITEM, 0, (LPARAM)&op); mi.hParentMenu = hFavoriteContactMenu; - if ( !hFavoriteContactMenuItems) { + if (!hFavoriteContactMenuItems) { hFavoriteContactMenuItems = (HGENMENU*)malloc(sizeof(HANDLE)*SIZEOF(rates)); memset(hFavoriteContactMenuItems, 0, sizeof(HANDLE)*SIZEOF(rates)); } diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp index 9d0e654fb4..610e801097 100644 --- a/plugins/Clist_modern/src/modern_clistmod.cpp +++ b/plugins/Clist_modern/src/modern_clistmod.cpp @@ -87,7 +87,7 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact) char *szActProto = (char*)szProto; int nActStatus = nStatus; HANDLE hActContact = hContact; - if ( !db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT) && g_szMetaModuleName && !mir_strcmp(szActProto,g_szMetaModuleName)) { + if (!db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT) && g_szMetaModuleName && !mir_strcmp(szActProto,g_szMetaModuleName)) { // substitute params by mostonline contact datas HANDLE hMostOnlineContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hActContact,0); if (hMostOnlineContact) { @@ -313,7 +313,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) { TCHAR buf[255]; GetClassName(hAux,buf,SIZEOF(buf)); - if ( !lstrcmp(buf,CLUIFrameSubContainerClassName)) + if (!lstrcmp(buf,CLUIFrameSubContainerClassName)) { hWndFound = TRUE; break; @@ -358,7 +358,7 @@ int cliShowHide(WPARAM wParam,LPARAM lParam) iVisibleState = GWVS_HIDDEN; } - if ( !method && db_get_b(NULL, "ModernData", "BehindEdge", SETTING_BEHINDEDGE_DEFAULT) > 0) { + if (!method && db_get_b(NULL, "ModernData", "BehindEdge", SETTING_BEHINDEDGE_DEFAULT) > 0) { g_CluiData.bBehindEdgeSettings = db_get_b(NULL, "ModernData", "BehindEdge", SETTING_BEHINDEDGE_DEFAULT); CLUI_ShowFromBehindEdge(); g_CluiData.bBehindEdgeSettings = 0; @@ -384,11 +384,11 @@ int cliShowHide(WPARAM wParam,LPARAM lParam) Sync( CLUIFrames_ActivateSubContainers, TRUE ); CLUI_ShowWindowMod(pcli->hwndContactList, SW_RESTORE); - if ( !db_get_b(NULL,"CList","OnDesktop",SETTING_ONDESKTOP_DEFAULT)) { + if (!db_get_b(NULL,"CList","OnDesktop",SETTING_ONDESKTOP_DEFAULT)) { Sync(CLUIFrames_OnShowHide, pcli->hwndContactList,1); //TO BE PROXIED SetWindowPos(pcli->hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE |SWP_NOACTIVATE); g_bCalledFromShowHide = 1; - if ( !db_get_b(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT)) + if (!db_get_b(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT)) SetWindowPos(pcli->hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); g_bCalledFromShowHide = 0; } @@ -429,6 +429,6 @@ int cliShowHide(WPARAM wParam,LPARAM lParam) int CListMod_HideWindow(HWND hwndContactList, int mode) { KillTimer(pcli->hwndContactList,1/*TM_AUTOALPHA*/); - if ( !CLUI_HideBehindEdge()) return CLUI_SmoothAlphaTransition(pcli->hwndContactList, 0, 1); + if (!CLUI_HideBehindEdge()) return CLUI_SmoothAlphaTransition(pcli->hwndContactList, 0, 1); return 0; } diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp index 8367508228..7ae97f6699 100644 --- a/plugins/Clist_modern/src/modern_clistopts.cpp +++ b/plugins/Clist_modern/src/modern_clistopts.cpp @@ -277,7 +277,7 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa SendDlgItemMessage(hwndDlg, IDC_AVATAR_BORDER_COLOR, CPM_SETCOLOUR, 0, (COLORREF)db_get_dw(NULL, "CList", "AvatarsBorderColor", SETTINGS_AVATARBORDERCOLOR_DEFAULT)); - if ( !IsDlgButtonChecked(hwndDlg,IDC_SHOW_AVATARS)) { + if (!IsDlgButtonChecked(hwndDlg,IDC_SHOW_AVATARS)) { EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_DRAW_BORDER),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_BORDER_COLOR_L),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_BORDER_COLOR),FALSE); @@ -300,32 +300,32 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa EnableWindow( GetDlgItem( hwndDlg, IDC_AVATAR_FASTDRAW), FALSE ); } - if ( !IsDlgButtonChecked( hwndDlg, IDC_SHOW_ANIAVATARS )) + if (!IsDlgButtonChecked( hwndDlg, IDC_SHOW_ANIAVATARS )) EnableWindow( GetDlgItem( hwndDlg, IDC_AVATAR_FASTDRAW), FALSE ); - if ( !IsDlgButtonChecked(hwndDlg,IDC_AVATAR_DRAW_BORDER)) { + if (!IsDlgButtonChecked(hwndDlg,IDC_AVATAR_DRAW_BORDER)) { EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_BORDER_COLOR_L),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_BORDER_COLOR),FALSE); } - if ( !IsDlgButtonChecked(hwndDlg,IDC_AVATAR_ROUND_CORNERS)) { + if (!IsDlgButtonChecked(hwndDlg,IDC_AVATAR_ROUND_CORNERS)) { EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN),FALSE); } - if ( !IsDlgButtonChecked(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK)) { + if (!IsDlgButtonChecked(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK)) { EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN),FALSE); } - if ( !IsDlgButtonChecked(hwndDlg,IDC_AVATAR_OVERLAY_ICONS)) { + if (!IsDlgButtonChecked(hwndDlg,IDC_AVATAR_OVERLAY_ICONS)) { EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_OVERLAY_ICON_NORMAL),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_OVERLAY_ICON_PROTOCOL),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_OVERLAY_ICON_CONTACT),FALSE); } - if ( !ServiceExists(MS_AV_GETAVATARBITMAP)) { + if (!ServiceExists(MS_AV_GETAVATARBITMAP)) { EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_ANIAVATARS),FALSE); SetDlgItemText(hwndDlg, IDC_SHOW_ANIAVATARS, TranslateT("Animate Avatars (GDI+ and Avatar Service module (avs.dll) are required)")); } @@ -448,7 +448,7 @@ static INT_PTR CALLBACK DlgProcItemIconOpts(HWND hwndDlg, UINT msg, WPARAM wPara CheckDlgButton(hwndDlg, IDC_DRAWSTATUSOVERLAY, (db_get_b(NULL, "CLC", "DrawOverlayedStatus", SETTING_DRAWOVERLAYEDSTATUS_DEFAULT) & 2) ? BST_CHECKED : BST_UNCHECKED); EnableWindow(GetDlgItem(hwndDlg, IDC_DRAWSTATUSOVERLAY), IsDlgButtonChecked(hwndDlg, IDC_USEXSTATUS)); - if ( !IsDlgButtonChecked(hwndDlg,IDC_HIDE_ICON_ON_AVATAR)) + if (!IsDlgButtonChecked(hwndDlg,IDC_HIDE_ICON_ON_AVATAR)) EnableWindow(GetDlgItem(hwndDlg,IDC_DRAW_ON_AVATAR_SPACE),FALSE); ShowWindow(GetDlgItem(hwndDlg, IDC_ALWAYS_VISIBLEICON), SW_HIDE); @@ -555,7 +555,7 @@ static INT_PTR CALLBACK DlgProcItemTextOpts(HWND hwndDlg, UINT msg, WPARAM wPara CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_DRAW_SMILEYS_ON_FIRST_LINE), smileAddPresent ? SW_SHOW : SW_HIDE); } - if ( !IsDlgButtonChecked(hwndDlg,IDC_REPLACE_SMILEYS)) + if (!IsDlgButtonChecked(hwndDlg,IDC_REPLACE_SMILEYS)) EnableWindow(GetDlgItem(hwndDlg,IDC_USE_PROTOCOL_SMILEYS),FALSE); break; @@ -611,7 +611,7 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM CheckDlgButton(hwndDlg, IDC_DRAW_SMILEYS, db_get_b(NULL,"CList","SecondLineDrawSmileys",SETTING_SECONDLINE_SMILEYS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED); { DBVARIANT dbv; - if ( !db_get_ts(NULL, "CList","SecondLineText", &dbv)) { + if (!db_get_ts(NULL, "CList","SecondLineText", &dbv)) { SetWindowText(GetDlgItem(hwndDlg,IDC_VARIABLE_TEXT), dbv.ptszVal); db_free(&dbv); } @@ -633,7 +633,7 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM CheckDlgButton(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY, db_get_b(NULL,"CList","SecondLineShowListeningIfNoAway",SETTING_SECONDLINE_LISTENINGIFNOAWAY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_USE_NAME_AND_MESSAGE, db_get_b(NULL,"CList","SecondLineUseNameAndMessageForXStatus",SETTING_SECONDLINE_XSTATUSNAMETEXT_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED); - if ( !IsDlgButtonChecked(hwndDlg,IDC_SHOW)) + if (!IsDlgButtonChecked(hwndDlg,IDC_SHOW)) { EnableWindow(GetDlgItem(hwndDlg,IDC_USE_PROTOCOL_SMILEYS),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_TOP_SPACE_SPIN),FALSE); @@ -656,15 +656,15 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM EnableWindow(GetDlgItem(hwndDlg,IDC_USE_NAME_AND_MESSAGE),FALSE); } else { - if ( !IsDlgButtonChecked(hwndDlg,IDC_TEXT)) { + if (!IsDlgButtonChecked(hwndDlg,IDC_TEXT)) { EnableWindow(GetDlgItem(hwndDlg,IDC_VARIABLE_TEXT),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_VARIABLES_L),FALSE); } - if ( !IsDlgButtonChecked(hwndDlg,IDC_STATUS) && !IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE)) { + if (!IsDlgButtonChecked(hwndDlg,IDC_STATUS) && !IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE)) { EnableWindow(GetDlgItem(hwndDlg,IDC_XSTATUS_HAS_PRIORITY),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_USE_NAME_AND_MESSAGE),FALSE); } - if ( !IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE)) { + if (!IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE)) { EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_STATUS_IF_NOAWAY),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_LISTENING_IF_NOAWAY),FALSE); } @@ -787,7 +787,7 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM CheckDlgButton(hwndDlg, IDC_DRAW_SMILEYS, db_get_b(NULL,"CList","ThirdLineDrawSmileys",SETTING_THIRDLINE_SMILEYS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED ); { DBVARIANT dbv; - if ( !db_get_ts(NULL, "CList","ThirdLineText", &dbv)) { + if (!db_get_ts(NULL, "CList","ThirdLineText", &dbv)) { SetWindowText(GetDlgItem(hwndDlg,IDC_VARIABLE_TEXT), dbv.ptszVal); db_free(&dbv); } @@ -808,7 +808,7 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM CheckDlgButton(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY, db_get_b(NULL,"CList","ThirdLineShowListeningIfNoAway",SETTING_THIRDLINE_LISTENINGIFNOAWAY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_USE_NAME_AND_MESSAGE, db_get_b(NULL,"CList","ThirdLineUseNameAndMessageForXStatus",SETTING_THIRDLINE_XSTATUSNAMETEXT_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED); - if ( !IsDlgButtonChecked(hwndDlg,IDC_SHOW)) { + if (!IsDlgButtonChecked(hwndDlg,IDC_SHOW)) { EnableWindow(GetDlgItem(hwndDlg,IDC_USE_PROTOCOL_SMILEYS),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_TOP_SPACE_SPIN),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_TOP_SPACE),FALSE); @@ -830,15 +830,15 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_LISTENING_IF_NOAWAY),FALSE); } else { - if ( !IsDlgButtonChecked(hwndDlg,IDC_TEXT)) { + if (!IsDlgButtonChecked(hwndDlg,IDC_TEXT)) { EnableWindow(GetDlgItem(hwndDlg,IDC_VARIABLE_TEXT),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_VARIABLES_L),FALSE); } - if ( !IsDlgButtonChecked(hwndDlg,IDC_STATUS) && !IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE)) { + if (!IsDlgButtonChecked(hwndDlg,IDC_STATUS) && !IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE)) { EnableWindow(GetDlgItem(hwndDlg,IDC_XSTATUS_HAS_PRIORITY),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_USE_NAME_AND_MESSAGE),FALSE); } - if ( !IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE)) { + if (!IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE)) { EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_STATUS_IF_NOAWAY),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_LISTENING_IF_NOAWAY),FALSE); } diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp index 45088d09c2..a45d83705a 100644 --- a/plugins/Clist_modern/src/modern_clistsettings.cpp +++ b/plugins/Clist_modern/src/modern_clistsettings.cpp @@ -88,11 +88,11 @@ void FreeDisplayNameCache() ClcCacheEntry* cliGetCacheEntry(HANDLE hContact) { - if ( !clistCache) return NULL; + if (!clistCache) return NULL; int idx; ClcCacheEntry *p; - if ( !List_GetIndex( clistCache, &hContact, &idx )) { + if (!List_GetIndex( clistCache, &hContact, &idx )) { if (( p = pcli->pfnCreateCacheItem( hContact )) != NULL ) { List_Insert( clistCache, p, idx ); pcli->pfnInvalidateDisplayNameCacheEntry( hContact ); @@ -110,7 +110,7 @@ void CListSettings_FreeCacheItemData(ClcCacheEntry *pDst) void CListSettings_FreeCacheItemDataOption( ClcCacheEntry *pDst, DWORD flag ) { - if ( !pDst) + if (!pDst) return; if ( flag & CCI_NAME) @@ -133,7 +133,7 @@ int CListSettings_SetToCache(ClcCacheEntry *pSrc, DWORD flag); void CListSettings_CopyCacheItems(ClcCacheEntry *pDst, ClcCacheEntry *pSrc, DWORD flag) { - if ( !pDst || !pSrc) return; + if (!pDst || !pSrc) return; CListSettings_FreeCacheItemDataOption(pDst, flag); if ( flag & CCI_NAME ) { @@ -179,11 +179,11 @@ void CListSettings_CopyCacheItems(ClcCacheEntry *pDst, ClcCacheEntry *pSrc, DWOR int CListSettings_GetCopyFromCache(ClcCacheEntry *pDest, DWORD flag) { - if ( !pDest || !pDest->hContact) + if (!pDest || !pDest->hContact) return -1; ClcCacheEntry *pSource = pcli->pfnGetCacheEntry(pDest->hContact); - if ( !pSource) + if (!pSource) return -1; CListSettings_CopyCacheItems(pDest, pSource, flag); @@ -192,11 +192,11 @@ int CListSettings_GetCopyFromCache(ClcCacheEntry *pDest, DWORD flag) int CListSettings_SetToCache(ClcCacheEntry *pSrc, DWORD flag) { - if ( !pSrc || !pSrc->hContact) + if (!pSrc || !pSrc->hContact) return -1; ClcCacheEntry *pDst = pcli->pfnGetCacheEntry(pSrc->hContact); - if ( !pDst) + if (!pDst) return -1; CListSettings_CopyCacheItems(pDst, pSrc, flag); @@ -221,7 +221,7 @@ void cliCheckCacheItem(ClcCacheEntry *pdnce) return; if (pdnce->hContact == NULL) { //selfcontact - if ( !pdnce->tszName) + if (!pdnce->tszName) pdnce->getName(); return; } @@ -249,7 +249,7 @@ void cliCheckCacheItem(ClcCacheEntry *pdnce) if (pdnce->tszGroup == NULL) { DBVARIANT dbv = {0}; - if ( !db_get_ts(pdnce->hContact,"CList","Group",&dbv)) { + if (!db_get_ts(pdnce->hContact,"CList","Group",&dbv)) { pdnce->tszGroup = mir_tstrdup(dbv.ptszVal); db_free(&dbv); } @@ -366,7 +366,7 @@ int GetStatusForContact(HANDLE hContact,char *szProto) void ClcCacheEntry::freeName() { - if ( !isUnknown) + if (!isUnknown) mir_free(tszName); else isUnknown = false; @@ -385,7 +385,7 @@ LBL_Unknown: } tszName = pcli->pfnGetContactDisplayName(hContact, GCDNF_NOCACHE); - if ( !lstrcmp(tszName, UnknownConctactTranslatedName)) { + if (!lstrcmp(tszName, UnknownConctactTranslatedName)) { mir_free(tszName); goto LBL_Unknown; } @@ -416,7 +416,7 @@ int GetContactCachedStatus(HANDLE hContact) int ContactAdded(WPARAM wParam,LPARAM lParam) { - if ( !MirandaExiting()) { + if (!MirandaExiting()) { HANDLE hContact = (HANDLE)wParam; cli_ChangeContactIcon(hContact,pcli->pfnIconFromStatusMode((char*)GetContactCachedProtocol(hContact),ID_STATUS_OFFLINE,hContact),1); ///by FYR pcli->pfnSortContacts(); @@ -440,13 +440,13 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam) return 0; DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam; - if ( !strcmp(cws->szModule, pdnce->m_cache_cszProto)) { + if (!strcmp(cws->szModule, pdnce->m_cache_cszProto)) { InvalidateDNCEbyPointer(hContact, pdnce, cws->value.type); - if ( !strcmp(cws->szSetting,"IsSubcontact")) + if (!strcmp(cws->szSetting,"IsSubcontact")) PostMessage(pcli->hwndContactTree,CLM_AUTOREBUILD, 0, 0); - if ( !mir_strcmp(cws->szSetting, "Status") || wildcmp(cws->szSetting, "Status?")) { + if (!mir_strcmp(cws->szSetting, "Status") || wildcmp(cws->szSetting, "Status?")) { if (g_szMetaModuleName && !mir_strcmp(cws->szModule,g_szMetaModuleName) && mir_strcmp(cws->szSetting, "Status")) { int res = 0; if (pcli->hwndContactTree && g_flag_bOnModulesLoadedCalled) @@ -472,7 +472,7 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam) pcli->pfnSortContacts(); } else { - if ( !(!mir_strcmp(cws->szSetting, "LogonTS") || !mir_strcmp(cws->szSetting, "TickTS") || !mir_strcmp(cws->szSetting, "InfoTS"))) + if (!(!mir_strcmp(cws->szSetting, "LogonTS") || !mir_strcmp(cws->szSetting, "TickTS") || !mir_strcmp(cws->szSetting, "InfoTS"))) pcli->pfnSortContacts(); return 0; @@ -480,18 +480,18 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam) } } - if ( !strcmp(cws->szModule,"CList")) { + if (!strcmp(cws->szModule,"CList")) { //name is null or (setting is myhandle) - if ( !strcmp(cws->szSetting,"Rate")) + if (!strcmp(cws->szSetting,"Rate")) pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0); else if (pdnce->tszName == NULL || !strcmp(cws->szSetting,"MyHandle")) InvalidateDNCEbyPointer(hContact,pdnce,cws->value.type); - else if ( !strcmp(cws->szSetting,"Group")) + else if (!strcmp(cws->szSetting,"Group")) InvalidateDNCEbyPointer(hContact,pdnce,cws->value.type); - else if ( !strcmp(cws->szSetting,"Hidden")) { + else if (!strcmp(cws->szSetting,"Hidden")) { InvalidateDNCEbyPointer(hContact,pdnce,cws->value.type); if (cws->value.type == DBVT_DELETED || cws->value.bVal == 0) { char *szProto = GetContactProto((HANDLE)wParam); @@ -500,13 +500,13 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam) } pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0); } - else if ( !strcmp(cws->szSetting,"noOffline")) { + else if (!strcmp(cws->szSetting,"noOffline")) { InvalidateDNCEbyPointer(hContact,pdnce,cws->value.type); pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0); } } - else if ( !strcmp(cws->szModule,"Protocol")) { - if ( !strcmp(cws->szSetting,"p")) { + else if (!strcmp(cws->szModule,"Protocol")) { + if (!strcmp(cws->szSetting,"p")) { InvalidateDNCEbyPointer(hContact,pdnce,cws->value.type); char *szProto = (cws->value.type == DBVT_DELETED) ? NULL : cws->value.pszVal; cli_ChangeContactIcon(hContact,pcli->pfnIconFromStatusMode(szProto, @@ -519,7 +519,7 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam) int PostAutoRebuidMessage(HWND hwnd) { - if ( !CLM_AUTOREBUILD_WAS_POSTED) + if (!CLM_AUTOREBUILD_WAS_POSTED) CLM_AUTOREBUILD_WAS_POSTED = PostMessage(hwnd,CLM_AUTOREBUILD, 0, 0); return CLM_AUTOREBUILD_WAS_POSTED; } diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index c772af7186..33be64eb1e 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -101,7 +101,7 @@ INT_PTR CListTray_GetGlobalStatus(WPARAM wparam,LPARAM lparam) int connectingCount = 0; for (i=0; i < pcli->hClcProtoCount; i++) { - if ( !pcli->pfnGetProtocolVisibility(pcli->clcProto[i].szProto)) continue; + if (!pcli->pfnGetProtocolVisibility(pcli->clcProto[i].szProto)) continue; if (pcli->clcProto[i].dwStatus >= ID_STATUS_CONNECTING && pcli->clcProto[i].dwStatus < ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES) { @@ -222,10 +222,10 @@ int cliTrayCalcChanged(const char *szChangedProto, int averageMode, int netProto break; case SETTING_TRAYICON_MULTI: - if ( !pcli->trayIcon) + if (!pcli->trayIcon) pcli->pfnTrayIconRemove(NULL,NULL); else if ( db_get_b(NULL,"CList","AlwaysMulti",SETTING_ALWAYSMULTI_DEFAULT )) { - if ( !pcli->pfnGetProtocolVisibility(szChangedProto)) + if (!pcli->pfnGetProtocolVisibility(szChangedProto)) return -1; status = CallProtoService(szChangedProto,PS_GETSTATUS, 0, 0); @@ -425,7 +425,7 @@ static INT_PTR AddTrayMenuItem(WPARAM wParam,LPARAM lParam) CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam; TMO_MenuItem tmi; - if ( !pcli->pfnConvertMenu(mi, &tmi)) + if (!pcli->pfnConvertMenu(mi, &tmi)) return NULL; lpTrayMenuExecParam mmep = (lpTrayMenuExecParam)mir_alloc(sizeof(TrayMenuExecParam)); @@ -478,7 +478,7 @@ INT_PTR TrayMenuExecService(WPARAM wParam,LPARAM lParam) { if (wParam != 0) { lpTrayMenuExecParam mmep = (lpTrayMenuExecParam)wParam; - if ( !mir_strcmp(mmep->szServiceName,"Help/AboutCommand")) { + if (!mir_strcmp(mmep->szServiceName,"Help/AboutCommand")) { //bug in help.c,it used wparam as parent window handle without reason. mmep->Param1 = 0; } diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 5f5e087734..586db4e522 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -191,7 +191,7 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM wParam, LPARAM lParam) HANDLE hItem = (HANDLE)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0); Menu_ShowItem(hRenameMenuItem, hItem != 0); - if ( !hItem || !IsHContactContact(hItem) || !db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT)) { + if (!hItem || !IsHContactContact(hItem) || !db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT)) { Menu_ShowItem(hShowAvatarMenuItem, false); Menu_ShowItem(hHideAvatarMenuItem, false); } @@ -505,7 +505,7 @@ void UnloadAvatarOverlayIcon() BOOL CLUI_CheckOwnedByClui(HWND hWnd) { - if ( !hWnd) + if (!hWnd) return FALSE; HWND hWndClui = pcli->hwndContactList; @@ -515,7 +515,7 @@ BOOL CLUI_CheckOwnedByClui(HWND hWnd) TCHAR buf[255]; GetClassName(hWndMid,buf,254); - if ( !mir_tstrcmpi(buf, CLUIFrameSubContainerClassName)) + if (!mir_tstrcmpi(buf, CLUIFrameSubContainerClassName)) return TRUE; return FALSE; @@ -647,7 +647,7 @@ void CLUI_ChangeWindowMode() LONG styleMask = WS_CLIPCHILDREN|WS_BORDER|WS_CAPTION|WS_MINIMIZEBOX|WS_POPUPWINDOW|WS_CLIPCHILDREN|WS_THICKFRAME|WS_SYSMENU; LONG styleMaskEx = WS_EX_TOOLWINDOW|WS_EX_LAYERED; LONG curStyle,curStyleEx; - if ( !pcli->hwndContactList) return; + if (!pcli->hwndContactList) return; g_mutex_bChangingMode = TRUE; g_bTransparentFlag = db_get_b( NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT); @@ -655,7 +655,7 @@ void CLUI_ChangeWindowMode() if (g_bTransparentFlag == 0 && g_CluiData.bCurrentAlpha != 0) g_CluiData.bCurrentAlpha = 255; //2- Calculate STYLES and STYLESEX - if ( !g_CluiData.fLayered) { + if (!g_CluiData.fLayered) { style = 0; styleEx = 0; if ( db_get_b(NULL,"CList","ThinBorder",SETTING_THINBORDER_DEFAULT) || ( db_get_b(NULL,"CList","NoBorder",SETTING_NOBORDER_DEFAULT))) { @@ -758,7 +758,7 @@ void CLUI_ChangeWindowMode() CLUIFrames_UpdateBorders(); - if ( !g_CluiData.fLayered) { + if (!g_CluiData.fLayered) { HRGN hRgn1; RECT r; int v,h; @@ -936,7 +936,7 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) int count; TCHAR fileFull[MAX_PATH]; - if ( !tszFolderPath[0] ) { + if (!tszFolderPath[0] ) { TCHAR szRelativePath[MAX_PATH]; GetModuleFileName( GetModuleHandle(NULL), szRelativePath, MAX_PATH); TCHAR *str = _tcsrchr( szRelativePath, '\\' ); @@ -1139,14 +1139,14 @@ static int CLUI_DrawMenuBackGround(HWND hwnd, HDC hdc, int item, int state) HRGN treg,treg2; ClcData *dat = (ClcData*)GetWindowLongPtr(pcli->hwndContactTree,0); - if ( !dat) + if (!dat) return 1; GetWindowRect(hwnd, &ra); MENUBARINFO mbi = { sizeof(MENUBARINFO) }; GetMenuBarInfo(hwnd, OBJID_MENU, 0, &mbi); - if ( !(mbi.rcBar.right-mbi.rcBar.left > 0 && mbi.rcBar.bottom-mbi.rcBar.top > 0)) + if (!(mbi.rcBar.right-mbi.rcBar.left > 0 && mbi.rcBar.bottom-mbi.rcBar.top > 0)) return 1; r1 = mbi.rcBar; @@ -1181,7 +1181,7 @@ static int CLUI_DrawMenuBackGround(HWND hwnd, HDC hdc, int item, int state) FillRect(hdc, &r1, GetSysColorBrush(COLOR_MENU)); ske_SetRectOpaque(hdc, &r1); - if ( !g_CluiData.fDisableSkinEngine) + if (!g_CluiData.fDisableSkinEngine) SkinDrawGlyph(hdc,&r1,&r1,"Main,ID=MenuBar"); else { HBRUSH hbr = NULL; @@ -1339,7 +1339,7 @@ int CLUI_TestCursorOnBorders() hAux = WindowFromPoint(pt); if (CLUI_CheckOwnedByClui(hAux)) { if (g_bTransparentFlag) { - if ( !bTransparentFocus && gf != hwnd) { + if (!bTransparentFocus && gf != hwnd) { CLUI_SmoothAlphaTransition(hwnd, db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), 1); bTransparentFocus = 1; CLUI_SafeSetTimer(hwnd, TM_AUTOALPHA,250, NULL); @@ -1381,7 +1381,7 @@ int CLUI_TestCursorOnBorders() else if (pt.y >= r.top && pt.y <= r.top+SIZING_MARGIN && !g_CluiData.fAutoSize) k = 3; if (pt.x <= r.right && pt.x >= r.right-SIZING_MARGIN && g_CluiData.bBehindEdgeSettings != 2) k += 2; else if (pt.x >= r.left && pt.x <= r.left+SIZING_MARGIN && g_CluiData.bBehindEdgeSettings != 1) k += 1; - if ( !(pt.x >= r.left && pt.x <= r.right && pt.y >= r.top && pt.y <= r.bottom)) k = 0; + if (!(pt.x >= r.left && pt.x <= r.right && pt.y >= r.top && pt.y <= r.bottom)) k = 0; k *= mouse_in_window; hCurs1 = LoadCursor(NULL, IDC_ARROW); if (g_CluiData.nBehindEdgeState <= 0 && (!( db_get_b(NULL,"CLUI","LockSize",SETTING_LOCKSIZE_DEFAULT)))) @@ -1389,13 +1389,13 @@ int CLUI_TestCursorOnBorders() { case 1: case 2: - if ( !g_CluiData.fDocked || (g_CluiData.fDocked == 2 && k == 1) || (g_CluiData.fDocked == 1 && k == 2)){hCurs1 = LoadCursor(NULL, IDC_SIZEWE); break;} - case 3: if ( !g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENS); break;} - case 4: if ( !g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENWSE); break;} - case 5: if ( !g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENESW); break;} - case 6: if ( !g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENS); break;} - case 7: if ( !g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENESW); break;} - case 8: if ( !g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENWSE); break;} + if (!g_CluiData.fDocked || (g_CluiData.fDocked == 2 && k == 1) || (g_CluiData.fDocked == 1 && k == 2)){hCurs1 = LoadCursor(NULL, IDC_SIZEWE); break;} + case 3: if (!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENS); break;} + case 4: if (!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENWSE); break;} + case 5: if (!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENESW); break;} + case 6: if (!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENS); break;} + case 7: if (!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENESW); break;} + case 8: if (!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENWSE); break;} } if (hCurs1) SetCursor(hCurs1); return k; @@ -1406,7 +1406,7 @@ int CLUI_TestCursorOnBorders() int CLUI_SizingOnBorder(POINT pt, int PerformSize) { - if ( !( db_get_b(NULL,"CLUI","LockSize",SETTING_LOCKSIZE_DEFAULT))) + if (!( db_get_b(NULL,"CLUI","LockSize",SETTING_LOCKSIZE_DEFAULT))) { RECT r; HWND hwnd = pcli->hwndContactList; @@ -1426,7 +1426,7 @@ int CLUI_SizingOnBorder(POINT pt, int PerformSize) /* * End of size borders offset (contract) */ - if ( !g_CluiData.fAutoSize ) + if (!g_CluiData.fAutoSize ) { if ( pt.y <= r.bottom && pt.y >= r.bottom - SIZING_MARGIN ) sizeOnBorderFlag = SCF_BOTTOM; else if ( pt.y >= r.top && pt.y <= r.top + SIZING_MARGIN ) sizeOnBorderFlag = SCF_TOP; @@ -1435,7 +1435,7 @@ int CLUI_SizingOnBorder(POINT pt, int PerformSize) if ( pt.x <= r.right && pt.x >= r.right - SIZING_MARGIN ) sizeOnBorderFlag += SCF_RIGHT; else if ( pt.x >= r.left && pt.x <= r.left + SIZING_MARGIN ) sizeOnBorderFlag += SCF_LEFT; - if ( !(pt.x >= r.left && pt.x <= r.right && pt.y >= r.top && pt.y <= r.bottom)) sizeOnBorderFlag = SCF_NONE; + if (!(pt.x >= r.left && pt.x <= r.right && pt.y >= r.top && pt.y <= r.bottom)) sizeOnBorderFlag = SCF_NONE; if (sizeOnBorderFlag && PerformSize) { @@ -1459,7 +1459,7 @@ static void CLUI_SmoothAnimationThreadProc(void *param) if (mutex_bAnimationInProgress) { do { - if ( !g_mutex_bLockUpdating) { + if (!g_mutex_bLockUpdating) { if ( MirandaExiting()) return; @@ -1494,7 +1494,7 @@ static int CLUI_SmoothAlphaThreadTransition(HWND hwnd) Sync(CLUIFrames_OnShowHide, hwnd,0); mutex_bShowHideCalledFromAnimation = 0; g_CluiData.bCurrentAlpha = 0; - if ( !g_CluiData.fLayered) RedrawWindow(pcli->hwndContactList,NULL,NULL,RDW_ERASE|RDW_FRAME); + if (!g_CluiData.fLayered) RedrawWindow(pcli->hwndContactList,NULL,NULL,RDW_ERASE|RDW_FRAME); return 0; } } @@ -1511,7 +1511,7 @@ int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam) { if (GoalAlpha>0 && wParam != 2) { - if ( !IsWindowVisible(hwnd)) + if (!IsWindowVisible(hwnd)) { mutex_bShowHideCalledFromAnimation = 1; CLUI_ShowWindowMod(pcli->hwndContactList,SW_RESTORE); @@ -1541,7 +1541,7 @@ int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam) if (wParam != 2) { //not from timer bAlphaEnd = GoalAlpha; - if ( !mutex_bAnimationInProgress) { + if (!mutex_bAnimationInProgress) { if ((!IsWindowVisible(hwnd) || g_CluiData.bCurrentAlpha == 0) && bAlphaEnd > 0) { mutex_bShowHideCalledFromAnimation = 1; CLUI_ShowWindowMod(pcli->hwndContactList,SW_SHOWNA); @@ -1624,7 +1624,7 @@ HANDLE RegisterIcolibIconHandle(char *szIcoID, char *szSectionName, char *szDes if (tszDefaultFile) { PathToAbsoluteT(tszDefaultFile, fileFull); - if ( !FileExists(fileFull)) + if (!FileExists(fileFull)) fileFull[0] = _T('\0'); } @@ -1726,7 +1726,7 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam) if ((rcOldWindowRect.bottom-rcOldWindowRect.top != wp->cy || rcOldWindowRect.right-rcOldWindowRect.left != wp->cx) && !(wp->flags&SWP_NOSIZE)) { { - if ( !(wp->flags&SWP_NOMOVE)) + if (!(wp->flags&SWP_NOMOVE)) { rcNewWindowRect.left = wp->x; rcNewWindowRect.top = wp->y; @@ -1815,8 +1815,8 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam) GetWindowRect(m_hWnd, &rc); CheckFramesPos(&rc); Sync(CLUIFrames_OnMoving,m_hWnd,&rc); - if ( !IsIconic(m_hWnd)) { - if ( !CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) + if (!IsIconic(m_hWnd)) { + if (!CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) { //if g_CluiData.fDocked, dont remember pos (except for width) db_set_dw(NULL,"CList","Height",(DWORD)(rc.bottom - rc.top)); db_set_dw(NULL,"CList","x",(DWORD)rc.left); @@ -1835,7 +1835,7 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam) if ( pcli->hwndContactList == NULL ) return 0; - if ( !g_CluiData.fLayered && !g_CluiData.fDisableSkinEngine) + if (!g_CluiData.fLayered && !g_CluiData.fDisableSkinEngine) ske_ReCreateBackImage(TRUE,NULL); GetWindowRect(m_hWnd, &rc); @@ -1845,7 +1845,7 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam) if (g_CluiData.fLayered) CallService(MS_SKINENG_UPTATEFRAMEIMAGE,(WPARAM)m_hWnd,0); - if ( !g_CluiData.fLayered) + if (!g_CluiData.fLayered) { g_mutex_bSizing = 1; Sync(CLUIFrames_OnClistResize_mod,(WPARAM)m_hWnd,(LPARAM)1); @@ -1856,7 +1856,7 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam) } // ske_RedrawCompleteWindow(); - if ( !CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) + if (!CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) { //if g_CluiData.fDocked, dont remember pos (except for width) db_set_dw(NULL,"CList","Height",(DWORD)(rc.bottom - rc.top)); db_set_dw(NULL,"CList","x",(DWORD)rc.left); @@ -1865,7 +1865,7 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam) else SetWindowRgn(m_hWnd,NULL,0); db_set_dw(NULL,"CList","Width",(DWORD)(rc.right - rc.left)); - if ( !g_CluiData.fLayered) + if (!g_CluiData.fLayered) { HRGN hRgn1; RECT r; @@ -1932,7 +1932,7 @@ LRESULT CLUI::OnUpdate(UINT /*msg*/, WPARAM /*wParam*/, LPARAM /*lParam*/ ) LRESULT CLUI::OnInitMenu(UINT /*msg*/, WPARAM /*wParam*/, LPARAM /*lParam*/ ) { - if ( !CLUI::IsMainMenuInited()) { + if (!CLUI::IsMainMenuInited()) { if ( ServiceExists( MS_CLIST_MENUBUILDMAIN )) CallService(MS_CLIST_MENUBUILDMAIN, 0, 0 ); CLUI::m_fMainMenuInited = TRUE; @@ -1943,10 +1943,10 @@ LRESULT CLUI::OnInitMenu(UINT /*msg*/, WPARAM /*wParam*/, LPARAM /*lParam*/ ) LRESULT CLUI::OnNcPaint(UINT msg, WPARAM wParam, LPARAM lParam) { int lRes = DefWindowProc( m_hWnd, msg, wParam, lParam); - if ( !g_CluiData.fLayered && db_get_b( NULL,"CLUI","ShowMainMenu",SETTING_SHOWMAINMENU_DEFAULT )) { + if (!g_CluiData.fLayered && db_get_b( NULL,"CLUI","ShowMainMenu",SETTING_SHOWMAINMENU_DEFAULT )) { HDC hdc = NULL; if ( msg == WM_PRINT ) hdc = (HDC)wParam; - if ( !hdc ) hdc = GetWindowDC( m_hWnd ); + if (!hdc ) hdc = GetWindowDC( m_hWnd ); CLUI_DrawMenuBackGround( m_hWnd, hdc, 0, 0 ); if ( msg != WM_PRINT ) ReleaseDC( m_hWnd, hdc ); } @@ -1966,16 +1966,16 @@ LRESULT CLUI::OnNcCreate(UINT msg, WPARAM wParam, LPARAM lParam) LRESULT CLUI::OnPaint(UINT msg, WPARAM wParam, LPARAM lParam) { - if ( !g_CluiData.fLayered && IsWindowVisible(m_hWnd)) { + if (!g_CluiData.fLayered && IsWindowVisible(m_hWnd)) { RECT w = {0}; RECT w2 = {0}; PAINTSTRUCT ps = {0}; GetClientRect(m_hWnd,&w); - if ( !(w.right > 0 && w.bottom > 0)) + if (!(w.right > 0 && w.bottom > 0)) return DefWindowProc(m_hWnd, msg, wParam, lParam); - if ( !g_CluiData.fDisableSkinEngine) { + if (!g_CluiData.fDisableSkinEngine) { HDC paintDC = GetDC(m_hWnd); w2 = w; HDC hdc = CreateCompatibleDC(paintDC); @@ -2096,7 +2096,7 @@ LRESULT CLUI::OnParentNotify(UINT msg, WPARAM wParam, LPARAM lParam) LRESULT CLUI::OnSetFocus(UINT msg, WPARAM wParam, LPARAM lParam) { - if ( hFrameContactTree && ( !CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM( FO_FLOATING, hFrameContactTree ), 0 ))) + if ( hFrameContactTree && (!CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM( FO_FLOATING, hFrameContactTree ), 0 ))) SetFocus(pcli->hwndContactTree); return FALSE; @@ -2115,7 +2115,7 @@ LRESULT CLUI::OnStatusBarUpdateTimer(UINT msg, WPARAM wParam, LPARAM lParam) else status = CallProtoService(pt->szProto,PS_GETSTATUS, 0, 0); - if ( !(status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)) { + if (!(status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)) { pt->nCycleStartTick = 0; ImageList_Destroy(pt->himlIconList); pt->himlIconList = NULL; @@ -2151,7 +2151,7 @@ LRESULT CLUI::OnAutoAlphaTimer(UINT msg, WPARAM wParam, LPARAM lParam) HWND hwndPt = WindowFromPoint(pt); inwnd = CLUI_CheckOwnedByClui(hwndPt); - if ( ! inwnd ) + if (! inwnd ) inwnd = ( GetCapture() == pcli->hwndContactList ); } @@ -2164,7 +2164,7 @@ LRESULT CLUI::OnAutoAlphaTimer(UINT msg, WPARAM wParam, LPARAM lParam) else CLUI_SmoothAlphaTransition(m_hWnd, (BYTE)(g_bTransparentFlag ? db_get_b(NULL,"CList","AutoAlpha",SETTING_AUTOALPHA_DEFAULT) : 255), 1); } - if ( !bTransparentFocus) + if (!bTransparentFocus) KillTimer(m_hWnd,TM_AUTOALPHA); return TRUE; } @@ -2194,7 +2194,7 @@ LRESULT CLUI::OnBringOutTimer(UINT msg, WPARAM wParam, LPARAM lParam) POINT pt; GetCursorPos(&pt); HWND hAux = WindowFromPoint(pt); BOOL mouse_in_window = CLUI_CheckOwnedByClui(hAux); - if ( !mouse_in_window && GetForegroundWindow() != m_hWnd ) + if (!mouse_in_window && GetForegroundWindow() != m_hWnd ) CLUI_HideBehindEdge(); return TRUE; } @@ -2256,13 +2256,13 @@ LRESULT CLUI::OnActivate(UINT msg, WPARAM wParam, LPARAM lParam) if ( db_get_b(NULL, "ModernData", "HideBehind", SETTING_HIDEBEHIND_DEFAULT)) { if (wParam == WA_INACTIVE && ((HWND)lParam != m_hWnd) && GetParent((HWND)lParam) != m_hWnd) { - if ( !g_bCalledFromShowHide) CLUI_UpdateTimer(0); + if (!g_bCalledFromShowHide) CLUI_UpdateTimer(0); } - else if ( !g_bCalledFromShowHide ) + else if (!g_bCalledFromShowHide ) CLUI_ShowFromBehindEdge(); } - if ( !IsWindowVisible(m_hWnd) || mutex_bShowHideCalledFromAnimation) { + if (!IsWindowVisible(m_hWnd) || mutex_bShowHideCalledFromAnimation) { KillTimer(m_hWnd,TM_AUTOALPHA); return 0; } @@ -2272,7 +2272,7 @@ LRESULT CLUI::OnActivate(UINT msg, WPARAM wParam, LPARAM lParam) CLUI_SafeSetTimer(m_hWnd, TM_AUTOALPHA,250, NULL); } else { - if ( !db_get_b(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT)) + if (!db_get_b(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT)) Sync(CLUIFrames_ActivateSubContainers,TRUE); if (g_bTransparentFlag) { KillTimer(m_hWnd,TM_AUTOALPHA); @@ -2298,7 +2298,7 @@ LRESULT CLUI::OnSetCursor(UINT msg, WPARAM wParam, LPARAM lParam) HWND gf = GetForegroundWindow(); if (g_CluiData.nBehindEdgeState >= 0) CLUI_UpdateTimer(1); if (g_bTransparentFlag) { - if ( !bTransparentFocus && gf != m_hWnd) + if (!bTransparentFocus && gf != m_hWnd) { CLUI_SmoothAlphaTransition(m_hWnd, db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), 1); bTransparentFocus = 1; @@ -2361,7 +2361,7 @@ LRESULT CLUI::OnNcHitTest(UINT msg, WPARAM wParam, LPARAM lParam) if (result == HTCLIENT) { POINT pt = UNPACK_POINT(lParam); int k = CLUI_SizingOnBorder(pt, 0); - if ( !k && ( db_get_b(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT))) + if (!k && ( db_get_b(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT))) return HTCAPTION; else return k+9; } @@ -2439,7 +2439,7 @@ LRESULT CLUI::OnListSizeChangeNotify( NMCLISTCONTROL * pnmc ) rcWindow = rcSizingRect; else GetWindowRect(m_hWnd,&rcWindow); - if ( !g_CluiData.fAutoSize || pcli->hwndContactTree == 0 || CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) + if (!g_CluiData.fAutoSize || pcli->hwndContactTree == 0 || CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) return FALSE; maxHeight = db_get_b(NULL,"CLUI","MaxSizeHeight",SETTING_MAXSIZEHEIGHT_DEFAULT); @@ -2496,7 +2496,7 @@ LRESULT CLUI::OnListSizeChangeNotify( NMCLISTCONTROL * pnmc ) { bNeedFixSizingRect = 0; } - if ( !mutex_bDuringSizing) + if (!mutex_bDuringSizing) SetWindowPos(m_hWnd, 0, rcWindow.left,rcWindow.top,rcWindow.right-rcWindow.left,rcWindow.bottom-rcWindow.top,SWP_NOZORDER|SWP_NOACTIVATE); else { @@ -2555,7 +2555,7 @@ LRESULT CLUI::OnContextMenu(UINT msg, WPARAM wParam, LPARAM lParam) // all this is done in screen-coords! GetCursorPos(&pt); // the mouse isnt near the window, so put it in the middle of the window - if ( !PtInRect(&rc,pt)) { + if (!PtInRect(&rc,pt)) { pt.x = rc.left + (rc.right - rc.left) / 2; pt.y = rc.top + (rc.bottom - rc.top) / 2; } @@ -2598,7 +2598,7 @@ LRESULT CLUI::OnDrawItem(UINT msg, WPARAM wParam, LPARAM lParam) return 0; if (dis->itemData == MENU_MIRANDAMENU) { - if ( !g_CluiData.fLayered) { + if (!g_CluiData.fLayered) { char buf[255]; short offset = 1 + ( dis->itemState&ODS_SELECTED ? 1 : 0 ) - ( dis->itemState&ODS_HOTLIGHT ? 1 : 0 ); @@ -2625,7 +2625,7 @@ LRESULT CLUI::OnDrawItem(UINT msg, WPARAM wParam, LPARAM lParam) } if (dis->itemData == MENU_STATUSMENU) { - if ( !g_CluiData.fLayered) { + if (!g_CluiData.fLayered) { char buf[255] = {0}; RECT rc = dis->rcItem; short dx = 1+(dis->itemState&ODS_SELECTED?1:0)-(dis->itemState&ODS_HOTLIGHT?1:0); diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp index eccb4e0bab..b1e297d58b 100644 --- a/plugins/Clist_modern/src/modern_contact.cpp +++ b/plugins/Clist_modern/src/modern_contact.cpp @@ -86,7 +86,7 @@ int GetProtoIndex(char * szName) ProtoEnumAccounts( &accCount, &accs ); for (int i=0; i < accCount; i++) - if ( !mir_strcmpi(szName, accs[i]->szModuleName)) + if (!mir_strcmpi(szName, accs[i]->szModuleName)) return accs[i]->iOrder; } @@ -187,7 +187,7 @@ INT_PTR SetUseGroups(WPARAM wParam, LPARAM lParam) int newVal = !(GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_USEGROUPS); if ( wParam != -1 ) { - if ( !newVal == wParam ) return 0; + if (!newVal == wParam ) return 0; newVal = wParam; } db_set_b(NULL,"CList","UseGroups",(BYTE)newVal); diff --git a/plugins/Clist_modern/src/modern_docking.cpp b/plugins/Clist_modern/src/modern_docking.cpp index 85dfc20632..6b02a383d7 100644 --- a/plugins/Clist_modern/src/modern_docking.cpp +++ b/plugins/Clist_modern/src/modern_docking.cpp @@ -108,7 +108,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam) if (msg->message == WM_DESTROY) db_set_b(NULL,"CList","Docked",(BYTE)g_CluiData.fDocked); - if ( !g_CluiData.fDocked && msg->message != WM_CREATE && msg->message != WM_MOVING && msg->message != WM_CREATEDOCKED && msg->message != WM_MOVE && msg->message != WM_SIZE) return 0; + if (!g_CluiData.fDocked && msg->message != WM_CREATE && msg->message != WM_MOVING && msg->message != WM_CREATEDOCKED && msg->message != WM_MOVE && msg->message != WM_SIZE) return 0; switch(msg->message) { case WM_CREATE: //if (GetSystemMetrics(SM_CMONITORS)>1) return 0; @@ -298,7 +298,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam) return TRUE; case WM_MOUSEMOVE: - if ( !draggingTitle) return 0; + if (!draggingTitle) return 0; { RECT rc; POINT pt; GetClientRect(msg->hwnd,&rc); diff --git a/plugins/Clist_modern/src/modern_gdiplus.cpp b/plugins/Clist_modern/src/modern_gdiplus.cpp index f4241b4778..c406c9383e 100644 --- a/plugins/Clist_modern/src/modern_gdiplus.cpp +++ b/plugins/Clist_modern/src/modern_gdiplus.cpp @@ -76,13 +76,13 @@ void DrawAvatarImageWithGDIp(HDC hDestDC,int x, int y, DWORD width, DWORD height Graphics g(hDestDC); if (bmp.bmBitsPixel == 32 && (flag&AVS_PREMULTIPLIED)) { bmbits = (BYTE*)bmp.bmBits; - if ( !bmbits) { + if (!bmbits) { bmbits = (BYTE*)malloc(bmp.bmHeight*bmp.bmWidthBytes); GetBitmapBits(hbmp,bmp.bmHeight*bmp.bmWidthBytes,bmbits); } bm = new Bitmap(bmp.bmWidth,bmp.bmHeight,bmp.bmWidthBytes,PixelFormat32bppPARGB,bmbits); bm->RotateFlip(RotateNoneFlipY); - if ( !bmp.bmBits) { + if (!bmp.bmBits) { bm->RotateFlip(RotateNoneFlipY); free(bmbits); } diff --git a/plugins/Clist_modern/src/modern_gettextasync.cpp b/plugins/Clist_modern/src/modern_gettextasync.cpp index bc1f732520..45dad063b6 100644 --- a/plugins/Clist_modern/src/modern_gettextasync.cpp +++ b/plugins/Clist_modern/src/modern_gettextasync.cpp @@ -56,7 +56,7 @@ static HANDLE hgtaWakeupEvent = NULL; static BOOL gtaGetItem(GTACHAINITEM * mpChain) { gtalock; - if ( !gtaFirstItem) + if (!gtaFirstItem) { gtaunlock; return FALSE; @@ -67,7 +67,7 @@ static BOOL gtaGetItem(GTACHAINITEM * mpChain) ch = gtaFirstItem; *mpChain = *ch; gtaFirstItem = (GTACHAINITEM *)ch->Next; - if ( !gtaFirstItem) gtaLastItem = NULL; + if (!gtaFirstItem) gtaLastItem = NULL; free(ch); gtaunlock; return TRUE; @@ -92,7 +92,7 @@ static void gtaThreadProc(void *lpParam) GTACHAINITEM mpChain = {0}; struct SHORTDATA dat2 = {0}; - if ( !gtaGetItem(&mpChain)) + if (!gtaGetItem(&mpChain)) break; SHORTDATA *dat; @@ -108,7 +108,7 @@ static void gtaThreadProc(void *lpParam) ClcCacheEntry cacheEntry; memset(&cacheEntry, 0, sizeof(cacheEntry)); cacheEntry.hContact = mpChain.hContact; - if ( !Sync(CLUI_SyncGetPDNCE, (WPARAM) 0, (LPARAM)&cacheEntry)) { + if (!Sync(CLUI_SyncGetPDNCE, (WPARAM) 0, (LPARAM)&cacheEntry)) { Cache_GetSecondLineText(dat, &cacheEntry); Cache_GetThirdLineText(dat, &cacheEntry); Sync(CLUI_SyncSetPDNCE, (WPARAM) CCI_LINES,(LPARAM)&cacheEntry); diff --git a/plugins/Clist_modern/src/modern_image_array.cpp b/plugins/Clist_modern/src/modern_image_array.cpp index 221c61813f..5854bcdf0b 100644 --- a/plugins/Clist_modern/src/modern_image_array.cpp +++ b/plugins/Clist_modern/src/modern_image_array.cpp @@ -214,7 +214,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) } // Get bounds - if ( !GetObject(hBmp,sizeof(BITMAP),&bm)) + if (!GetObject(hBmp,sizeof(BITMAP),&bm)) { LeaveCriticalSection(&iad->cs); return -1; @@ -240,7 +240,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) } // Alloc array - if ( !ImageArray_Alloc(iad, iad->nodes_size + 1)) + if (!ImageArray_Alloc(iad, iad->nodes_size + 1)) { DeleteObject(hNewBmp); LeaveCriticalSection(&iad->cs); @@ -306,7 +306,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) BitBlt(iad->hdc, x, y, bm.bmWidth, bm.bmHeight, hdc_old, 0, 0, SRCCOPY); // 3- old data - if ( !last_one) + if (!last_one) { int ox, oy; @@ -345,7 +345,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) iad->img = hNewBmp; // Move array - if ( !last_one && iad->nodes_size > 1) + if (!last_one && iad->nodes_size > 1) { memmove(&iad->nodes[pos+1], &iad->nodes[pos], (iad->nodes_size - pos) * sizeof(IMAGE_ARRAY_DATA_NODE)); } @@ -384,7 +384,7 @@ BOOL ImageArray_ChangeImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) EnterCriticalSection(&iad->cs); // Get bounds - if ( !GetObject(hBmp,sizeof(BITMAP),&bm)) + if (!GetObject(hBmp,sizeof(BITMAP),&bm)) { LeaveCriticalSection(&iad->cs); return FALSE; diff --git a/plugins/Clist_modern/src/modern_newrowopts.cpp b/plugins/Clist_modern/src/modern_newrowopts.cpp index adf97e27d8..4e44190c77 100644 --- a/plugins/Clist_modern/src/modern_newrowopts.cpp +++ b/plugins/Clist_modern/src/modern_newrowopts.cpp @@ -52,7 +52,7 @@ NodeList * RootNode = NULL; NodeList * AddNode(NodeList * Parent) { NodeList * res; - if ( !Parent) + if (!Parent) { res = (NodeList *)mir_alloc(sizeof(NodeList)); memset(res, 0, sizeof(NodeList)); @@ -68,7 +68,7 @@ NodeList * AddNode(NodeList * Parent) BOOL RemoveChildNode(NodeList * FromList, DWORD index) { - if ( !FromList) return FALSE; + if (!FromList) return FALSE; if (FromList->AllocatedChilds <= index) return FALSE; NodeList *work = &(FromList->childNodes[index]); for (size_t i=0; i < work->AllocatedChilds; i++) @@ -86,7 +86,7 @@ BOOL RemoveChildNode(NodeList * FromList, DWORD index) BOOL RemoveNode(NodeList * FromList) { - if ( !FromList) return FALSE; + if (!FromList) return FALSE; if (FromList->itemParent) { DWORD k; @@ -117,7 +117,7 @@ void PrintIdent() void TraceTreeLevel(NodeList * node) { DWORD i; - if ( !node) return; + if (!node) return; PrintIdent(); { char buf[255]; diff --git a/plugins/Clist_modern/src/modern_popup.cpp b/plugins/Clist_modern/src/modern_popup.cpp index 8e2f0e0645..30b554ed00 100644 --- a/plugins/Clist_modern/src/modern_popup.cpp +++ b/plugins/Clist_modern/src/modern_popup.cpp @@ -50,7 +50,7 @@ void ShowTracePopup(const char *text) // Show an popup void ShowPopup(const char *title, const char *description, int type) { - if ( !ServiceExists(MS_POPUP_ADDPOPUP) || !EnablePopups) + if (!ServiceExists(MS_POPUP_ADDPOPUP) || !EnablePopups) return; // Make popup diff --git a/plugins/Clist_modern/src/modern_row.cpp b/plugins/Clist_modern/src/modern_row.cpp index 057b17b6c5..4916f60d3f 100644 --- a/plugins/Clist_modern/src/modern_row.cpp +++ b/plugins/Clist_modern/src/modern_row.cpp @@ -66,7 +66,7 @@ ROWCELL *cppInitModernRow(ROWCELL ** tabAccess) ROWCELL * RowRoot = NULL; FILE * hFile; int i=0; - if ( !db_get_b(NULL,"ModernData","UseAdvancedRowLayout",SETTING_ROW_ADVANCEDLAYOUT_DEFAULT)) return NULL; + if (!db_get_b(NULL,"ModernData","UseAdvancedRowLayout",SETTING_ROW_ADVANCEDLAYOUT_DEFAULT)) return NULL; tmplbuf = NULL; if ( db_get_b(NULL,"ModernData","UseAdvancedRowLayout",SETTING_ROW_ADVANCEDLAYOUT_DEFAULT) == 1) tmplbuf = db_get_sa(NULL,"ModernData","RowTemplate"); @@ -137,7 +137,7 @@ const ROWCELL * rowAddCell(ROWCELL* &link, int cont) // void rowDeleteTree(ROWCELL* cell) { - if ( !cell) return; + if (!cell) return; if (cell->child) rowDeleteTree((ROWCELL*)(cell->child)); if (cell->next) @@ -179,7 +179,7 @@ char * rowParserGetNextWord(char *tbuf, int &hbuf) } // Tag-bracers found - if ( !(ch == '>' && j < 0)) //not single '>' found + if (!(ch == '>' && j < 0)) //not single '>' found { if ((ch == '<' || ch == '>') && j >= 0) { @@ -221,36 +221,36 @@ void rowParserGetParam(ROWCELL* &cell, char *tbuf, int &hbuf) char * word = rowParserGetNextWord(tbuf, hbuf); int param = 0; - if ( !_strnicmp(word, "avatar", strlen(word))) param = TC_AVATAR; - else if ( !_strnicmp(word, "text1", strlen(word))) param = TC_TEXT1; - else if ( !_strnicmp(word, "text2", strlen(word))) param = TC_TEXT2; - else if ( !_strnicmp(word, "text3", strlen(word))) param = TC_TEXT3; - else if ( !_strnicmp(word, "status", strlen(word))) param = TC_STATUS; - else if ( !_strnicmp(word, "extra", strlen(word))) param = TC_EXTRA; - else if ( !_strnicmp(word, "extra1", strlen(word))) param = TC_EXTRA1; - else if ( !_strnicmp(word, "extra2", strlen(word))) param = TC_EXTRA2; - else if ( !_strnicmp(word, "extra3", strlen(word))) param = TC_EXTRA3; - else if ( !_strnicmp(word, "extra4", strlen(word))) param = TC_EXTRA4; - else if ( !_strnicmp(word, "extra5", strlen(word))) param = TC_EXTRA5; - else if ( !_strnicmp(word, "extra6", strlen(word))) param = TC_EXTRA6; - else if ( !_strnicmp(word, "extra7", strlen(word))) param = TC_EXTRA7; - else if ( !_strnicmp(word, "extra8", strlen(word))) param = TC_EXTRA8; - else if ( !_strnicmp(word, "extra9", strlen(word))) param = TC_EXTRA9; - else if ( !_strnicmp(word, "time", strlen(word))) param = TC_TIME; - else if ( !_strnicmp(word, "space", strlen(word))) param = TC_SPACE; - else if ( !_strnicmp(word, "fspace", strlen(word))) param = TC_FIXED; - - else if ( !_strnicmp(word, "left", strlen(word))) param = TC_LEFT; - else if ( !_strnicmp(word, "top", strlen(word))) param = TC_TOP; - else if ( !_strnicmp(word, "vcenter", strlen(word))) param = TC_VCENTER; - else if ( !_strnicmp(word, "hcenter", strlen(word))) param = TC_HCENTER; - else if ( !_strnicmp(word, "right", strlen(word))) param = TC_RIGHT; - else if ( !_strnicmp(word, "bottom", strlen(word))) param = TC_BOTTOM; - - else if ( !_strnicmp(word, "layer", strlen(word))) cell->layer = TRUE; - - else if ( !_strnicmp(word, "width", strlen(word))) param = TC_WIDTH; - else if ( !_strnicmp(word, "height", strlen(word))) param = TC_HEIGHT; + if (!_strnicmp(word, "avatar", strlen(word))) param = TC_AVATAR; + else if (!_strnicmp(word, "text1", strlen(word))) param = TC_TEXT1; + else if (!_strnicmp(word, "text2", strlen(word))) param = TC_TEXT2; + else if (!_strnicmp(word, "text3", strlen(word))) param = TC_TEXT3; + else if (!_strnicmp(word, "status", strlen(word))) param = TC_STATUS; + else if (!_strnicmp(word, "extra", strlen(word))) param = TC_EXTRA; + else if (!_strnicmp(word, "extra1", strlen(word))) param = TC_EXTRA1; + else if (!_strnicmp(word, "extra2", strlen(word))) param = TC_EXTRA2; + else if (!_strnicmp(word, "extra3", strlen(word))) param = TC_EXTRA3; + else if (!_strnicmp(word, "extra4", strlen(word))) param = TC_EXTRA4; + else if (!_strnicmp(word, "extra5", strlen(word))) param = TC_EXTRA5; + else if (!_strnicmp(word, "extra6", strlen(word))) param = TC_EXTRA6; + else if (!_strnicmp(word, "extra7", strlen(word))) param = TC_EXTRA7; + else if (!_strnicmp(word, "extra8", strlen(word))) param = TC_EXTRA8; + else if (!_strnicmp(word, "extra9", strlen(word))) param = TC_EXTRA9; + else if (!_strnicmp(word, "time", strlen(word))) param = TC_TIME; + else if (!_strnicmp(word, "space", strlen(word))) param = TC_SPACE; + else if (!_strnicmp(word, "fspace", strlen(word))) param = TC_FIXED; + + else if (!_strnicmp(word, "left", strlen(word))) param = TC_LEFT; + else if (!_strnicmp(word, "top", strlen(word))) param = TC_TOP; + else if (!_strnicmp(word, "vcenter", strlen(word))) param = TC_VCENTER; + else if (!_strnicmp(word, "hcenter", strlen(word))) param = TC_HCENTER; + else if (!_strnicmp(word, "right", strlen(word))) param = TC_RIGHT; + else if (!_strnicmp(word, "bottom", strlen(word))) param = TC_BOTTOM; + + else if (!_strnicmp(word, "layer", strlen(word))) cell->layer = TRUE; + + else if (!_strnicmp(word, "width", strlen(word))) param = TC_WIDTH; + else if (!_strnicmp(word, "height", strlen(word))) param = TC_HEIGHT; else { @@ -326,8 +326,8 @@ BOOL rowParse(ROWCELL* &cell, ROWCELL* parent, char *tbuf, int &hbuf, int &seque int cont; if (!_strnicmp(word, "", strlen(word))) cont = TC_ROW; - else if ( !_strnicmp(word, "", strlen(word))) cont = TC_COL; - else if ( !_strnicmp(word, "/>", strlen(word)) || + else if (!_strnicmp(word, "", strlen(word))) cont = TC_COL; + else if (!_strnicmp(word, "/>", strlen(word)) || !_strnicmp(word, "", strlen(word)) || !_strnicmp(word, "", strlen(word))) return TRUE; else return FALSE; @@ -337,16 +337,16 @@ BOOL rowParse(ROWCELL* &cell, ROWCELL* parent, char *tbuf, int &hbuf, int &seque if (cell->type != 0 && cell->type != TC_SPACE && cell->type != TC_FIXED) RowTabAccess[sequence++] = cell; - if ( !rowParse(cell->child, cell, tbuf, hbuf, sequence,RowTabAccess)) + if (!rowParse(cell->child, cell, tbuf, hbuf, sequence,RowTabAccess)) return FALSE; - if ( !parent) + if (!parent) { RowTabAccess[sequence] = NULL; return TRUE; } - if ( !rowParse(cell->next, parent, tbuf, hbuf, sequence,RowTabAccess)) + if (!rowParse(cell->next, parent, tbuf, hbuf, sequence,RowTabAccess)) return FALSE; parent->sizing |= cell->sizing; @@ -356,7 +356,7 @@ BOOL rowParse(ROWCELL* &cell, ROWCELL* parent, char *tbuf, int &hbuf, int &seque void rowResetEmptyRects(ROWCELL* cell) { - if ( !cell) return; + if (!cell) return; if (cell->type == 0) { SetRect(&(cell->r), 0, 0, 0, 0); @@ -379,7 +379,7 @@ void rowCalculateMinSize(ROWCELL* cell) int w = 0, h = 0; int wl = 0, hl = 0; int fullWidth = 0; - if ( !cell) return; + if (!cell) return; cell->r.left = 0; cell->r.top = 0; @@ -394,7 +394,7 @@ void rowCalculateMinSize(ROWCELL* cell) rowCalculateMinSize(cell->child); rowCalculateMinSize(cell->next); - if ( !(curchild = cell->child)) return; + if (!(curchild = cell->child)) return; if (cell->cont == TC_ROW) { @@ -451,11 +451,11 @@ void rowCalculateMinSize(ROWCELL* cell) void rowEqualize(ROWCELL* cell) { ROWCELL* curchild = NULL; - if ( !cell) return; + if (!cell) return; rowEqualize(cell->child); rowEqualize(cell->next); - if ( !(curchild = cell->child)) return; + if (!(curchild = cell->child)) return; if (cell->cont == TC_ROW) { @@ -599,7 +599,7 @@ void rowPositioning(pROWCELL cell, int &dist) cell->r.right = dist; dummy = dist; - if ( !(curchild = cell->child)) + if (!(curchild = cell->child)) { rowPlacing(cell); return; @@ -677,7 +677,7 @@ void rowPositioning(pROWCELL cell, int &dist) rowPositioning(curchild, size); x += size; - if ( !curchild->sizing) + if (!curchild->sizing) size = 0; } diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp index 2cf5cd2780..66abdc832c 100644 --- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp +++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp @@ -88,10 +88,10 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i DWORD style; style = GetWindowLongPtr(hwnd,GWL_STYLE); pdnce = pcli->pfnGetCacheEntry(contact->hContact); - if ( !RowHeights_Alloc(dat, item + 1)) + if (!RowHeights_Alloc(dat, item + 1)) return -1; - if ( !pcli->hwndContactTree) + if (!pcli->hwndContactTree) return 0; if (dat->hWnd != pcli->hwndContactTree || !gl_RowRoot || contact->type == CLCIT_GROUP) { @@ -298,7 +298,7 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i if (item == -1) { TCHAR szResult[80]; - if ( !tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0)) { + if (!tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0)) { SIZE text_size = {0}; RECT rc = {0}; // Select font @@ -408,7 +408,7 @@ int RowHeights_GetMaxRowHeight(ClcData *dat, HWND hwnd) int max_height = 0, i, tmp; DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE); - if ( !dat->text_ignore_size_for_row_height) { + if (!dat->text_ignore_size_for_row_height) { // Get contact font size tmp = 0; for (i = 0; i < SIZEOF(contact_fonts); i++) @@ -449,7 +449,7 @@ int RowHeights_GetMaxRowHeight(ClcData *dat, HWND hwnd) max_height = max(max_height, dat->checkboxSize); // Icon size - if ( !dat->icon_ignore_size_for_row_height) + if (!dat->icon_ignore_size_for_row_height) max_height = max(max_height, ICON_HEIGHT); max_height += 2 * dat->row_border; @@ -507,7 +507,7 @@ void RowHeights_CalcRowHeights_Worker(ClcData *dat, HWND hwnd) line_num++; // Calc row height - if ( !gl_RowRoot) + if (!gl_RowRoot) RowHeights_GetRowHeight(dat, hwnd, Drawing, line_num); else RowHeight_CalcRowHeight(dat, hwnd, Drawing, line_num); @@ -556,28 +556,28 @@ int RowHeights_GetRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, BOOL selected = ((item == dat->selection) && (dat->hwndRenameEdit != NULL || dat->showSelAlways || dat->exStyle&CLS_EX_SHOWSELALWAYS || g_clcPainter.IsForegroundWindow(hwnd)) && contact->type != CLCIT_DIVIDER); BOOL hottrack = ((item == dat->iHotTrack) && (dat->hwndRenameEdit != NULL || dat->showSelAlways || dat->exStyle&CLS_EX_SHOWSELALWAYS || g_clcPainter.IsForegroundWindow(hwnd)) && contact->type != CLCIT_DIVIDER); BOOL minimalistic = (g_clcPainter.CheckMiniMode(dat,selected,hottrack)); - if ( !RowHeights_Alloc(dat, item + 1)) + if (!RowHeights_Alloc(dat, item + 1)) return -1; int height = 0; ClcCacheEntry *pdnce = (contact->type == CLCIT_CONTACT) ? pcli->pfnGetCacheEntry(contact->hContact) : NULL; if (dat->row_variable_height) { - if ( !dat->text_ignore_size_for_row_height) { + if (!dat->text_ignore_size_for_row_height) { tmp = dat->fontModernInfo[g_clcPainter.GetBasicFontID(contact)].fontHeight; if (dat->text_replace_smileys && dat->first_line_draw_smileys && !dat->text_resize_smileys) tmp = max(tmp, contact->ssText.iMaxSmileyHeight); height += tmp; if (pdnce) { - if ( !minimalistic && dat->second_line_show && pdnce->szSecondLineText && pdnce->szSecondLineText[0]) { + if (!minimalistic && dat->second_line_show && pdnce->szSecondLineText && pdnce->szSecondLineText[0]) { tmp = dat->fontModernInfo[FONTID_SECONDLINE].fontHeight; if (dat->text_replace_smileys && dat->second_line_draw_smileys && !dat->text_resize_smileys) tmp = max(tmp, pdnce->ssSecondLine.iMaxSmileyHeight); height += dat->second_line_top_space + tmp; } - if ( !minimalistic && dat->third_line_show && pdnce->szThirdLineText && pdnce->szThirdLineText[0]) { + if (!minimalistic && dat->third_line_show && pdnce->szThirdLineText && pdnce->szThirdLineText[0]) { tmp = dat->fontModernInfo[FONTID_THIRDLINE].fontHeight; if (dat->text_replace_smileys && dat->third_line_draw_smileys && !dat->text_resize_smileys) tmp = max(tmp, pdnce->ssThirdLine.iMaxSmileyHeight); @@ -603,7 +603,7 @@ int RowHeights_GetRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, } // Icon size - if ( !dat->icon_ignore_size_for_row_height) { + if (!dat->icon_ignore_size_for_row_height) { if (contact->type == CLCIT_GROUP || (contact->type == CLCIT_CONTACT && contact->iImage != -1 && !(dat->icon_hide_on_avatar && dat->avatars_show diff --git a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp index d6a9376d67..77e822d815 100644 --- a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp +++ b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp @@ -42,7 +42,7 @@ RECT da = {205,58,440, 130}; // Draw area void rowOptBuildTA(pROWCELL cell, pROWCELL* TA, int* i) { - if ( !cell) return; + if (!cell) return; TA[(*i)++] = cell; rowOptBuildTA(cell->child,TA, i); rowOptBuildTA(cell->next, TA, i); @@ -61,7 +61,7 @@ void rowOptShowSettings(HWND hwnd) TreeView_GetItem(GetDlgItem(hwnd, IDC_ROWTREE), &tvi); cell = (pROWCELL)tvi.lParam; - if ( !tvi.hItem) { + if (!tvi.hItem) { EnableWindow(GetDlgItem(hwnd,IDC_CONTTYPE) ,0); EnableWindow(GetDlgItem(hwnd,IDC_VALIGN),0); EnableWindow(GetDlgItem(hwnd,IDC_HALIGN) ,0); @@ -128,7 +128,7 @@ void rowOptShowSettings(HWND hwnd) void rowOptGenerateTreeView(pROWCELL cell, HTREEITEM node, HWND hwnd) { - if ( !cell) return; + if (!cell) return; TVINSERTSTRUCT tvis; tvis.hParent = node; @@ -167,7 +167,7 @@ void rowOptAddContainer(HWND htree, HTREEITEM hti) TVITEM tviparent; ROWCELL *cell = NULL; - if ( !hti) { + if (!hti) { if (TreeView_GetRoot(htree)) return; @@ -235,7 +235,7 @@ void rowOptDelContainer(HWND htree, HTREEITEM hti) HTREEITEM prnt = TreeView_GetParent(htree, hti); TVITEM tvi, tvpi; - if ( !hti) return; + if (!hti) return; // Get current tree item tvi.hItem = hti; @@ -281,7 +281,7 @@ void rowOptDelContainer(HWND htree, HTREEITEM hti) // Change icon at parent item - if ( !prnt || (prnt != prev)) return; + if (!prnt || (prnt != prev)) return; if ( TreeView_GetChild(htree, prnt)) { @@ -312,7 +312,7 @@ void RefreshTree(HWND hwndDlg,HTREEITEM hti) if (cell) { TCHAR buf[200] = {0}; - if ( !cell->child) + if (!cell->child) { if (cell->type == 0) mir_sntprintf(buf, SIZEOF(buf), TranslateT("Empty %s cell"), cell->cont == TC_COL?TranslateT("column"):TranslateT("line")); @@ -351,7 +351,7 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TranslateDialogDefault(hwndDlg); rowOptTmplStr = db_get_sa(NULL, "ModernData", "RowTemplate"); - if ( !rowOptTmplStr) + if (!rowOptTmplStr) rowOptTmplStr = mir_strdup(""); SendDlgItemMessage(hwndDlg,IDC_SPINCONTWIDTH, UDM_SETRANGE, 0, MAKELONG(999,0)); diff --git a/plugins/Clist_modern/src/modern_skinbutton.cpp b/plugins/Clist_modern/src/modern_skinbutton.cpp index b65782bc56..e0b45a2f86 100644 --- a/plugins/Clist_modern/src/modern_skinbutton.cpp +++ b/plugins/Clist_modern/src/modern_skinbutton.cpp @@ -99,9 +99,9 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc) RECT rc; HDC sdc = NULL; ModernSkinButtonCtrl* bct = (ModernSkinButtonCtrl *)GetWindowLongPtr(hwnd, GWLP_USERDATA); - if ( !bct) return 0; - if ( !IsWindowVisible(hwnd)) return 0; - if ( !whdc && !g_CluiData.fLayered) InvalidateRect(hwnd,NULL,FALSE); + if (!bct) return 0; + if (!IsWindowVisible(hwnd)) return 0; + if (!whdc && !g_CluiData.fLayered) InvalidateRect(hwnd,NULL,FALSE); if (whdc && g_CluiData.fLayered) hdc = whdc; else @@ -112,7 +112,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc) GetClientRect(hwnd,&rc); bmp = ske_CreateDIB32(rc.right,rc.bottom); oldbmp = (HBITMAP)SelectObject(hdc,bmp); - if ( !g_CluiData.fLayered) + if (!g_CluiData.fLayered) ske_BltBackImage(bct->hwnd,hdc,NULL); { MODERNMASK Request = {0}; @@ -141,7 +141,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc) case 's': { Value = db_get_sa(NULL,section,key); - if ( !Value) + if (!Value) Value = mir_strdup(bct->ValueTypeDef+1); break; } @@ -176,7 +176,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc) // DeleteObject(br); } - if ( !whdc && g_CluiData.fLayered) + if (!whdc && g_CluiData.fLayered) { RECT r; SetRect(&r,bct->Left,bct->Top,bct->Right,bct->Bottom); @@ -191,7 +191,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc) } SelectObject(hdc,oldbmp); DeleteObject(bmp); - if ( !whdc || !g_CluiData.fLayered) + if (!whdc || !g_CluiData.fLayered) { SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT)); DeleteDC(hdc); @@ -238,7 +238,7 @@ static int ModernSkinButtonToggleDBValue(char * ValueDBSection,char *ValueTypeDe switch (ValueTypeDef[0]) { case 's': Value = db_get_sa(NULL,section,key); - if ( !Value || (Value && mir_bool_strcmpi(Value,val2))) + if (!Value || (Value && mir_bool_strcmpi(Value,val2))) Value = mir_strdup(val); else Value = mir_strdup(val2); @@ -307,7 +307,7 @@ static int _CallServiceStrParams(IN char * toParce, OUT int *Return) _skipblank(param1); if (strlen(param1) == 0) param1 = NULL; } - if ( !pszService) return 0; + if (!pszService) return 0; if (strlen(pszService) == 0) { mir_free(pszService); return 0; @@ -334,7 +334,7 @@ static int _CallServiceStrParams(IN char * toParce, OUT int *Return) param1 = param2; param2 = NULL; } - if ( !ServiceExists(pszService)) + if (!ServiceExists(pszService)) { result = 0; } @@ -434,7 +434,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM break; case WM_MOUSEMOVE: - if ( !bct->hover) { + if (!bct->hover) { SetCapture(bct->hwnd); bct->hover = 1; ModernSkinButtonPaintWorker(bct->hwnd,0); @@ -455,7 +455,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM bct->CommandService = NULL; if (bct->fCallOnPress) { if (bct->CommandService) { - if ( !_CallServiceStrParams(bct->CommandService, NULL) && (bct->ValueDBSection && bct->ValueTypeDef)) + if (!_CallServiceStrParams(bct->CommandService, NULL) && (bct->ValueDBSection && bct->ValueTypeDef)) ModernSkinButtonToggleDBValue(bct->ValueDBSection,bct->ValueTypeDef); } bct->down = 0; @@ -485,9 +485,9 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM HWND SetToolTip(HWND hwnd, TCHAR * tip) { TOOLINFO ti; - if ( !tip) return 0; + if (!tip) return 0; EnterCriticalSection(&csTips); - if ( !hwndToolTips) { + if (!hwndToolTips) { // hwndToolTips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, _T(""), WS_POPUP, 0, 0, 0, 0, NULL, NULL, GetModuleHandle(NULL), NULL); hwndToolTips = CreateWindowEx(0, TOOLTIPS_CLASS, NULL, @@ -550,9 +550,9 @@ int ModernSkinButton_AddButton(HWND parent, char * TypeDef, int MinWidth, int MinHeight) { - // if ( !parent) return 0; - if ( !ModernSkinButtonModuleIsLoaded) return 0; - if ( !Buttons) + // if (!parent) return 0; + if (!ModernSkinButtonModuleIsLoaded) return 0; + if (!Buttons) Buttons = (MButton*)mir_alloc(sizeof(MButton)); else Buttons = (MButton*)mir_realloc(Buttons,sizeof(MButton)*(ButtonsCount+1)); @@ -611,11 +611,11 @@ int ModernSkinButton_AddButton(HWND parent, static int ModernSkinButtonErase(int l,int t,int r, int b) { DWORD i; - if ( !ModernSkinButtonModuleIsLoaded) return 0; - if ( !g_CluiData.fLayered) return 0; - if ( !g_pCachedWindow) return 0; - if ( !g_pCachedWindow->hImageDC || !g_pCachedWindow->hBackDC) return 0; - if ( !(l || r || t || b)) + if (!ModernSkinButtonModuleIsLoaded) return 0; + if (!g_CluiData.fLayered) return 0; + if (!g_pCachedWindow) return 0; + if (!g_pCachedWindow->hImageDC || !g_pCachedWindow->hBackDC) return 0; + if (!(l || r || t || b)) { for (i=0; i < ButtonsCount; i++) { @@ -655,7 +655,7 @@ static HWND ModernSkinButtonCreateWindow(ModernSkinButtonCtrl * bct, HWND parent int ModernSkinButtonRedrawAll(HDC hdc) { DWORD i; - if ( !ModernSkinButtonModuleIsLoaded) return 0; + if (!ModernSkinButtonModuleIsLoaded) return 0; g_mutex_bLockUpdating++; for (i=0; i < ButtonsCount; i++) { @@ -669,7 +669,7 @@ int ModernSkinButtonRedrawAll(HDC hdc) int ModernSkinButtonDeleteAll() { - if ( !ModernSkinButtonModuleIsLoaded) + if (!ModernSkinButtonModuleIsLoaded) return 0; for (size_t i=0; i < ButtonsCount; i++) @@ -689,10 +689,10 @@ int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT *r) RECT rd; BOOL altDraw = FALSE; static SIZE oldWndSize = {0}; - if ( !ModernSkinButtonModuleIsLoaded) return 0; + if (!ModernSkinButtonModuleIsLoaded) return 0; GetWindowRect(parent,&rd); GetClientRect(parent,&clr); - if ( !r) + if (!r) GetWindowRect(parent,&rc); else rc = *r; diff --git a/plugins/Clist_modern/src/modern_skineditor.cpp b/plugins/Clist_modern/src/modern_skineditor.cpp index c30ac25df9..574bc362f5 100644 --- a/plugins/Clist_modern/src/modern_skineditor.cpp +++ b/plugins/Clist_modern/src/modern_skineditor.cpp @@ -73,7 +73,7 @@ int TreeAddObject(HWND hwndDlg, int ID, OPT_OBJECT_DATA * data) TCHAR *ptr, *ptrE; BOOL ext = FALSE; TCHAR *path = data->szPath ? mir_tstrdup(data->szPath):(data->szName[1] == '$') ? mir_a2t(data->szName+2):NULL; - if ( !path) { + if (!path) { TCHAR buf[255]; mir_sntprintf(buf, SIZEOF(buf), _T("$(other)/%S"), data->szName+1); path = mir_tstrdup(buf); @@ -91,7 +91,7 @@ int TreeAddObject(HWND hwndDlg, int ID, OPT_OBJECT_DATA * data) // find item if not - create; { cItem = FindChild(GetDlgItem(hwndDlg,ID), rootItem, ptr); - if ( !cItem) // not found - create node + if (!cItem) // not found - create node { TVINSERTSTRUCT tvis; tvis.hParent = rootItem; @@ -227,7 +227,7 @@ void SetAppropriateGroups(HWND hwndDlg, int Type) void SetControls(HWND hwndDlg, TCHAR *str) { - if ( !str) + if (!str) { SetAppropriateGroups(hwndDlg,-1); return; @@ -329,7 +329,7 @@ int GetShortFileName(TCHAR *FullFile) TCHAR buf[MAX_PATH] = {0}; TCHAR *f = _tcsrchr(FullFile,'\\'); TCHAR *file = f ? mir_tstrdup(f+1) : 0; - if ( !file) + if (!file) return 0; ske_GetFullFilename(buf, file, 0, TRUE); @@ -694,7 +694,7 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDC_OBJECT_TREE: { NMTREEVIEWA * nmtv = (NMTREEVIEWA *) lParam; - if ( !nmtv) return 0; + if (!nmtv) return 0; if (nmtv->hdr.code == TVN_SELCHANGEDA || nmtv->hdr.code == TVN_SELCHANGEDW) { if (nmtv->itemOld.lParam) @@ -742,7 +742,7 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - if ( !glOtherSkinWasLoaded) //store only if skin is same + if (!glOtherSkinWasLoaded) //store only if skin is same { StoreTreeToDB(GetDlgItem(hwndDlg,IDC_OBJECT_TREE),SKIN); //ReloadSkin @@ -777,12 +777,12 @@ int EnableGroup(HWND hwndDlg, HWND first, BOOL bEnable) { HWND hwnd = first; BOOL exit = FALSE; - if ( !hwnd) return 0; + if (!hwnd) return 0; do { EnableWindow(hwnd,bEnable); hwnd = GetWindow(hwnd,GW_HWNDNEXT); - if ( !hwnd || GetWindowLongPtr(hwnd,GWL_STYLE)&WS_GROUP) exit = TRUE; + if (!hwnd || GetWindowLongPtr(hwnd,GWL_STYLE)&WS_GROUP) exit = TRUE; } while (!exit); return 0; @@ -792,12 +792,12 @@ int ShowGroup(HWND hwndDlg, HWND first, BOOL bEnable) { HWND hwnd = first; BOOL exit = FALSE; - if ( !hwnd) return 0; + if (!hwnd) return 0; do { ShowWindow(hwnd,bEnable?SW_SHOW:SW_HIDE); hwnd = GetWindow(hwnd,GW_HWNDNEXT); - if ( !hwnd || GetWindowLongPtr(hwnd,GWL_STYLE)&WS_GROUP) exit = TRUE; + if (!hwnd || GetWindowLongPtr(hwnd,GWL_STYLE)&WS_GROUP) exit = TRUE; } while (!exit); return 0; diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index 114532d0a2..9a73e5188a 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -335,7 +335,7 @@ BOOL IniParser::_DoParseLine( char * szLine ) return TRUE; default: - if ( !_szSection ) + if (!_szSection ) return TRUE; //param found out of section char *keyName = szLine; @@ -513,7 +513,7 @@ HDC ske_RequestBufferDC(HDC hdcOwner, int dcID, int width, int height, BOOL fCle buf.nUsageID = dcID; buf.hDC = NULL; DCBUFFER *pBuf = BufferList.find(&buf); - if ( !pBuf) { + if (!pBuf) { //if not found - allocate it pBuf = (DCBUFFER *)mir_alloc(sizeof(DCBUFFER)); *pBuf = buf; @@ -606,7 +606,7 @@ BOOL ske_SetRectOpaque(HDC memdc,RECT *fr, BOOL force) if ( bmp.bmPlanes != 1 ) return FALSE; - if ( !bmp.bmBits) + if (!bmp.bmBits) { f = 1; bits = (BYTE*)malloc(bmp.bmWidthBytes*bmp.bmHeight); @@ -707,7 +707,7 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r //SetStretchBltMode(mem2dc, HALFTONE); mem2bmp = ske_CreateDIB32(wr.right-wr.left, rGlyph->bottom-rGlyph->top); oldbmp = (HBITMAP)SelectObject(mem2dc,mem2bmp); - if ( !oldbmp) + if (!oldbmp) return 0; /// draw here @@ -810,7 +810,7 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r mem2bmp = ske_CreateDIB32(w,h); oldbmp = (HBITMAP)SelectObject(mem2dc,mem2bmp); - if ( !oldbmp) + if (!oldbmp) return 0; /// draw here { @@ -899,7 +899,7 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r h = wr.bottom-wr.top; oldbmp = (HBITMAP)SelectObject(mem2dc,mem2bmp); #ifdef _DEBUG - if ( !oldbmp) + if (!oldbmp) (NULL,"Tile bitmap not selected","ERROR", MB_OK); #endif /// draw here @@ -1028,7 +1028,7 @@ HBITMAP ske_CreateDIB32Point(int cx, int cy, void ** bits) HRGN ske_CreateOpaqueRgn(BYTE Level, bool Opaque) { - if ( !g_pCachedWindow) + if (!g_pCachedWindow) return NULL; RGBQUAD * buf = (RGBQUAD *) g_pCachedWindow->hImageDIBByte; @@ -1101,7 +1101,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj) int depth = 0; int mode = 0; //0-FastDraw, 1-DirectAlphaDraw, 2-BufferedAlphaDraw - if ( !(preq && pobj)) return -1; + if (!(preq && pobj)) return -1; if ((!pobj->hGlyph || pobj->hGlyph == (HBITMAP)-1) && ((pobj->Style&7) == ST_IMAGE || (pobj->Style&7) == ST_FRAGMENT || (pobj->Style&7) == ST_SOLARIZE)) return 0; // Determine painting mode depth = GetDeviceCaps(preq->hDC,BITSPIXEL); @@ -1143,7 +1143,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj) if (pobj->hGlyph && pobj->hGlyph != (HBITMAP)-1) { glyphdc = CreateCompatibleDC(preq->hDC); - if ( !oldglyph) + if (!oldglyph) oldglyph = (HBITMAP)SelectObject(glyphdc,pobj->hGlyph); else SelectObject(glyphdc,pobj->hGlyph); @@ -1408,7 +1408,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj) for (i=0; i < pobj->plTextList->realCount; i++) { GLYPHTEXT * gt = (GLYPHTEXT *)pobj->plTextList->items[i]; - if ( !gt->hFont) + if (!gt->hFont) { if (gl_plSkinFonts && gl_plSkinFonts->realCount>0) { @@ -1424,7 +1424,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj) } } } - if ( !gt->hFont) gt->hFont = (HFONT)-1; + if (!gt->hFont) gt->hFont = (HFONT)-1; } if (gt->hFont != (HFONT)-1) { @@ -1464,12 +1464,12 @@ int ske_AddDescriptorToSkinObjectList (LPSKINOBJECTDESCRIPTOR lpDescr, SKINOBJEC { SKINOBJECTSLIST *sk; if (Skin) sk = Skin; else sk = &g_SkinObjectList; - if ( !sk) return 0; + if (!sk) return 0; if (mir_bool_strcmpi(lpDescr->szObjectID,"_HEADER_")) return 0; {//check if new object allready presents. DWORD i=0; for (i=0; i < sk->dwObjLPAlocated; i++) - if ( !mir_strcmp(sk->pObjects[i].szObjectID,lpDescr->szObjectID)) return 0; + if (!mir_strcmp(sk->pObjects[i].szObjectID,lpDescr->szObjectID)) return 0; } if (sk->dwObjLPAlocated+1>sk->dwObjLPReserved) { // Realocated list to add space for new object @@ -1524,7 +1524,7 @@ static LPSKINOBJECTDESCRIPTOR ske_FindObjectByMask(MODERNMASK *pModernMask, BYTE // DWORD i; SKINOBJECTSLIST* sk; sk = (Skin == NULL)?(&g_SkinObjectList):Skin; - if ( !sk->pMaskList) return NULL; + if (!sk->pMaskList) return NULL; return skin_FindObjectByMask(pModernMask,sk->pMaskList); } @@ -1537,7 +1537,7 @@ LPSKINOBJECTDESCRIPTOR ske_FindObjectByName(const char * szName, BYTE objType, S { if (sk->pObjects[i].bType == objType || objType == OT_ANY) { - if ( !mir_strcmp(sk->pObjects[i].szObjectID,szName)) + if (!mir_strcmp(sk->pObjects[i].szObjectID,szName)) return &(sk->pObjects[i]); } } @@ -1555,7 +1555,7 @@ INT_PTR ske_Service_DrawGlyph(WPARAM wParam,LPARAM lParam) LPSKINDRAWREQUEST preq; LPSKINOBJECTDESCRIPTOR pgl; LPGLYPHOBJECT gl; - if ( !wParam) return -1; + if (!wParam) return -1; ske_LockSkin(); __try { @@ -1677,7 +1677,7 @@ static BOOL ske_ReadTGAImageData(void * From, DWORD fromSize, BYTE * destBuf, DW FILE * fp = !fromSize?(FILE*)From:NULL; DWORD destCount = 0; DWORD fromCount = 0; - if ( !RLE) + if (!RLE) { while (((from && fromCount < fromSize) || (fp && fromCount < bufSize)) && (destCount < bufSize)) @@ -1746,11 +1746,11 @@ static HBITMAP ske_LoadGlyphImage_TGA(const TCHAR *szFilename) int cx = 0, cy = 0; BOOL err = FALSE; tga_header_t header; - if ( !szFilename) return NULL; - if ( !wildcmpit(szFilename, _T("*\\*%.tga"))) { + if (!szFilename) return NULL; + if (!wildcmpit(szFilename, _T("*\\*%.tga"))) { //Loading TGA image from file FILE *fp = _tfopen (szFilename, _T("rb")); - if ( !fp) { + if (!fp) { TRACEVAR("error: couldn't open \"%s\"!\n", szFilename); return NULL; } @@ -1776,9 +1776,9 @@ static HBITMAP ske_LoadGlyphImage_TGA(const TCHAR *szFilename) BYTE * mem; HGLOBAL hRes; HRSRC hRSrc = FindResourceA(g_hInst,MAKEINTRESOURCEA(IDR_TGA_DEFAULT_SKIN),"TGA"); - if ( !hRSrc) return NULL; + if (!hRSrc) return NULL; hRes = LoadResource(g_hInst,hRSrc); - if ( !hRes) return NULL; + if (!hRes) return NULL; size = SizeofResource(g_hInst,hRSrc); mem = (BYTE*) LockResource(hRes); if (size>sizeof(header)) @@ -1816,7 +1816,7 @@ static HBITMAP ske_LoadGlyphImage_Png2Dib(const TCHAR *tszFilename) BITMAPINFOHEADER* pDib; BYTE* pDibBits; - if ( !ServiceExists( MS_PNG2DIB )) { + if (!ServiceExists( MS_PNG2DIB )) { MessageBox( NULL, TranslateT("You need an image services plugin to process PNG images."), TranslateT("Error"), MB_OK ); return (HBITMAP)NULL; } @@ -1876,7 +1876,7 @@ static HBITMAP ske_LoadGlyphImageByDecoders(const TCHAR *tszFileName) int l = lstrlen(tszFileName); lstrcpyn(ext, tszFileName+(l-4),5); } - if ( !_tcschr(tszFileName,'%') && !PathFileExists(tszFileName)) + if (!_tcschr(tszFileName,'%') && !PathFileExists(tszFileName)) return NULL; if (mir_bool_tstrcmpi(ext, _T(".tga"))) { @@ -2088,7 +2088,7 @@ static void RegisterMaskByParce(const char * szSetting, char * szValue, SKINOBJE static int ske_ProcessLoadindString(const char * szSetting, char *szValue) { - if ( !pCurrentSkin) return 0; + if (!pCurrentSkin) return 0; if (szSetting[0] == '$') RegisterObjectByParce((char *)szSetting, szValue); else if (szSetting[0] == '#') @@ -2146,7 +2146,7 @@ static void ske_LinkSkinObjects(SKINOBJECTSLIST * pObjectList) globj = (GLYPHOBJECT*)lpobj->Data; if (globj) { - if ( !globj->plTextList) + if (!globj->plTextList) { globj->plTextList = List_Create(0, 1); globj->plTextList->sortFunc = ske_SortTextGlyphObjectFunc; @@ -2196,7 +2196,7 @@ static int ske_GetSkinFromDB(char * szSection, SKINOBJECTSLIST * Skin) Skin->pMaskList = (LISTMODERNMASK*)mir_alloc(sizeof(LISTMODERNMASK)); memset(Skin->pMaskList, 0, sizeof(LISTMODERNMASK)); Skin->szSkinPlace = db_get_tsa(NULL, SKIN, "SkinFolder"); - if ( !Skin->szSkinPlace || (_tcschr(Skin->szSkinPlace, '%') && !db_get_b(NULL,SKIN,"Modified",0))) + if (!Skin->szSkinPlace || (_tcschr(Skin->szSkinPlace, '%') && !db_get_b(NULL,SKIN,"Modified",0))) { BOOL bOnlyObjects = FALSE; if (Skin->szSkinPlace && _tcschr(Skin->szSkinPlace, '%')) @@ -2315,7 +2315,7 @@ BOOL ske_TextOut(HDC hdc, int x, int y, LPCTSTR lpString, int nCount) static INT_PTR ske_Service_AlphaTextOut(WPARAM wParam,LPARAM lParam) { - if ( !wParam) return 0; + if (!wParam) return 0; AlphaTextOutParams ap = *(AlphaTextOutParams*)wParam; return ske_AlphaTextOut(ap.hDC,ap.lpString,ap.nCount,ap.lpRect,ap.format,ap.ARGBcolor); @@ -3034,7 +3034,7 @@ BOOL ske_DrawIconEx(HDC hdcDst,int xLeft,int yTop,HICON hIcon,int cxWidth,int cy } else if (hasalpha || hasmask) a = (((BYTE*)src)[3]>0?((BYTE*)src)[3]:255); - else if ( !hasalpha && !hasmask) + else if (!hasalpha && !hasmask) a = 255; else { *dest = 0; continue; } } @@ -3101,7 +3101,7 @@ static INT_PTR ske_Service_UpdateFrameImage(WPARAM wParam, LPARAM lParam) FRAMEWND *frm; BOOL NoCancelPost = 0; BOOL IsAnyQueued = 0; - if ( !g_CluiData.mutexOnEdgeSizing) + if (!g_CluiData.mutexOnEdgeSizing) GetWindowRect(pcli->hwndContactList,&wnd); else wnd = g_rcEdgeSizingRect; @@ -3188,7 +3188,7 @@ static INT_PTR ske_Service_InvalidateFrameImage(WPARAM wParam, LPARAM lParam) } else Sync(QueueAllFramesUpdating, 1); - if ( !flag_bUpdateQueued || g_flag_bPostWasCanceled) + if (!flag_bUpdateQueued || g_flag_bPostWasCanceled) if (PostMessage(pcli->hwndContactList, UM_UPDATE, 0, 0)) { flag_bUpdateQueued = 1; g_flag_bPostWasCanceled = 0; @@ -3198,7 +3198,7 @@ static INT_PTR ske_Service_InvalidateFrameImage(WPARAM wParam, LPARAM lParam) static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) // Calling frame paint proc { - if ( !g_pCachedWindow) { TRACE("ske_ValidateSingleFrameImage calling without cached\n"); return 0;} + if (!g_pCachedWindow) { TRACE("ske_ValidateSingleFrameImage calling without cached\n"); return 0;} if (Frame->hWnd == (HWND)-1 && !Frame->PaintCallbackProc) { TRACE("ske_ValidateSingleFrameImage calling without FrameProc\n"); return 0;} // if ok update image @@ -3251,7 +3251,7 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) if (ru.right>rc.right) ru.right = rc.right; if (ru.bottom>rc.bottom) ru.bottom = rc.bottom; } - if ( !IsRectEmpty(&ru)) + if (!IsRectEmpty(&ru)) { x1 = ru.left; y1 = ru.top; @@ -3278,7 +3278,7 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) GetClientRect(Frame->hWnd,&r); rgnUpdate = CreateRectRgn(r.left,r.top,r.right,r.bottom); ru = r; - if ( !IsRectEmpty(&ru)) + if (!IsRectEmpty(&ru)) { x1 = ru.left; y1 = ru.top; @@ -3303,7 +3303,7 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) DeleteObject(Frame->UpdateRgn); Frame->UpdateRgn = 0; } - if ( !IsRectEmpty(&ru)) + if (!IsRectEmpty(&ru)) { x1 = ru.left; y1 = ru.top; @@ -3536,7 +3536,7 @@ int ske_ValidateFrameImageProc(RECT *r) // Callin g_mutex_bLockUpdating = 1; ModernSkinButtonRedrawAll(0); g_mutex_bLockUpdating = 0; - if ( !mutex_bLockUpdate) + if (!mutex_bLockUpdate) ske_UpdateWindowImageRect(&wnd); //-- Clear queue @@ -3585,10 +3585,10 @@ void ske_ApplyTranslucency() BOOL layered = (GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_LAYERED)?TRUE:FALSE; IsTransparancy = g_CluiData.fSmoothAnimation || g_bTransparentFlag; - if ( !g_bTransparentFlag && !g_CluiData.fSmoothAnimation && g_CluiData.bCurrentAlpha != 0) + if (!g_bTransparentFlag && !g_CluiData.fSmoothAnimation && g_CluiData.bCurrentAlpha != 0) g_CluiData.bCurrentAlpha = 255; - if ( !g_CluiData.fLayered && IsTransparancy) { + if (!g_CluiData.fLayered && IsTransparancy) { if (!layered) SetWindowLongPtr(hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED); SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)g_CluiData.bCurrentAlpha, LWA_ALPHA); @@ -3644,7 +3644,7 @@ int ske_DrawImageAt(HDC hdc, RECT *rc) BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA }; BitBlt(g_pCachedWindow->hImageDC,rc->left,rc->top,rc->right-rc->left,rc->bottom-rc->top,g_pCachedWindow->hBackDC,rc->left,rc->top,SRCCOPY); ske_AlphaBlend(g_pCachedWindow->hImageDC,rc->left,rc->top,rc->right-rc->left,rc->bottom-rc->top,hdc, 0, 0, rc->right-rc->left,rc->bottom-rc->top,bf); - if ( !g_mutex_bLockUpdating) + if (!g_mutex_bLockUpdating) ske_UpdateWindowImage(); return 0; } @@ -3691,8 +3691,8 @@ static TCHAR *ske_ReAppend(TCHAR *lfirst, TCHAR * lsecond, int len) TCHAR* ske_ReplaceVar(TCHAR *var) { - if ( !var) return mir_tstrdup(_T("")); - if ( !lstrcmpi(var,_T("Profile"))) { + if (!var) return mir_tstrdup(_T("")); + if (!lstrcmpi(var,_T("Profile"))) { char buf[MAX_PATH] = {0}; CallService(MS_DB_GETPROFILENAME,(WPARAM)MAX_PATH,(LPARAM)buf); @@ -3789,7 +3789,7 @@ static void ske_AddParseTextGlyphObject(char * szGlyphTextID,char * szDefineStri glText->stValueText = mir_a2u(GetParamN(szDefineString,buf,sizeof(buf),9,',',TRUE)); glText->stText = ske_ParseText(glText->stValueText); - if ( !Skin->pTextList) + if (!Skin->pTextList) Skin->pTextList = List_Create(0, 1); List_InsertPtr(Skin->pTextList,glText); } @@ -3833,7 +3833,7 @@ static void ske_AddParseSkinFont(char * szFontID,char * szDefineString,SKINOBJEC sf->hFont = CreateFontIndirectA(&logfont); if (sf->hFont) { sf->szFontID = mir_strdup(szFontID); - if ( !gl_plSkinFonts) + if (!gl_plSkinFonts) gl_plSkinFonts = List_Create(0, 1); if (gl_plSkinFonts) List_Insert(gl_plSkinFonts,(void*)sf,gl_plSkinFonts->realCount); diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp index aa0323f9dc..7f4528d0bf 100644 --- a/plugins/Clist_modern/src/modern_skinopt.cpp +++ b/plugins/Clist_modern/src/modern_skinopt.cpp @@ -47,7 +47,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara int SkinOptInit(WPARAM wParam, LPARAM lParam) { - if ( !g_CluiData.fDisableSkinEngine) { + if (!g_CluiData.fDisableSkinEngine) { //Tabbed settings OPTIONSDIALOGPAGE odp = { sizeof(odp) }; odp.position = -200000000; @@ -127,7 +127,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara TreeView_GetItem( GetDlgItem( hwndDlg, IDC_TREE1 ), &tvi ); sd = ( SkinListData* )( tvi.lParam); } - if ( !sd ) return 0; + if (!sd ) return 0; if ( sd->File && !_tcschr( sd->File, _T('%'))) { GetPrivateProfileString( _T("Skin_Description_Section"), _T("Author"), TranslateT("( unknown )"), Author, SIZEOF( Author ), sd->File ); @@ -163,7 +163,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara TreeView_GetItem( GetDlgItem( hwndDlg, IDC_TREE1 ), &tvi ); sd = ( SkinListData* )( tvi.lParam); } - if ( !sd ) return 0; + if (!sd ) return 0; if ( glSkinWasModified>0 ) { int res = 0; @@ -295,7 +295,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara TreeView_GetItem( GetDlgItem( hwndDlg, IDC_TREE1 ), &tvi ); sd = ( SkinListData* )( tvi.lParam); } - if ( !sd ) return 0; + if (!sd ) return 0; if ( sd->File && !_tcschr( sd->File, _T('%'))) { @@ -365,7 +365,7 @@ int SearchSkinFiles( HWND hwndDlg, TCHAR * Folder ) do { AddSkinToList( hwndDlg, Folder, fd.name ); } - while ( !_tfindnext( hFile, &fd )); + while (!_tfindnext( hFile, &fd )); _findclose( hFile ); } mir_sntprintf(mask, SIZEOF(mask), _T("%s\\*"), Folder); @@ -378,7 +378,7 @@ int SearchSkinFiles( HWND hwndDlg, TCHAR * Folder ) mir_sntprintf(path, SIZEOF(path), _T("%s\\%s"), Folder, fd.name); SearchSkinFiles( hwndDlg, path ); } - }while ( !_tfindnext( hFile, &fd )); + }while (!_tfindnext( hFile, &fd )); _findclose( hFile ); } return 0; @@ -431,14 +431,14 @@ HTREEITEM AddSkinToListFullName( HWND hwndDlg, TCHAR * fullName ) HTREEITEM AddSkinToList( HWND hwndDlg, TCHAR * path, TCHAR* file ) { SkinListData *sd = ( SkinListData * )mir_alloc( sizeof( SkinListData )); - if ( !sd ) + if (!sd ) return 0; TCHAR fullName[MAX_PATH], defskinname[MAX_PATH]; mir_sntprintf(fullName, SIZEOF(fullName), _T("%s\\%s"), path, file); memmove(defskinname, file, (_tcslen( file )-4) * sizeof(TCHAR)); defskinname[_tcslen( file )+1] = _T('\0'); - if ( !file || _tcschr( file, _T('%'))) { + if (!file || _tcschr( file, _T('%'))) { mir_sntprintf(sd->File, MAX_PATH, _T("%%Default Skin%%")); mir_sntprintf(sd->Name, 100, TranslateT("%Default Skin%")); _tcsncpy(fullName, TranslateT("Default Skin"), SIZEOF(fullName)); @@ -476,7 +476,7 @@ HTREEITEM FindChild( HWND hTree, HTREEITEM Parent, TCHAR * Caption, void * data TreeView_GetItem(hTree, &tvi); SkinListData *sd = (SkinListData*)tvi.lParam; if (sd) - if ( !_tcsicmp(sd->File, (( SkinListData* )data )->File)) + if (!_tcsicmp(sd->File, (( SkinListData* )data )->File)) return tmp; } tmp = TreeView_GetNextSibling(hTree, tmp); diff --git a/plugins/Clist_modern/src/modern_skinselector.cpp b/plugins/Clist_modern/src/modern_skinselector.cpp index 9253351990..ee7d62a203 100644 --- a/plugins/Clist_modern/src/modern_skinselector.cpp +++ b/plugins/Clist_modern/src/modern_skinselector.cpp @@ -54,7 +54,7 @@ char * ModernMaskToString(MODERNMASK *mm, char * buf, UINT bufsize) int SkinSelector_DeleteMask(MODERNMASK *mm) { int i; - if ( !mm->pl_Params) return 0; + if (!mm->pl_Params) return 0; for (i=0; i < (int)mm->dwParamCnt; i++) { free(mm->pl_Params[i].szName); @@ -66,7 +66,7 @@ int SkinSelector_DeleteMask(MODERNMASK *mm) BOOL MatchMask(char * name, char * mask) { - if ( !mask || !name) return mask == name; + if (!mask || !name) return mask == name; if (*mask != '|') return wildcmpi(name,mask); { int s = 1,e = 1; @@ -149,7 +149,7 @@ DWORD mod_CalcHash(const char * a) */ int AddModernMaskToList(MODERNMASK *mm, LISTMODERNMASK * mmTemplateList) { - if ( !mmTemplateList || !mm) return -1; + if (!mmTemplateList || !mm) return -1; mmTemplateList->pl_Masks = (MODERNMASK *)mir_realloc(mmTemplateList->pl_Masks,sizeof(MODERNMASK)*(mmTemplateList->dwMaskCnt+1)); memmove(&(mmTemplateList->pl_Masks[mmTemplateList->dwMaskCnt]),mm,sizeof(MODERNMASK)); mmTemplateList->dwMaskCnt++; @@ -159,8 +159,8 @@ int AddModernMaskToList(MODERNMASK *mm, LISTMODERNMASK * mmTemplateList) int ClearMaskList(LISTMODERNMASK * mmTemplateList) { int i; - if ( !mmTemplateList) return -1; - if ( !mmTemplateList->pl_Masks) return -1; + if (!mmTemplateList) return -1; + if (!mmTemplateList->pl_Masks) return -1; for (i=0; i < (int)mmTemplateList->dwMaskCnt; i++) SkinSelector_DeleteMask(&(mmTemplateList->pl_Masks[i])); mir_free_and_nil(mmTemplateList->pl_Masks); @@ -170,7 +170,7 @@ int ClearMaskList(LISTMODERNMASK * mmTemplateList) int DeleteMaskByItID(DWORD mID, LISTMODERNMASK *mmTemplateList) { - if ( !mmTemplateList) return -1; + if (!mmTemplateList) return -1; if (mID >= mmTemplateList->dwMaskCnt) return -1; if (mmTemplateList->dwMaskCnt == 1) { @@ -201,7 +201,7 @@ int DeleteMaskByItID(DWORD mID, LISTMODERNMASK *mmTemplateList) int ExchangeMasksByID(DWORD mID1, DWORD mID2, LISTMODERNMASK * mmTemplateList) { - if ( !mmTemplateList) return 0; + if (!mmTemplateList) return 0; if (mID1 >= mmTemplateList->dwMaskCnt) return 0; if (mID2 >= mmTemplateList->dwMaskCnt) return 0; if (mID1 == mID2) return 0; @@ -258,7 +258,7 @@ static BOOL _GetParamValue( char * szText, unsigned int& start, unsigned int len BOOL exitLoop = false; - while ( !exitLoop ) + while (!exitLoop ) { switch ( *curChar ) { @@ -344,7 +344,7 @@ static BOOL _GetParamValue( char * szText, unsigned int& start, unsigned int len int ParseToModernMask(MODERNMASK *mm, char * szText) { - if ( !mm || !szText) return -1; + if (!mm || !szText) return -1; unsigned int textLen = mir_strlen(szText); BYTE curParam = 0; @@ -380,7 +380,7 @@ int ParseToModernMask(MODERNMASK *mm, char * szText) param.szValue = strdupn( pszValue, valuelen ); - if ( !(except & EXCEPTION_WILD)) + if (!(except & EXCEPTION_WILD)) { param.dwValueHash = mod_CalcHash( param.szValue ); param.bMaskParamFlag |= MPF_HASHED; @@ -431,7 +431,7 @@ BOOL CompareModernMask(MODERNMASK *mmValue, MODERNMASK *mmTemplate) } pVal++; } - if ( !((finded && !(p.bMaskParamFlag&MPF_DIFF)) || (!finded && (p.bMaskParamFlag&MPF_DIFF)))) + if (!((finded && !(p.bMaskParamFlag&MPF_DIFF)) || (!finded && (p.bMaskParamFlag&MPF_DIFF)))) {res = FALSE; break;} pTemp++; } @@ -442,7 +442,7 @@ BOOL CompareStrWithModernMask(char * szValue,MODERNMASK *mmTemplate) { MODERNMASK mmValue = {0}; int res; - if ( !ParseToModernMask(&mmValue, szValue)) + if (!ParseToModernMask(&mmValue, szValue)) { res = CompareModernMask(&mmValue,mmTemplate); SkinSelector_DeleteMask(&mmValue); @@ -454,7 +454,7 @@ BOOL CompareStrWithModernMask(char * szValue,MODERNMASK *mmTemplate) //AddingMask int AddStrModernMaskToList(DWORD maskID, char * szStr, char * objectName, LISTMODERNMASK * mmTemplateList, void * pObjectList) { - if ( !szStr || !mmTemplateList) return -1; + if (!szStr || !mmTemplateList) return -1; MODERNMASK mm = {0}; if (ParseToModernMask(&mm,szStr)) return -1; @@ -493,13 +493,13 @@ SKINOBJECTDESCRIPTOR * skin_FindObjectByRequest(char * szValue,LISTMODERNMASK * { MODERNMASK mm = {0}; SKINOBJECTDESCRIPTOR * res = NULL; - if ( !mmTemplateList) + if (!mmTemplateList) if (g_SkinObjectList.pMaskList) mmTemplateList = g_SkinObjectList.pMaskList; else return NULL; - if ( !mmTemplateList) return NULL; + if (!mmTemplateList) return NULL; ParseToModernMask(&mm,szValue); res = skin_FindObjectByMask(&mm,mmTemplateList); SkinSelector_DeleteMask(&mm); @@ -642,7 +642,7 @@ int RegisterButtonByParce(char * ObjectName, char * Params) // Glyph,Image,Filename,(TileBoth|TileVert|TileHor|StretchBoth), < MarginLeft>, < MarginTop>, < MarginRight>, < MarginBottom>, < Alpha> int RegisterObjectByParce(char * ObjectName, char * Params) { - if ( !ObjectName || !Params) return 0; + if (!ObjectName || !Params) return 0; { int res = 0; SKINOBJECTDESCRIPTOR obj = {0}; @@ -729,7 +729,7 @@ int RegisterObjectByParce(char * ObjectName, char * Params) int SkinDrawGlyphMask(HDC hdc, RECT *rcSize, RECT *rcClip, MODERNMASK *ModernMask) { - if ( !ModernMask) return 0; + if (!ModernMask) return 0; SKINDRAWREQUEST rq; rq.hDC = hdc; @@ -747,7 +747,7 @@ int __inline SkinDrawWindowBack(HWND hwndIn, HDC hdc, RECT *rcClip, char * objec RECT rc,r1; HWND hwnd = (HWND)CallService(MS_CLUI_GETHWND, 0, 0); - if ( !objectID) return 0; + if (!objectID) return 0; GetWindowRect(hwndIn,&r1); pt.x = r1.left; pt.y = r1.top; diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index c0aa02a0d9..13d81b69cc 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -113,7 +113,7 @@ int LoadStatusBarData() DBVARIANT dbv; g_StatusBarData.bkColour = sttGetColor("StatusBar","BkColour",CLCDEFAULT_BKCOLOUR); if ( db_get_b(NULL,"StatusBar","UseBitmap",CLCDEFAULT_USEBITMAP)) { - if ( !db_get_s(NULL,"StatusBar","BkBitmap",&dbv)) { + if (!db_get_s(NULL,"StatusBar","BkBitmap",&dbv)) { g_StatusBarData.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal); db_free(&dbv); } @@ -574,21 +574,21 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) static BOOL _ModernStatus_OnExtraIconClick(int protoIndex) { ProtoItemData &p = ProtosData[protoIndex]; - if ( !mir_strcmpi(p.ProtoName, "ICQ")) { + if (!mir_strcmpi(p.ProtoName, "ICQ")) { if (p.ProtoStatus < ID_STATUS_ONLINE) return FALSE; HMENU hMainStatusMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0); - if ( !hMainStatusMenu) + if (!hMainStatusMenu) return FALSE; HMENU hProtoStatusMenu = GetSubMenu( hMainStatusMenu, protoIndex ); - if ( !hProtoStatusMenu) + if (!hProtoStatusMenu) return FALSE; int extraStatusMenuIndex = 1; HMENU hExtraStatusMenu = GetSubMenu( hProtoStatusMenu, extraStatusMenuIndex ); - if ( !hExtraStatusMenu) + if (!hExtraStatusMenu) return FALSE; POINT pt; GetCursorPos( &pt ); @@ -597,7 +597,7 @@ static BOOL _ModernStatus_OnExtraIconClick(int protoIndex) return TRUE; } - if ( !mir_strcmpi(p.ProtoName, "JABBER")) { + if (!mir_strcmpi(p.ProtoName, "JABBER")) { if (p.ProtoStatus < ID_STATUS_ONLINE) return FALSE; @@ -626,7 +626,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam break; case WM_SIZE: - if ( !g_CluiData.fLayered || GetParent(hwnd) != pcli->hwndContactList) + if (!g_CluiData.fLayered || GetParent(hwnd) != pcli->hwndContactList) InvalidateRect(hwnd, NULL, FALSE); return DefWindowProc(hwnd, msg, wParam, lParam); @@ -853,7 +853,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam mir_snprintf( protoF, SIZEOF(protoF), "%s|", accs[i]->szModuleName ); if ( strstri(g_CluiData.protoFilter, protoF)) { char * temp = mir_utf8encodeT( accs[i]->tszAccountName ); - if ( !first ) + if (!first ) strncat( filterName, "; ", SIZEOF(filterName) - strlen(filterName)); strncat( filterName, temp, SIZEOF(filterName) - strlen(filterName)); first = false; @@ -871,7 +871,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam return 0; } - if ( !hMenu) { + if (!hMenu) { if (msg == WM_RBUTTONDOWN) { BOOL a = ((g_StatusBarData.perProtoConfig && p.SBarRightClk) || g_StatusBarData.SBarRightClk ); if ( a ^ bShift ) diff --git a/plugins/Clist_modern/src/modern_statusbar_options.cpp b/plugins/Clist_modern/src/modern_statusbar_options.cpp index a8de213731..624b4dab8e 100644 --- a/plugins/Clist_modern/src/modern_statusbar_options.cpp +++ b/plugins/Clist_modern/src/modern_statusbar_options.cpp @@ -114,7 +114,7 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg) SendDlgItemMessage(hwndDlg,IDC_OFFSETSPIN_RIGHT,UDM_SETRANGE, 0, MAKELONG(50, 0)); SendDlgItemMessage(hwndDlg,IDC_OFFSETSPIN_RIGHT,UDM_SETPOS, 0, MAKELONG(sbpo.PaddingRight,2)); - if ( !sbpo.AccountIsCustomized) + if (!sbpo.AccountIsCustomized) UpdateXStatusIconOptions(hwndDlg, perProto, dat, curSelProto); { @@ -125,7 +125,7 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg) EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWXSTATUSNAME), enableOptions); EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWXSTATUS), enableOptions && enableIcons); - if ( !enableOptions) { + if (!enableOptions) { EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWNORMAL), enableOptions && enableIcons); EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWBOTH), enableOptions && enableIcons ); EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENTOVERLAY), enableOptions && enableIcons); @@ -143,7 +143,7 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg) EnableWindow(GetDlgItem(hwndDlg, IDC_OFFSETSPIN_RIGHT), enableOptions); } - if ( !perProto || sbpo.AccountIsCustomized) + if (!perProto || sbpo.AccountIsCustomized) UpdateXStatusIconOptions(hwndDlg, perProto, dat, curSelProto); } diff --git a/plugins/Clist_modern/src/modern_tbbutton.cpp b/plugins/Clist_modern/src/modern_tbbutton.cpp index 8efe3f1b16..f7cc630d3b 100644 --- a/plugins/Clist_modern/src/modern_tbbutton.cpp +++ b/plugins/Clist_modern/src/modern_tbbutton.cpp @@ -75,7 +75,7 @@ static int TBStateConvert2Flat(int state) static void PaintWorker(TBBUTTONDATA *bct, HDC hdcPaint , POINT *pOffset) { - if ( !hdcPaint) + if (!hdcPaint) return; //early exit POINT offset; @@ -93,13 +93,13 @@ static void PaintWorker(TBBUTTONDATA *bct, HDC hdcPaint , POINT *pOffset) HBITMAP hbmOld = NULL; HDC hdcMem = pOffset ? hdcPaint : CreateCompatibleDC(hdcPaint); HFONT hOldFont = (HFONT)SelectObject(hdcMem, bct->hFont); - if ( !pOffset) { + if (!pOffset) { hbmMem = ske_CreateDIB32(width, height); hbmOld = (HBITMAP)SelectObject(hdcMem, hbmMem); } else OffsetRect(&rcClient,offset.x,offset.y); - if ( !g_CluiData.fDisableSkinEngine) { + if (!g_CluiData.fDisableSkinEngine) { char szRequest[128]; /* painting */ mir_snprintf(szRequest,SIZEOF(szRequest),"Button,ID=%s,Hovered=%s,Pressed=%s,Focused=%s", @@ -139,7 +139,7 @@ static void PaintWorker(TBBUTTONDATA *bct, HDC hdcPaint , POINT *pOffset) oldBM = (HBITMAP)SelectObject ( dc, oldBM ); DeleteObject(memBM); DeleteDC(dc); - if ( !ret) { //WM_ERASEBKG return false need to paint + if (!ret) { //WM_ERASEBKG return false need to paint HDC pdc = GetDC(hwndParent); HBRUSH oldBrush = (HBRUSH)GetCurrentObject( pdc, OBJ_BRUSH ); hbr = (HBRUSH)SendMessage(hwndParent, WM_CTLCOLORDLG, (WPARAM)pdc, (LPARAM)hwndParent); @@ -166,7 +166,7 @@ static void PaintWorker(TBBUTTONDATA *bct, HDC hdcPaint , POINT *pOffset) bool bHasText = (bct->szText[0] != '\0'); /* formatter */ - if ( !g_CluiData.fDisableSkinEngine) { + if (!g_CluiData.fDisableSkinEngine) { /* correct rect according to rcMargins */ rcTemp.left += bct->rcMargins.left; @@ -217,12 +217,12 @@ static void PaintWorker(TBBUTTONDATA *bct, HDC hdcPaint , POINT *pOffset) ske_DrawText(hdcMem, bct->szText, -1, &rcText, (bCentered ? DT_CENTER: 0) | DT_VCENTER | DT_SINGLELINE); ske_ResetTextEffect(hdcMem); } - if ( !pOffset) + if (!pOffset) BitBlt(hdcPaint, 0, 0, width,height,hdcMem, 0, 0, SRCCOPY); // better to use try/finally but looks like last one is Microsoft specific SelectObject(hdcMem, hOldFont); - if ( !pOffset) { + if (!pOffset) { SelectObject(hdcMem, hbmOld); DeleteObject(hbmMem); DeleteDC(hdcMem); @@ -262,8 +262,10 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam break; case BUTTONDRAWINPARENT: - if (IsWindowVisible(hwndDlg)) + if (IsWindowVisible(hwndDlg)) { PaintWorker(bct, (HDC)wParam, (POINT*)lParam); + return 0; + } break; case WM_NCPAINT: @@ -293,7 +295,7 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam RECT rcClient; GetClientRect(bct->hwnd, &rcClient); - if ( !PtInRect(&rcClient, ptMouse)) { + if (!PtInRect(&rcClient, ptMouse)) { bct->bHotMark = false; ReleaseCapture(); } @@ -303,7 +305,7 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam bct->bHotMark = true; InvalidateParentRect(bct->hwnd, NULL, TRUE); if (bct->bSendOnDown) { - SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM) hwndDlg); + SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM)hwndDlg); bct->stateId = PBS_NORMAL; InvalidateParentRect(bct->hwnd, NULL, TRUE); } @@ -320,10 +322,10 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam RECT rcClient; GetClientRect(bct->hwnd, &rcClient); - if ( !PtInRect(&rcClient, ptMouse)) { + if (!PtInRect(&rcClient, ptMouse)) { bct->bHotMark = false; ReleaseCapture(); - break; + return 0; } if (bct->bIsPushBtn) @@ -334,12 +336,15 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam bct->stateId = PBS_HOT; InvalidateParentRect(bct->hwnd, NULL, TRUE); } - if ( !bct->bSendOnDown) { + if (!bct->bSendOnDown) { bct->bHotMark = false; SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM)hwndDlg); } } - else bct->bHotMark = false; + else { + bct->bHotMark = false; + InvalidateParentRect(bct->hwnd, NULL, TRUE); + } return 0; case WM_MOUSEMOVE: @@ -371,7 +376,7 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam InvalidateParentRect(bct->hwnd, NULL, TRUE); } } - else if ( !inClient && !bPressed) { + else if (!inClient && !bPressed) { bct->bHotMark = false; ReleaseCapture(); } @@ -387,7 +392,7 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam break; case BM_SETCHECK: - if ( !bct->bIsPushBtn) break; + if (!bct->bIsPushBtn) break; if (wParam == BST_CHECKED) bct->bIsPushed = 1; else if (wParam == BST_UNCHECKED) diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp index 6d500bc172..e5d79e65f6 100644 --- a/plugins/Clist_modern/src/modern_toolbar.cpp +++ b/plugins/Clist_modern/src/modern_toolbar.cpp @@ -146,7 +146,7 @@ static BOOL sttDrawToolBarBackground(HWND hwnd, HDC hdc, RECT *rect, ModernToolb else GetClientRect(hwnd,&rc); - if ( !(tbdat.mtb_backgroundBmpUse && tbdat.mtb_hBmpBackground) && tbdat.mtb_useWinColors) { + if (!(tbdat.mtb_backgroundBmpUse && tbdat.mtb_hBmpBackground) && tbdat.mtb_useWinColors) { if (xpt_IsThemed(pMTBInfo->mtbXPTheme)) xpt_DrawTheme(pMTBInfo->mtbXPTheme, pMTBInfo->hWnd, hdc, 0, 0, &rc, &rc); else { @@ -296,7 +296,7 @@ void CustomizeButton(HANDLE ttbid, HWND hWnd, LPARAM lParam); static int Toolbar_ModuleReloaded(WPARAM wParam, LPARAM lParam) { PLUGININFOEX *pInfo = (PLUGININFOEX*)wParam; - if ( !_stricmp(pInfo->shortName, "TopToolBar")) + if (!_stricmp(pInfo->shortName, "TopToolBar")) TopToolbar_SetCustomProc(CustomizeButton, 0); return 0; @@ -311,7 +311,7 @@ static int Toolbar_ModulesLoaded(WPARAM, LPARAM) TopToolbar_SetCustomProc(CustomizeButton, 0); BYTE bOldSetting = 0; - if ( !db_get_b(NULL, "Compatibility", "TTB_Upgrade", 0)) { + if (!db_get_b(NULL, "Compatibility", "TTB_Upgrade", 0)) { if (bOldSetting = db_get_b(NULL, "CLUI", "ShowButtonBar", 1)) { CopySettings("BUTTWIDTH", "option_Bar0_BtnWidth", 20); CopySettings("BUTTHEIGHT", "option_Bar0_BtnHeight", 20); @@ -326,7 +326,7 @@ static int Toolbar_ModulesLoaded(WPARAM, LPARAM) db_set_b(NULL, "Compatibility", "TTB_Upgrade", 1); } - if ( !ServiceExists( MS_TTB_REMOVEBUTTON) && bOldSetting == 1) + if (!ServiceExists( MS_TTB_REMOVEBUTTON) && bOldSetting == 1) if (IDYES == MessageBox(NULL, TranslateTS(szWarning), TranslateT("Toolbar upgrade"), MB_ICONQUESTION | MB_YESNO)) CallService(MS_UTILS_OPENURL, 0, (LPARAM)szUrl); diff --git a/plugins/Clist_modern/src/modern_utils.cpp b/plugins/Clist_modern/src/modern_utils.cpp index b843b28368..ff5825e67e 100644 --- a/plugins/Clist_modern/src/modern_utils.cpp +++ b/plugins/Clist_modern/src/modern_utils.cpp @@ -5,7 +5,7 @@ BYTE gl_TrimText = 1; char * __cdecl strstri( char *a, const char *b) { char * x, *y; - if ( !a || !b) return FALSE; + if (!a || !b) return FALSE; x = _strdup(a); y = _strdup(b); x = _strupr(x); @@ -56,7 +56,7 @@ BOOL __cdecl mir_bool_tstrcmpi(const TCHAR *a, const TCHAR *b) int __cdecl mir_strcmp (const char *a, const char *b) { - if ( !(a && b)) return a != b; + if (!(a && b)) return a != b; return (strcmp(a,b)); }; @@ -75,7 +75,7 @@ char * strdupn(const char * src, int len) char * p; if (src == NULL) return NULL; p = (char*)malloc(len+1); - if ( !p) return 0; + if (!p) return 0; memcpy(p,src,len); p[len] = '\0'; return p; @@ -102,7 +102,7 @@ void TRACE_ERROR() { DWORD t = GetLastError(); LPVOID lpMsgBuf; - if ( !FormatMessage( + if (!FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, @@ -126,7 +126,7 @@ void TRACE_ERROR() BOOL DebugDeleteObject(HGDIOBJ a) { BOOL res = DeleteObject(a); - if ( !res) TRACE_ERROR(); + if (!res) TRACE_ERROR(); return res; } diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index e4432a5eed..7cc1989376 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -650,7 +650,7 @@ void DeleteViewMode( char * szName ) db_unset(NULL, CLVM_MODULE, szSetting); db_unset(NULL, CLVM_MODULE, szName); - if ( !strcmp(g_CluiData.current_viewmode, szName) && lstrlenA(szName) == lstrlenA(g_CluiData.current_viewmode)) { + if (!strcmp(g_CluiData.current_viewmode, szName) && lstrlenA(szName) == lstrlenA(g_CluiData.current_viewmode)) { g_CluiData.bFilterEffective = 0; pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0); SetWindowText(hwndSelector, TranslateT("All contacts")); @@ -894,7 +894,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (hItem == NULL) break; - if ( !(hitFlags & CLCHT_ONITEMEXTRA)) + if (!(hitFlags & CLCHT_ONITEMEXTRA)) break; int iImage = SendDlgItemMessage(hwndDlg,IDC_CLIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn,0)); @@ -1118,7 +1118,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break; KillTimer(hwnd, wParam); - if ( !g_CluiData.old_viewmode[0]) + if (!g_CluiData.old_viewmode[0]) SendMessage(hwnd, WM_COMMAND, IDC_RESETMODES, 0); else ApplyViewMode((const char *)g_CluiData.old_viewmode); @@ -1169,7 +1169,7 @@ clvm_reset_command: case IDC_CONFIGUREMODES: clvm_config_command: - if ( !g_ViewModeOptDlg) + if (!g_ViewModeOptDlg) CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_OPT_VIEWMODES), 0, DlgProcViewModesSetup, 0); break; } @@ -1210,7 +1210,7 @@ static BOOL sttDrawViewModeBackground(HWND hwnd, HDC hdc, RECT *rect) if (rect) rc = *rect; else GetClientRect(hwnd,&rc); - if ( !view_mode.hBmpBackground && !view_mode.useWinColors) + if (!view_mode.hBmpBackground && !view_mode.useWinColors) { HBRUSH hbr = CreateSolidBrush(view_mode.bkColour); FillRect(hdc, &rc, hbr); @@ -1238,7 +1238,7 @@ static int ehhViewModeBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam) DBVARIANT dbv; view_mode.bkColour = sttGetColor("ViewMode","BkColour",CLCDEFAULT_BKCOLOUR); if ( db_get_b(NULL,"ViewMode","UseBitmap",CLCDEFAULT_USEBITMAP)) { - if ( !db_get_s(NULL,"ViewMode","BkBitmap",&dbv)) { + if (!db_get_s(NULL,"ViewMode","BkBitmap",&dbv)) { view_mode.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal); db_free(&dbv); } @@ -1302,9 +1302,9 @@ void ApplyViewMode(const char *Name, bool onlySelector ) mir_snprintf(szSetting, 256, "%c_LastMode", 246); - if ( !name) // Name is null - apply last stored view mode + if (!name) // Name is null - apply last stored view mode { - if ( !db_get_s(NULL, CLVM_MODULE, szSetting, &dbv)) + if (!db_get_s(NULL, CLVM_MODULE, szSetting, &dbv)) { name = (char*)_alloca(strlen(dbv.pszVal)+1); strcpy(name,dbv.pszVal); @@ -1338,10 +1338,10 @@ void ApplyViewMode(const char *Name, bool onlySelector ) return; } - if ( !onlySelector ) + if (!onlySelector ) { mir_snprintf(szSetting, 256, "%c%s_PF", 246, name); - if ( !db_get_s(NULL, CLVM_MODULE, szSetting, &dbv)) { + if (!db_get_s(NULL, CLVM_MODULE, szSetting, &dbv)) { if (lstrlenA(dbv.pszVal) >= 2) { strncpy(g_CluiData.protoFilter, dbv.pszVal, SIZEOF(g_CluiData.protoFilter)); @@ -1351,7 +1351,7 @@ void ApplyViewMode(const char *Name, bool onlySelector ) mir_free(dbv.pszVal); } mir_snprintf(szSetting, 256, "%c%s_GF", 246, name); - if ( !db_get_ts(NULL, CLVM_MODULE, szSetting, &dbv)) + if (!db_get_ts(NULL, CLVM_MODULE, szSetting, &dbv)) { if (lstrlen(dbv.ptszVal) >= 2) { diff --git a/plugins/Clist_modern/src/modern_xptheme.cpp b/plugins/Clist_modern/src/modern_xptheme.cpp index c4d54d0e1a..6a671a521f 100644 --- a/plugins/Clist_modern/src/modern_xptheme.cpp +++ b/plugins/Clist_modern/src/modern_xptheme.cpp @@ -48,7 +48,7 @@ void XPThemesUnloadModule() BOOL xpt_IsThemed(XPTHANDLE xptHandle) { BOOL res = FALSE; - if ( !xptHandle) return FALSE; + if (!xptHandle) return FALSE; xptlock(); { if (xpt_IsValidHandle(xptHandle) && ((XPTObject*) xptHandle)->hThemeHandle) @@ -61,7 +61,7 @@ BOOL xpt_IsThemed(XPTHANDLE xptHandle) BOOL xpt_IsValidHandle(XPTHANDLE xptHandle) { BOOL res = FALSE; - if ( !xptHandle) return FALSE; + if (!xptHandle) return FALSE; xptlock(); { if (xptObjectList.indexOf((XPTObject*)xptHandle) != -1) -- cgit v1.2.3