diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-21 20:04:48 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-21 20:04:48 +0000 |
commit | d154673f93ad95197bce8cadb995daa5bc39f5d8 (patch) | |
tree | 191522aa88f9f845a9c27b1ddb86116b87033c4b /src/modules/clist | |
parent | be50a70bfd8b3f3daf0c3351fdce6e2fea515bd7 (diff) |
minor code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@7820 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/clist')
-rw-r--r-- | src/modules/clist/Docking.cpp | 18 | ||||
-rw-r--r-- | src/modules/clist/clc.cpp | 64 | ||||
-rw-r--r-- | src/modules/clist/clcfiledrop.cpp | 8 | ||||
-rw-r--r-- | src/modules/clist/clcidents.cpp | 4 | ||||
-rw-r--r-- | src/modules/clist/clcitems.cpp | 30 | ||||
-rw-r--r-- | src/modules/clist/clcmsgs.cpp | 32 | ||||
-rw-r--r-- | src/modules/clist/clcutils.cpp | 26 | ||||
-rw-r--r-- | src/modules/clist/clistevents.cpp | 10 | ||||
-rw-r--r-- | src/modules/clist/clistmenus.cpp | 40 | ||||
-rw-r--r-- | src/modules/clist/clistmod.cpp | 6 | ||||
-rw-r--r-- | src/modules/clist/clistsettings.cpp | 28 | ||||
-rw-r--r-- | src/modules/clist/clisttray.cpp | 34 | ||||
-rw-r--r-- | src/modules/clist/clui.cpp | 36 | ||||
-rw-r--r-- | src/modules/clist/cluiservices.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/contact.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/contacts.cpp | 38 | ||||
-rw-r--r-- | src/modules/clist/genmenu.cpp | 56 | ||||
-rw-r--r-- | src/modules/clist/genmenuopt.cpp | 20 | ||||
-rw-r--r-- | src/modules/clist/groups.cpp | 10 | ||||
-rw-r--r-- | src/modules/clist/keyboard.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/movetogroup.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/protocolorder.cpp | 6 |
22 files changed, 237 insertions, 237 deletions
diff --git a/src/modules/clist/Docking.cpp b/src/modules/clist/Docking.cpp index 62fa64070a..cd69230f54 100644 --- a/src/modules/clist/Docking.cpp +++ b/src/modules/clist/Docking.cpp @@ -107,7 +107,7 @@ static void Docking_AdjustPosition(HWND hwnd, LPRECT rcDisplay, LPRECT rc, bool else
rc->left = rc->right - cx;
- if ( !query)
+ if (!query)
{
Docking_PosCommand(hwnd, rc, false);
dockPos = *(LPPOINT)rc;
@@ -160,7 +160,7 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) }
}
- if ( !docked && msg->message != WM_CREATE && msg->message != WM_MOVING)
+ if (!docked && msg->message != WM_CREATE && msg->message != WM_MOVING)
return 0;
switch (msg->message)
@@ -189,7 +189,7 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) if (vis)
{
- if ( !(wp->flags & (SWP_NOMOVE | SWP_NOSIZE)))
+ if (!(wp->flags & (SWP_NOMOVE | SWP_NOSIZE)))
{
bool addbar = Docking_Command(msg->hwnd, ABM_NEW) != 0;
@@ -197,12 +197,12 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) GetWindowRect(msg->hwnd, &rc);
int cx = rc.right - rc.left;
- if ( !(wp->flags & SWP_NOMOVE)) { rc.left = wp->x; rc.top = wp->y; }
+ if (!(wp->flags & SWP_NOMOVE)) { rc.left = wp->x; rc.top = wp->y; }
if (addbar)
Docking_RectToDock(&rc);
- if ( !(wp->flags & SWP_NOSIZE))
+ if (!(wp->flags & SWP_NOSIZE))
{
rc.right = rc.left + wp->cx;
rc.bottom = rc.top + wp->cy;
@@ -211,8 +211,8 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) Docking_SetSize(msg->hwnd, &rc, !addbar, false);
- if ( !(wp->flags & SWP_NOMOVE)) { wp->x = rc.left; wp->y = rc.top; }
- if ( !(wp->flags & SWP_NOSIZE)) wp->cy = rc.bottom - rc.top;
+ if (!(wp->flags & SWP_NOMOVE)) { wp->x = rc.left; wp->y = rc.top; }
+ if (!(wp->flags & SWP_NOSIZE)) wp->cy = rc.bottom - rc.top;
*((LRESULT *) lParam) = TRUE;
return TRUE;
@@ -247,7 +247,7 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) if (wp->flags & SWP_HIDEWINDOW)
vis = false;
- if ( !vis)
+ if (!vis)
Docking_Command(msg->hwnd, ABM_REMOVE);
else
Docking_Command(msg->hwnd, ABM_WINDOWPOSCHANGED);
@@ -265,7 +265,7 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) break;
case WM_MOVING:
- if ( !docked)
+ if (!docked)
{
RECT rcMonitor;
POINT ptCursor;
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp index 72dd0fd438..6e24efeb82 100644 --- a/src/modules/clist/clc.cpp +++ b/src/modules/clist/clc.cpp @@ -71,35 +71,35 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam) {
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
if ((HANDLE)wParam == NULL) {
- if ( !strcmp(cws->szModule, "CListGroups"))
+ if (!strcmp(cws->szModule, "CListGroups"))
cli.pfnClcBroadcast(INTM_GROUPSCHANGED, wParam, lParam);
return 0;
}
- if ( !strcmp(cws->szModule, "CList")) {
- if ( !strcmp(cws->szSetting, "MyHandle")) {
+ if (!strcmp(cws->szModule, "CList")) {
+ if (!strcmp(cws->szSetting, "MyHandle")) {
cli.pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam);
cli.pfnClcBroadcast(INTM_NAMECHANGED, wParam, lParam);
}
- else if ( !strcmp(cws->szSetting, "Group"))
+ else if (!strcmp(cws->szSetting, "Group"))
cli.pfnClcBroadcast(INTM_GROUPCHANGED, wParam, lParam);
- else if ( !strcmp(cws->szSetting, "Hidden"))
+ else if (!strcmp(cws->szSetting, "Hidden"))
cli.pfnClcBroadcast(INTM_HIDDENCHANGED, wParam, lParam);
- else if ( !strcmp(cws->szSetting, "NotOnList"))
+ else if (!strcmp(cws->szSetting, "NotOnList"))
cli.pfnClcBroadcast(INTM_NOTONLISTCHANGED, wParam, lParam);
- else if ( !strcmp(cws->szSetting, "Status"))
+ else if (!strcmp(cws->szSetting, "Status"))
cli.pfnClcBroadcast(INTM_INVALIDATE, 0, 0);
- else if ( !strcmp(cws->szSetting, "NameOrder"))
+ else if (!strcmp(cws->szSetting, "NameOrder"))
cli.pfnClcBroadcast(INTM_NAMEORDERCHANGED, 0, 0);
}
else {
char *szProto = GetContactProto((HANDLE)wParam);
if (szProto != NULL) {
- if ( !strcmp(cws->szModule, "Protocol") && !strcmp(cws->szSetting, "p"))
+ if (!strcmp(cws->szModule, "Protocol") && !strcmp(cws->szSetting, "p"))
cli.pfnClcBroadcast(INTM_PROTOCHANGED, wParam, lParam);
// something is being written to a protocol module
- if ( !strcmp(szProto, cws->szModule)) {
+ if (!strcmp(szProto, cws->szModule)) {
// was a unique setting key written?
char *id = (char *) CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
if ((INT_PTR)id != CALLSERVICE_NOTFOUND && id != NULL && !strcmp(id, cws->szSetting))
@@ -108,12 +108,12 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam) }
if (szProto == NULL || strcmp(szProto, cws->szModule))
return 0;
- if ( !strcmp(cws->szSetting, "Nick") || !strcmp(cws->szSetting, "FirstName") || !strcmp(cws->szSetting, "e-mail")
+ if (!strcmp(cws->szSetting, "Nick") || !strcmp(cws->szSetting, "FirstName") || !strcmp(cws->szSetting, "e-mail")
|| !strcmp(cws->szSetting, "LastName") || !strcmp(cws->szSetting, "UIN"))
cli.pfnClcBroadcast(INTM_NAMECHANGED, wParam, lParam);
- else if ( !strcmp(cws->szSetting, "ApparentMode"))
+ else if (!strcmp(cws->szSetting, "ApparentMode"))
cli.pfnClcBroadcast(INTM_APPARENTMODECHANGED, wParam, lParam);
- else if ( !strcmp(cws->szSetting, "IdleTS"))
+ else if (!strcmp(cws->szSetting, "IdleTS"))
cli.pfnClcBroadcast(INTM_IDLECHANGED, wParam, lParam);
}
return 0;
@@ -153,7 +153,7 @@ static int ClcProtoAck(WPARAM, LPARAM lParam) WindowList_BroadcastAsync(hClcWindowList, INTM_INVALIDATE, 0, 0);
if (ack->result == ACKRESULT_SUCCESS) {
for (int i=0; i < cli.hClcProtoCount; i++) {
- if ( !lstrcmpA(cli.clcProto[i].szProto, ack->szModule)) {
+ if (!lstrcmpA(cli.clcProto[i].szProto, ack->szModule)) {
cli.clcProto[i].dwStatus = (WORD) ack->lParam;
break;
}
@@ -235,7 +235,7 @@ int LoadCLCModule(void) void UnloadClcModule()
{
- if ( !bModuleInitialized) return;
+ if (!bModuleInitialized) return;
mir_free(cli.clcProto);
@@ -285,7 +285,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, dat->list.cl.increment = 30;
dat->needsResort = 1;
cli.pfnLoadClcOptions(hwnd, dat);
- if ( !IsWindowVisible(hwnd))
+ if (!IsWindowVisible(hwnd))
SetTimer(hwnd, TIMERID_REBUILDAFTER, 10, NULL);
else {
cli.pfnRebuildEntireList(hwnd, dat);
@@ -474,7 +474,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, {
WORD iExtraImage[EXTRA_ICON_COUNT];
BYTE flags = 0;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
memset(iExtraImage, 0xFF, sizeof(iExtraImage));
else {
memcpy(iExtraImage, contact->iExtraImage, sizeof(iExtraImage));
@@ -517,11 +517,11 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, // this means an offline msg is flashing, so the contact should be shown
DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
shouldShow = (style & CLS_SHOWHIDDEN || !db_get_b((HANDLE)wParam, "CList", "Hidden", 0))
- && ( !cli.pfnIsHiddenMode(dat, status) || CallService(MS_CLIST_GETCONTACTICON, wParam, 0) != lParam);
+ && (!cli.pfnIsHiddenMode(dat, status) || CallService(MS_CLIST_GETCONTACTICON, wParam, 0) != lParam);
contact = NULL;
group = NULL;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) {
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) {
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
if (dat->selection >= 0 && cli.pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
hSelItem = cli.pfnContactToHItem(selcontact);
@@ -538,7 +538,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, else { // item in list already
if (contact->iImage == (WORD) lParam)
break;
- if ( !shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) {
+ if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) {
if (dat->selection >= 0 && cli.pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
hSelItem = cli.pfnContactToHItem(selcontact);
cli.pfnRemoveItemFromGroup(hwnd, group, contact, (style & CLS_CONTACTLIST) == 0);
@@ -546,7 +546,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, }
else {
contact->iImage = (WORD) lParam;
- if ( !cli.pfnIsHiddenMode(dat, status))
+ if (!cli.pfnIsHiddenMode(dat, status))
contact->flags |= CONTACTF_ONLINE;
else
contact->flags &= ~CONTACTF_ONLINE;
@@ -565,7 +565,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, break;
case INTM_NAMECHANGED:
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
break;
lstrcpyn(contact->szText, cli.pfnGetContactDisplayName((HANDLE)wParam, 0), SIZEOF(contact->szText));
@@ -574,7 +574,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, break;
case INTM_PROTOCHANGED:
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
break;
contact->proto = GetContactProto((HANDLE)wParam);
@@ -584,7 +584,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, break;
case INTM_NOTONLISTCHANGED:
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
break;
if (contact->type == CLCIT_CONTACT) {
@@ -698,7 +698,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, KillTimer(hwnd, TIMERID_RENAME);
{
UINT scrollLines;
- if ( !SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &scrollLines, FALSE))
+ if (!SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &scrollLines, FALSE))
scrollLines = 3;
cli.pfnScrollTo(hwnd, dat, dat->yScroll - (short) HIWORD(wParam) * dat->rowHeight * (signed) scrollLines / WHEEL_DELTA, 0);
}
@@ -769,7 +769,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, return 0;
}
if (selMoved) {
- if ( !dat->filterSearch)
+ if (!dat->filterSearch)
dat->szQuickSearch[0] = 0;
if (dat->selection >= cli.pfnGetGroupContentsCount(&dat->list, 1))
dat->selection = cli.pfnGetGroupContentsCount(&dat->list, 1) - 1;
@@ -921,7 +921,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, cli.pfnEndRename(hwnd, dat, 1);
dat->ptDragStart.x = (short) LOWORD(lParam);
dat->ptDragStart.y = (short) HIWORD(lParam);
- if ( !dat->filterSearch)
+ if (!dat->filterSearch)
dat->szQuickSearch[0] = 0;
hit = cli.pfnHitTest(hwnd, dat, (short) LOWORD(lParam), (short) HIWORD(lParam), &contact, &group, &hitFlags);
@@ -966,7 +966,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, nm.hItem = cli.pfnContactToItemHandle(contact, &nm.flags);
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;
@@ -1073,7 +1073,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, 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) {
if (pt.y < 0)
dat->dragAutoScrolling = -1;
else
@@ -1204,7 +1204,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, cli.pfnInvalidateRect(hwnd, NULL, FALSE);
if (dat->selection != -1)
cli.pfnEnsureVisible(hwnd, dat, dat->selection, 0);
- if ( !(hitFlags & (CLCHT_ONITEMICON | CLCHT_ONITEMLABEL)))
+ if (!(hitFlags & (CLCHT_ONITEMICON | CLCHT_ONITEMLABEL)))
break;
UpdateWindow(hwnd);
@@ -1310,14 +1310,14 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, cli.pfnHideInfoTip(hwnd, dat);
{
for (int i=0; i <= FONTID_MAX; i++)
- if ( !dat->fontInfo[i].changed)
+ if (!dat->fontInfo[i].changed)
DeleteObject(dat->fontInfo[i].hFont);
}
if (dat->himlHighlight)
ImageList_Destroy(dat->himlHighlight);
if (dat->hwndRenameEdit)
DestroyWindow(dat->hwndRenameEdit);
- if ( !dat->bkChanged && dat->hBmpBackground)
+ if (!dat->bkChanged && dat->hBmpBackground)
DeleteObject(dat->hBmpBackground);
cli.pfnFreeGroup(&dat->list);
mir_free(dat);
diff --git a/src/modules/clist/clcfiledrop.cpp b/src/modules/clist/clcfiledrop.cpp index 7442a15bed..7f610710fd 100644 --- a/src/modules/clist/clcfiledrop.cpp +++ b/src/modules/clist/clcfiledrop.cpp @@ -83,7 +83,7 @@ static HANDLE HContactFromPoint(HWND hwnd, struct ClcData *dat, int x, int y, in return NULL;
DWORD protoCaps = CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_1, 0);
- if ( !(protoCaps & PF1_FILESEND))
+ if (!(protoCaps & PF1_FILESEND))
return NULL;
if (ID_STATUS_OFFLINE == db_get_w(contact->hContact, szProto, "Status", ID_STATUS_OFFLINE))
return NULL;
@@ -148,7 +148,7 @@ HRESULT CDropTarget::DragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL shortPt.y = pt.y;
hwnd = WindowFromPoint(shortPt);
GetClassName(hwnd, szWindowClass, SIZEOF(szWindowClass));
- if ( !lstrcmp(szWindowClass, _T(CLISTCONTROL_CLASS))) {
+ if (!lstrcmp(szWindowClass, _T(CLISTCONTROL_CLASS))) {
struct ClcData *dat;
hwndCurrentDrag = hwnd;
dat = (struct ClcData *) GetWindowLongPtr(hwndCurrentDrag, 0);
@@ -188,7 +188,7 @@ static void AddToFileList(TCHAR ***pppFiles, int *totalCount, const TCHAR *szFil lstrcat(szPath, _T("\\*"));
if (hFind = FindFirstFile(szPath, &fd)) {
do {
- if ( !lstrcmp(fd.cFileName, _T(".")) || !lstrcmp(fd.cFileName, _T("..")))
+ if (!lstrcmp(fd.cFileName, _T(".")) || !lstrcmp(fd.cFileName, _T("..")))
continue;
lstrcpy(szPath, szFilename);
lstrcat(szPath, _T("\\"));
@@ -234,7 +234,7 @@ HRESULT CDropTarget::Drop(IDataObject * pDataObj, DWORD /*fKeyState*/, POINTL pt AddToFileList(&ppFiles, &totalCount, szFilename);
}
- if ( !CallService(MS_FILE_SENDSPECIFICFILEST, (WPARAM) hContact, (LPARAM) ppFiles))
+ if (!CallService(MS_FILE_SENDSPECIFICFILEST, (WPARAM) hContact, (LPARAM) ppFiles))
*pdwEffect = DROPEFFECT_COPY;
for (i=0; ppFiles[i]; i++)
diff --git a/src/modules/clist/clcidents.cpp b/src/modules/clist/clcidents.cpp index d943b8065d..72279117ab 100644 --- a/src/modules/clist/clcidents.cpp +++ b/src/modules/clist/clcidents.cpp @@ -87,7 +87,7 @@ int fnFindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contac break;
nowVisible = 1;
for (tgroup = group; tgroup; tgroup = tgroup->parent)
- if ( !group->expanded) {
+ if (!group->expanded) {
nowVisible = 0;
break;
}
@@ -104,7 +104,7 @@ int fnFindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contac && group->cl.items[group->scanIndex]->hContact == (HANDLE) ((UINT_PTR)hItem & ~HCONTACT_ISINFO)))
{
if (isVisible) {
- if ( !nowVisible)
+ if (!nowVisible)
*isVisible = 0;
else {
int posY = cli.pfnGetRowTopY(dat, index+1);
diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp index b56341a74c..8e4eb13939 100644 --- a/src/modules/clist/clcitems.cpp +++ b/src/modules/clist/clcitems.cpp @@ -46,7 +46,7 @@ ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD int i, compareResult;
dat->needsResort = 1;
- if ( !(GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_USEGROUPS))
+ if (!(GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_USEGROUPS))
return &dat->list;
pNextField = (TCHAR*)szName;
@@ -81,7 +81,7 @@ ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD }
if (pNextField == NULL && group->cl.items[i]->groupId == 0)
break;
- if ( !(dat->exStyle & CLS_EX_SORTGROUPSALPHA) && groupId && group->cl.items[i]->groupId > groupId)
+ if (!(dat->exStyle & CLS_EX_SORTGROUPSALPHA) && groupId && group->cl.items[i]->groupId > groupId)
break;
}
if (compareResult) {
@@ -110,7 +110,7 @@ ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
ClcCacheEntry *cache = cli.pfnGetCacheEntry(hContact);
- if ( !lstrcmp(cache->tszGroup, szName) && (style & CLS_SHOWHIDDEN || !cache->bIsHidden))
+ if (!lstrcmp(cache->tszGroup, szName) && (style & CLS_SHOWHIDDEN || !cache->bIsHidden))
group->totalMembers++;
}
}
@@ -235,7 +235,7 @@ void fnAddContactToTree(HWND hwnd, struct ClcData *dat, HANDLE hContact, int upd int i, len;
DWORD groupFlags;
TCHAR *szGroupName;
- if ( !(style & CLS_HIDEEMPTYGROUPS)) {
+ if (!(style & CLS_HIDEEMPTYGROUPS)) {
mir_free(dbv.ptszVal);
return;
}
@@ -246,7 +246,7 @@ void fnAddContactToTree(HWND hwnd, struct ClcData *dat, HANDLE hContact, int upd mir_free(dbv.ptszVal);
return;
}
- if ( !lstrcmp(szGroupName, dbv.ptszVal))
+ if (!lstrcmp(szGroupName, dbv.ptszVal))
break;
}
if (groupFlags & GROUPF_HIDEOFFLINE) {
@@ -260,10 +260,10 @@ void fnAddContactToTree(HWND hwnd, struct ClcData *dat, HANDLE hContact, int upd mir_free(dbv.ptszVal);
return;
}
- if ( !lstrcmp(szGroupName, dbv.ptszVal))
+ if (!lstrcmp(szGroupName, dbv.ptszVal))
break;
len = lstrlen(szGroupName);
- if ( !_tcsncmp(szGroupName, dbv.ptszVal, len) && dbv.ptszVal[len] == '\\')
+ if (!_tcsncmp(szGroupName, dbv.ptszVal, len) && dbv.ptszVal[len] == '\\')
cli.pfnAddGroup(hwnd, dat, szGroupName, groupFlags, i, 1);
}
group = cli.pfnAddGroup(hwnd, dat, dbv.ptszVal, groupFlags, i, 1);
@@ -316,10 +316,10 @@ void fnDeleteItemFromTree(HWND hwnd, HANDLE hItem) struct ClcData *dat = (struct ClcData *) GetWindowLongPtr(hwnd, 0);
dat->needsResort = 1;
- if ( !cli.pfnFindItem(hwnd, dat, hItem, &contact, &group, NULL)) {
+ if (!cli.pfnFindItem(hwnd, dat, hItem, &contact, &group, NULL)) {
DBVARIANT dbv;
int i, nameOffset;
- if ( !IsHContactContact(hItem))
+ if (!IsHContactContact(hItem))
return;
if (db_get_ts(hItem, "CList", "Group", &dbv))
return;
@@ -332,7 +332,7 @@ void fnDeleteItemFromTree(HWND hwnd, HANDLE hItem) break;
if (group->cl.items[i]->type == CLCIT_GROUP) {
int len = lstrlen(group->cl.items[i]->szText);
- if ( !_tcsncmp(group->cl.items[i]->szText, dbv.ptszVal + nameOffset, len) &&
+ if (!_tcsncmp(group->cl.items[i]->szText, dbv.ptszVal + nameOffset, len) &&
(dbv.ptszVal[nameOffset + len] == '\\' || dbv.ptszVal[nameOffset + len] == '\0')) {
group->totalMembers--;
if (dbv.ptszVal[nameOffset + len] == '\0')
@@ -385,13 +385,13 @@ void fnRebuildEntireList(HWND hwnd, struct ClcData *dat) if (_tcsstr(lowered_name, lowered_search))
cli.pfnAddContactToGroup(dat, group, hContact);
}
- else if ( !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) {
+ else if (!(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) {
char *szProto = GetContactProto(hContact);
if (szProto == NULL) {
- if ( !cli.pfnIsHiddenMode(dat, ID_STATUS_OFFLINE))
+ if (!cli.pfnIsHiddenMode(dat, ID_STATUS_OFFLINE))
cli.pfnAddContactToGroup(dat, group, hContact);
}
- else if ( !cli.pfnIsHiddenMode(dat, db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE)))
+ else if (!cli.pfnIsHiddenMode(dat, db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE)))
cli.pfnAddContactToGroup(dat, group, hContact);
}
else cli.pfnAddContactToGroup(dat, group, hContact);
@@ -438,7 +438,7 @@ int fnGetGroupContentsCount(ClcGroup *group, int visibleOnly) break;
group = group->parent;
}
- else if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && ( !visibleOnly || group->cl.items[group->scanIndex]->group->expanded)) {
+ else if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (!visibleOnly || group->cl.items[group->scanIndex]->group->expanded)) {
group = group->cl.items[group->scanIndex]->group;
group->scanIndex = 0;
count += group->cl.count;
@@ -685,7 +685,7 @@ void fnSaveStateAndRebuildList(HWND hwnd, struct ClcData *dat) if (saveInfo[i].parentId == -1)
group = &dat->list;
else {
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) (saveInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE) (saveInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL))
continue;
group = contact->group;
}
diff --git a/src/modules/clist/clcmsgs.cpp b/src/modules/clist/clcmsgs.cpp index c60526cfc0..6845cd02e1 100644 --- a/src/modules/clist/clcmsgs.cpp +++ b/src/modules/clist/clcmsgs.cpp @@ -59,7 +59,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR if (cii->hParentGroup == NULL)
group = &dat->list;
else {
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) ((UINT_PTR) cii->hParentGroup | HCONTACT_ISGROUP), &groupContact, NULL, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE) ((UINT_PTR) cii->hParentGroup | HCONTACT_ISGROUP), &groupContact, NULL, NULL))
return (LRESULT)(HANDLE) NULL;
group = groupContact->group;
}
@@ -97,7 +97,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR {
ClcContact *contact;
ClcGroup *group, *tgroup;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL))
break;
for (tgroup = group; tgroup; tgroup = tgroup->parent)
cli.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
@@ -108,7 +108,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_EXPAND:
{
ClcContact *contact;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
break;
if (contact->type != CLCIT_GROUP)
break;
@@ -117,12 +117,12 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR }
case CLM_FINDCONTACT:
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, NULL, NULL, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, NULL, NULL, NULL))
return (LRESULT)(HANDLE) NULL;
return wParam;
case CLM_FINDGROUP:
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) (wParam | HCONTACT_ISGROUP), NULL, NULL, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE) (wParam | HCONTACT_ISGROUP), NULL, NULL, NULL))
return (LRESULT)(HANDLE) NULL;
return wParam | HCONTACT_ISGROUP;
@@ -132,7 +132,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_GETCHECKMARK:
{
ClcContact *contact;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
return 0;
return (contact->flags & CONTACTF_CHECKED) != 0;
}
@@ -146,7 +146,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_GETEXPAND:
{
ClcContact *contact;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
return CLE_INVALID;
if (contact->type != CLCIT_GROUP)
return CLE_INVALID;
@@ -190,7 +190,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_GETITEMTEXT:
{
ClcContact *contact;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
return 0;
lstrcpy((TCHAR*) lParam, contact->szText);
return lstrlen(contact->szText);
@@ -199,7 +199,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_GETITEMTYPE:
{
ClcContact *contact;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
return CLCIT_INVALID;
return contact->type;
}
@@ -217,7 +217,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR ClcContact *contact;
ClcGroup *group;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) lParam, &contact, &group, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE) lParam, &contact, &group, NULL))
return NULL;
int i = List_IndexOf((SortedList*)&group->cl, contact);
@@ -320,7 +320,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR {
ClcContact *contact;
ClcGroup *group, *tgroup;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL))
break;
for (tgroup = group; tgroup; tgroup = tgroup->parent)
cli.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
@@ -330,7 +330,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR }
case CLM_SETBKBITMAP:
- if ( !dat->bkChanged && dat->hBmpBackground) {
+ if (!dat->bkChanged && dat->hBmpBackground) {
DeleteObject(dat->hBmpBackground);
dat->hBmpBackground = NULL;
}
@@ -341,7 +341,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR break;
case CLM_SETBKCOLOR:
- if ( !dat->bkChanged && dat->hBmpBackground) {
+ if (!dat->bkChanged && dat->hBmpBackground) {
DeleteObject(dat->hBmpBackground);
dat->hBmpBackground = NULL;
}
@@ -353,7 +353,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_SETCHECKMARK:
{
ClcContact *contact;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
return 0;
if (lParam)
contact->flags |= CONTACTF_CHECKED;
@@ -375,7 +375,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_SETEXTRAIMAGE:
if ( LOWORD(lParam) < dat->extraColumnsCount) {
ClcContact *contact;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
return 0;
contact->iExtraImage[LOWORD(lParam)] = HIWORD(lParam);
@@ -433,7 +433,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_SETITEMTEXT:
{
ClcContact *contact;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
break;
lstrcpyn(contact->szText, (TCHAR*)lParam, SIZEOF(contact->szText));
cli.pfnSortCLC(hwnd, dat, 1);
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp index f9031c55a6..e4258c8a11 100644 --- a/src/modules/clist/clcutils.cpp +++ b/src/modules/clist/clcutils.cpp @@ -87,7 +87,7 @@ int fnHitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact * ScreenToClient(hwndParent, &pt1);
HWND h = ChildWindowFromPointEx(hwndParent ? hwndParent : GetDesktopWindow(), pt1, CWP_SKIPINVISIBLE | CWP_SKIPTRANSPARENT);
if (h != hwndTemp)
- if ( !hwndParent || !(GetWindowLongPtr(hwndTemp, GWL_STYLE) & BS_GROUPBOX))
+ if (!hwndParent || !(GetWindowLongPtr(hwndTemp, GWL_STYLE) & BS_GROUPBOX))
return -1;
}
while (hwndParent);
@@ -211,10 +211,10 @@ void fnScrollTo(HWND hwnd, struct ClcData *dat, int desty, int noSmooth) desty = 0;
if (abs(desty - dat->yScroll) < 4)
noSmooth = 1;
- if ( !noSmooth && dat->exStyle & CLS_EX_NOSMOOTHSCROLLING)
+ if (!noSmooth && dat->exStyle & CLS_EX_NOSMOOTHSCROLLING)
noSmooth = 1;
previousy = dat->yScroll;
- if ( !noSmooth) {
+ if (!noSmooth) {
startTick = GetTickCount();
for (;;) {
nowTick = GetTickCount();
@@ -372,7 +372,7 @@ int fnFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int prefi TCHAR *lowered_text = CharLowerW(NEWTSTR_ALLOCA(text));
show = _tcsstr(lowered_szText, lowered_text) != NULL;
}
- else show = ((prefixOk && !_tcsnicmp(text, group->cl.items[group->scanIndex]->szText, testlen)) || ( !prefixOk && !lstrcmpi(text, group->cl.items[group->scanIndex]->szText)));
+ else show = ((prefixOk && !_tcsnicmp(text, group->cl.items[group->scanIndex]->szText, testlen)) || (!prefixOk && !lstrcmpi(text, group->cl.items[group->scanIndex]->szText)));
if (show) {
ClcGroup *contactGroup = group;
@@ -382,7 +382,7 @@ int fnFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int prefi return cli.pfnGetRowsPriorTo(&dat->list, contactGroup, contactScanIndex);
}
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;
continue;
@@ -421,7 +421,7 @@ void fnEndRename(HWND, struct ClcData *dat, int save) else if (contact->type == CLCIT_CONTACT) {
cli.pfnInvalidateDisplayNameCacheEntry(contact->hContact);
TCHAR* otherName = cli.pfnGetContactDisplayName(contact->hContact, GCDNF_NOMYHANDLE);
- if ( !text[0] || !lstrcmp(otherName, text))
+ if (!text[0] || !lstrcmp(otherName, text))
db_unset(contact->hContact, "CList", "MyHandle");
else
db_set_ts(contact->hContact, "CList", "MyHandle", text);
@@ -522,7 +522,7 @@ int fnGetDropTargetInformation(HWND hwnd, struct ClcData *dat, POINT pt) GetClientRect(hwnd, &clRect);
dat->selection = dat->iDragItem;
dat->iInsertionMark = -1;
- if ( !PtInRect(&clRect, pt))
+ if (!PtInRect(&clRect, pt))
return DROPTARGET_OUTSIDE;
ClcContact *contact, *movecontact;
@@ -691,7 +691,7 @@ void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour) cli.pfnGetDefaultFontSetting(i, lf, colour);
mir_snprintf(idstr, SIZEOF(idstr), "Font%dName", i);
- if ( !db_get_ts(NULL, "CLC", idstr, &dbv)) {
+ if (!db_get_ts(NULL, "CLC", idstr, &dbv)) {
lstrcpy(lf->lfFaceName, dbv.ptszVal);
mir_free(dbv.pszVal);
}
@@ -723,7 +723,7 @@ void fnLoadClcOptions(HWND hwnd, struct ClcData *dat) HDC hdc = GetDC(hwnd);
for (int i=0; i <= FONTID_MAX; i++) {
- if ( !dat->fontInfo[i].changed)
+ if (!dat->fontInfo[i].changed)
DeleteObject(dat->fontInfo[i].hFont);
cli.pfnGetFontSetting(i, &lf, &dat->fontInfo[i].colour);
@@ -749,7 +749,7 @@ void fnLoadClcOptions(HWND hwnd, struct ClcData *dat) dat->noVScrollbar = db_get_b(NULL, "CLC", "NoVScrollBar", 0);
dat->filterSearch = db_get_b(NULL, "CLC", "FilterSearch", 1);
SendMessage(hwnd, INTM_SCROLLBARCHANGED, 0, 0);
- if ( !dat->bkChanged) {
+ if (!dat->bkChanged) {
DBVARIANT dbv;
dat->bkColour = db_get_dw(NULL, "CLC", "BkColour", CLCDEFAULT_BKCOLOUR);
if (dat->hBmpBackground) {
@@ -757,7 +757,7 @@ void fnLoadClcOptions(HWND hwnd, struct ClcData *dat) dat->hBmpBackground = NULL;
}
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);
mir_free(dbv.pszVal);
}
@@ -810,7 +810,7 @@ void fnRecalculateGroupCheckboxes(HWND, struct ClcData *dat) }
else if (group->cl.items[(group->scanIndex & GSIF_INDEXMASK)]->type == CLCIT_CONTACT) {
group->scanIndex |= GSIF_HASMEMBERS;
- if ( !(group->cl.items[(group->scanIndex & GSIF_INDEXMASK)]->flags & CONTACTF_CHECKED))
+ if (!(group->cl.items[(group->scanIndex & GSIF_INDEXMASK)]->flags & CONTACTF_CHECKED))
group->scanIndex &= ~GSIF_ALLCHECKED;
}
group->scanIndex++;
@@ -873,7 +873,7 @@ int fnGetRowHeight(struct ClcData *dat, int) int fnRowHitTest(struct ClcData *dat, int y)
{
- if ( !dat->rowHeight)
+ if (!dat->rowHeight)
return y;
return y / dat->rowHeight;
}
diff --git a/src/modules/clist/clistevents.cpp b/src/modules/clist/clistevents.cpp index bc541a87ab..3407be16df 100644 --- a/src/modules/clist/clistevents.cpp +++ b/src/modules/clist/clistevents.cpp @@ -92,7 +92,7 @@ static void ShowEventsInTray() char ** pTrayProtos;
char nTrayProtoCnt;
int nTrayCnt = cli.trayIconCount;
- if ( !cli.events.count || !nTrayCnt) return;
+ if (!cli.events.count || !nTrayCnt) return;
if (cli.events.count == 1 || nTrayCnt == 1)
{
ShowOneEventInTray(0); //for only one icon in tray show topmost event
@@ -161,7 +161,7 @@ struct CListEvent* fnAddEvent(CLISTEVENT *cle) if (cle->flags & CLEF_URGENT) {
for (i=0; i < cli.events.count; i++)
- if ( !(cli.events.items[i]->cle.flags & CLEF_URGENT))
+ if (!(cli.events.items[i]->cle.flags & CLEF_URGENT))
break;
}
else i = cli.events.count;
@@ -307,10 +307,10 @@ int fnEventsProcessTrayDoubleClick(int index) char * eventProto = NULL;
if (cli.events.items[i]->cle.hContact)
eventProto = GetContactProto(cli.events.items[i]->cle.hContact);
- if ( !eventProto)
+ if (!eventProto)
eventProto = cli.events.items[i]->cle.lpszProtocol;
- if ( !eventProto || !_strcmpi(eventProto, szProto)) {
+ if (!eventProto || !_strcmpi(eventProto, szProto)) {
eventIndex = i;
break;
}
@@ -324,7 +324,7 @@ int fnEventsProcessTrayDoubleClick(int index) char * eventProto = NULL;
if (cli.events.items[i]->cle.hContact)
eventProto = GetContactProto(cli.events.items[i]->cle.hContact);
- if ( !eventProto)
+ if (!eventProto)
eventProto = cli.events.items[i]->cle.lpszProtocol;
if (eventProto) {
for (j = 0; j<cli.trayIconCount; j++)
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp index 4fe73299b6..387d3b565c 100644 --- a/src/modules/clist/clistmenus.cpp +++ b/src/modules/clist/clistmenus.cpp @@ -208,7 +208,7 @@ static INT_PTR AddMainMenuItem(WPARAM, LPARAM lParam) {
TMO_MenuItem tmi;
CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
- if ( !cli.pfnConvertMenu(mi, &tmi))
+ if (!cli.pfnConvertMenu(mi, &tmi))
return 0;
lpMainMenuExecParam mmep = (lpMainMenuExecParam)mir_alloc(sizeof(MainMenuExecParam));
@@ -253,7 +253,7 @@ INT_PTR MainMenuExecService(WPARAM wParam, LPARAM lParam) lpMainMenuExecParam mmep = (lpMainMenuExecParam)wParam;
if (mmep != NULL) {
// bug in help.c, it used wparam as parent window handle without reason.
- if ( !lstrcmpA(mmep->szServiceName, "Help/AboutCommand"))
+ if (!lstrcmpA(mmep->szServiceName, "Help/AboutCommand"))
mmep->Param1 = 0;
CallService(mmep->szServiceName, mmep->Param1, lParam);
@@ -284,10 +284,10 @@ static INT_PTR AddContactMenuItem(WPARAM, LPARAM lParam) {
TMO_MenuItem tmi;
CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
- if ( !cli.pfnConvertMenu(mi, &tmi))
+ if (!cli.pfnConvertMenu(mi, &tmi))
return 0;
- if ( !(mi->flags & CMIF_ROOTHANDLE)) {
+ if (!(mi->flags & CMIF_ROOTHANDLE)) {
//old system
tmi.flags |= CMIF_ROOTHANDLE;
tmi.root = NULL;
@@ -400,7 +400,7 @@ INT_PTR FreeOwnerDataContactMenu (WPARAM, LPARAM lParam) BOOL FindMenuHandleByGlobalID(HMENU hMenu, PMO_IntMenuItem id, MenuItemData* itdat)
{
- if ( !itdat)
+ if (!itdat)
return FALSE;
MENUITEMINFO mii = { sizeof(mii) };
@@ -432,11 +432,11 @@ BOOL FindMenuHandleByGlobalID(HMENU hMenu, PMO_IntMenuItem id, MenuItemData* itd INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM)
{
PCheckProcParam pcpp = (PCheckProcParam)wParam;
- if ( !pcpp)
+ if (!pcpp)
return TRUE;
PMO_IntMenuItem timi = MO_GetIntMenuItem(pcpp->MenuItemHandle);
- if ( !timi)
+ if (!timi)
return TRUE;
StatusMenuExecParam *smep = (StatusMenuExecParam*)pcpp->MenuItemOwnerData;
@@ -508,7 +508,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) else
timi->mi.flags &= ~CMIF_CHECKED;
}
- else if (( !smep || smep->proto) && timi->mi.pszName) {
+ else if ((!smep || smep->proto) && timi->mi.pszName) {
int curProtoStatus = 0;
BOOL IconNeedDestroy = FALSE;
char* prot;
@@ -608,7 +608,7 @@ INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM) for (int j=0; j < accounts.getCount(); j++) {
PROTOACCOUNT* pa = accounts[j];
- if ( !Proto_IsAccountEnabled(pa))
+ if (!Proto_IsAccountEnabled(pa))
continue;
if (MenusProtoCount > 1 && Proto_IsAccountLocked(pa))
continue;
@@ -661,7 +661,7 @@ static INT_PTR ModifyCustomMenuItem(WPARAM wParam, LPARAM lParam) {
TMO_MenuItem tmi;
CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
- if ( !cli.pfnConvertMenu(mi, &tmi))
+ if (!cli.pfnConvertMenu(mi, &tmi))
return 0;
return MO_ModifyMenuItem((PMO_IntMenuItem)wParam, &tmi);
@@ -680,7 +680,7 @@ INT_PTR MenuProcessCommand(WPARAM wParam, LPARAM lParam) }
}
- if ( !(cmd >= CLISTMENUIDMIN && cmd <= CLISTMENUIDMAX))
+ if (!(cmd >= CLISTMENUIDMIN && cmd <= CLISTMENUIDMAX))
return 0; // DO NOT process ids outside from clist menu id range v0.7.0.27+
//process old menu sys
@@ -693,7 +693,7 @@ INT_PTR MenuProcessCommand(WPARAM wParam, LPARAM lParam) BOOL FindMenuHanleByGlobalID(HMENU hMenu, PMO_IntMenuItem id, MenuItemData* itdat)
{
- if ( !itdat)
+ if (!itdat)
return FALSE;
BOOL inSub = FALSE;
@@ -812,7 +812,7 @@ int fnGetProtoIndexByPos(PROTOCOLDESCRIPTOR **proto, int protoCnt, int Pos) _itoa(Pos, buf, 10);
DBVARIANT dbv;
- if ( !db_get_s(NULL, "Protocols", buf, &dbv)) {
+ if (!db_get_s(NULL, "Protocols", buf, &dbv)) {
for (int p=0; p < protoCnt; p++) {
if (lstrcmpA(proto[p]->szName, dbv.pszVal) == 0) {
db_free(&dbv);
@@ -869,7 +869,7 @@ void RebuildMenuOrder(void) PROTOACCOUNT* pa = accounts[i];
int pos = 0;
- if ( !bHideStatusMenu && !cli.pfnGetProtocolVisibility(pa->szModuleName))
+ if (!bHideStatusMenu && !cli.pfnGetProtocolVisibility(pa->szModuleName))
continue;
DWORD flags = pa->ppro->GetCaps(PFLAGNUM_2, 0) & ~pa->ppro->GetCaps(PFLAGNUM_5, 0);
@@ -936,7 +936,7 @@ void RebuildMenuOrder(void) pos += 500000;
for (int j = 0; j < SIZEOF(statusModeList); j++) {
- if ( !(flags & statusModePf2List[j]))
+ if (!(flags & statusModePf2List[j]))
continue;
//adding
@@ -977,11 +977,11 @@ void RebuildMenuOrder(void) for (j = 0; j < SIZEOF(statusModeList); j++) {
for (i=0; i < accounts.getCount(); i++) {
PROTOACCOUNT* pa = accounts[i];
- if ( !bHideStatusMenu && !cli.pfnGetProtocolVisibility(pa->szModuleName))
+ if (!bHideStatusMenu && !cli.pfnGetProtocolVisibility(pa->szModuleName))
continue;
DWORD flags = pa->ppro->GetCaps(PFLAGNUM_2, 0) & ~pa->ppro->GetCaps(PFLAGNUM_5, 0);
- if ( !(flags & statusModePf2List[j]))
+ if (!(flags & statusModePf2List[j]))
continue;
TMO_MenuItem tmi = { sizeof(tmi) };
@@ -1096,7 +1096,7 @@ static int MenuProtoAck(WPARAM, LPARAM lParam) }
for (int i=0; i < accounts.getCount(); i++) {
- if ( !lstrcmpA(accounts[i]->szModuleName, ack->szModule)) {
+ if (!lstrcmpA(accounts[i]->szModuleName, ack->szModule)) {
if (((int)ack->hProcess >= ID_STATUS_OFFLINE || (int)ack->hProcess == 0) && (int)ack->hProcess < ID_STATUS_OFFLINE + SIZEOF(statusModeList)) {
int pos = statustopos((int)ack->hProcess);
if (pos == -1)
@@ -1153,7 +1153,7 @@ static MenuProto* FindProtocolMenu(const char* proto) return &cli.menuProtos[i];
if (cli.menuProtoCount == 1)
- if ( !lstrcmpiA(cli.menuProtos[0].szProto, proto))
+ if (!lstrcmpiA(cli.menuProtos[0].szProto, proto))
return &cli.menuProtos[0];
return NULL;
@@ -1175,7 +1175,7 @@ static INT_PTR AddStatusMenuItem(WPARAM wParam, LPARAM lParam) CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
TMO_MenuItem tmi;
- if ( !cli.pfnConvertMenu(mi, &tmi))
+ if (!cli.pfnConvertMenu(mi, &tmi))
return 0;
// for new style menus the pszPopupName contains the root menu handle
diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp index 547fcc326d..3cd0e45693 100644 --- a/src/modules/clist/clistmod.cpp +++ b/src/modules/clist/clistmod.cpp @@ -117,7 +117,7 @@ static INT_PTR GetStatusModeDescription(WPARAM wParam, LPARAM lParam) {
TCHAR* buf1 = cli.pfnGetStatusModeDescription(wParam, lParam);
- if ( !(lParam & GSMDF_TCHAR)) {
+ if (!(lParam & GSMDF_TCHAR)) {
static char szMode[64];
char *buf2 = mir_u2a(buf1);
mir_snprintf(szMode, SIZEOF(szMode), "%s", buf2);
@@ -366,7 +366,7 @@ int fnShowHide(WPARAM, LPARAM) switch (iVisibleState) {
case GWVS_PARTIALLY_COVERED:
//If we don't want to bring it to top, we can use a simple break. This goes against readability ;-) but the comment explains it.
- if ( !db_get_b(NULL, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT))
+ if (!db_get_b(NULL, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT))
break;
case GWVS_COVERED: //Fall through (and we're already falling)
case GWVS_HIDDEN:
@@ -383,7 +383,7 @@ int fnShowHide(WPARAM, LPARAM) RECT rcWindow;
ShowWindow(cli.hwndContactList, SW_RESTORE);
- if ( !db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT))
+ if (!db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT))
SetWindowPos(cli.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
else
SetWindowPos(cli.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
diff --git a/src/modules/clist/clistsettings.cpp b/src/modules/clist/clistsettings.cpp index 16aff8469d..89ee1d5f75 100644 --- a/src/modules/clist/clistsettings.cpp +++ b/src/modules/clist/clistsettings.cpp @@ -68,7 +68,7 @@ void fnCheckCacheItem(ClcCacheEntry *p) {
DBVARIANT dbv;
if (p->tszGroup == NULL) {
- if ( !db_get_ts(p->hContact, "CList", "Group", &dbv)) {
+ if (!db_get_ts(p->hContact, "CList", "Group", &dbv)) {
p->tszGroup = mir_tstrdup(dbv.ptszVal);
mir_free(dbv.ptszVal);
}
@@ -90,7 +90,7 @@ ClcCacheEntry* fnGetCacheEntry(HANDLE hContact) {
ClcCacheEntry *p;
int idx;
- if ( !List_GetIndex(clistCache, &hContact, &idx)) {
+ if (!List_GetIndex(clistCache, &hContact, &idx)) {
if ((p = cli.pfnCreateCacheItem(hContact)) != NULL) {
List_Insert(clistCache, p, idx);
cli.pfnInvalidateDisplayNameCacheEntry(p);
@@ -135,7 +135,7 @@ TCHAR* fnGetContactDisplayName(HANDLE hContact, int mode) if (ci.hContact == NULL)
ci.szProto = "ICQ";
ci.dwFlag = ((mode == GCDNF_NOMYHANDLE) ? CNF_DISPLAYNC : CNF_DISPLAY) | CNF_TCHAR;
- if ( !CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci)) {
+ if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci)) {
if (ci.type == CNFT_ASCIIZ) {
if (cacheEntry != NULL)
cacheEntry->tszName = ci.pszVal;
@@ -181,7 +181,7 @@ INT_PTR GetContactDisplayName(WPARAM wParam, LPARAM lParam) if (ci.hContact == NULL) // killme !!!!!!!!!!
ci.szProto = "ICQ";
ci.dwFlag = ((lParam == GCDNF_NOMYHANDLE) ? CNF_DISPLAYNC : CNF_DISPLAY) | CNF_TCHAR;
- if ( !CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci)) {
+ if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci)) {
if (ci.type == CNFT_ASCIIZ) {
strncpy(retVal, _T2A(ci.pszVal), SIZEOF(retVal));
if (cacheEntry == NULL) {
@@ -237,15 +237,15 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam) return 0;
dbv.pszVal = NULL;
- if ( !db_get(hContact, "Protocol", "p", &dbv)) {
- if ( !strcmp(cws->szModule, dbv.pszVal)) {
+ if (!db_get(hContact, "Protocol", "p", &dbv)) {
+ if (!strcmp(cws->szModule, dbv.pszVal)) {
cli.pfnInvalidateDisplayNameCacheEntry(hContact);
- if ( !strcmp(cws->szSetting, "UIN") || !strcmp(cws->szSetting, "Nick") || !strcmp(cws->szSetting, "FirstName")
+ if (!strcmp(cws->szSetting, "UIN") || !strcmp(cws->szSetting, "Nick") || !strcmp(cws->szSetting, "FirstName")
|| !strcmp(cws->szSetting, "LastName") || !strcmp(cws->szSetting, "e-mail")) {
CallService(MS_CLUI_CONTACTRENAMED, wParam, 0);
}
- else if ( !strcmp(cws->szSetting, "Status")) {
- if ( !db_get_b(hContact, "CList", "Hidden", 0)) {
+ else if (!strcmp(cws->szSetting, "Status")) {
+ if (!db_get_b(hContact, "CList", "Hidden", 0)) {
if (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT)) {
// User's state is changing, and we are hideOffline-ing
if (cws->value.wVal == ID_STATUS_OFFLINE) {
@@ -267,8 +267,8 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam) }
}
- if ( !strcmp(cws->szModule, "CList")) {
- if ( !strcmp(cws->szSetting, "Hidden")) {
+ if (!strcmp(cws->szModule, "CList")) {
+ if (!strcmp(cws->szSetting, "Hidden")) {
if (cws->value.type == DBVT_DELETED || cws->value.bVal == 0) {
char *szProto = GetContactProto((HANDLE)wParam);
cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode(szProto, szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact), 1);
@@ -276,12 +276,12 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam) else
CallService(MS_CLUI_CONTACTDELETED, wParam, 0);
}
- if ( !strcmp(cws->szSetting, "MyHandle"))
+ if (!strcmp(cws->szSetting, "MyHandle"))
cli.pfnInvalidateDisplayNameCacheEntry(hContact);
}
- if ( !strcmp(cws->szModule, "Protocol")) {
- if ( !strcmp(cws->szSetting, "p")) {
+ if (!strcmp(cws->szModule, "Protocol")) {
+ if (!strcmp(cws->szSetting, "p")) {
char *szProto;
if (cws->value.type == DBVT_DELETED)
szProto = NULL;
diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp index 670a7f8f51..17b017244f 100644 --- a/src/modules/clist/clisttray.cpp +++ b/src/modules/clist/clisttray.cpp @@ -39,7 +39,7 @@ static CRITICAL_SECTION trayLockCS; #define NIF_STATE 0x00000008
#define NIF_INFO 0x00000010
-#define initcheck if ( !fTrayInited) return
+#define initcheck if (!fTrayInited) return
#define SIZEOFNID ((cli.shellVersion >= 5) ? NOTIFYICONDATA_V2_SIZE : NOTIFYICONDATA_V1_SIZE)
@@ -90,7 +90,7 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto) if (szPrefix && szPrefix[0]) {
lstrcpyn(cli.szTip, szPrefix, MAX_TIP_SIZE);
- if ( !db_get_b(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT))
+ if (!db_get_b(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT))
return cli.szTip;
}
else cli.szTip[0] = '\0';
@@ -102,11 +102,11 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto) continue;
PROTOACCOUNT *pa = accounts[i];
- if ( !cli.pfnGetProtocolVisibility(pa->szModuleName))
+ if (!cli.pfnGetProtocolVisibility(pa->szModuleName))
continue;
szStatus = cli.pfnGetStatusModeDescription(CallProtoServiceInt(NULL,pa->szModuleName, PS_GETSTATUS, 0, 0), 0);
- if ( !szStatus)
+ if (!szStatus)
continue;
if (mToolTipTrayTips) {
@@ -191,7 +191,7 @@ int fnTrayIconAdd(HWND hwnd, const char *szProto, const char *szIconProto, int s nid.uFlags |= NIF_INFO;
cli.pfnTrayIconMakeTooltip(NULL, cli.trayIcon[i].szProto);
- if ( !mToolTipTrayTips)
+ if (!mToolTipTrayTips)
lstrcpyn(nid.szTip, cli.szTip, SIZEOF(nid.szTip));
cli.trayIcon[i].ptszToolTip = mir_tstrdup(cli.szTip);
@@ -251,7 +251,7 @@ int fnTrayIconInit(HWND hwnd) if (trayIconSetting == SETTING_TRAYICON_SINGLE) {
DBVARIANT dbv = { DBVT_DELETED };
char *szProto;
- if ( !db_get_s(NULL, "CList", "PrimaryStatus", &dbv)
+ if (!db_get_s(NULL, "CList", "PrimaryStatus", &dbv)
&& (averageMode < 0 || db_get_b(NULL, "CList", "AlwaysPrimary", 0)))
szProto = dbv.pszVal;
else
@@ -338,7 +338,7 @@ int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPrefer nid.hWnd = cli.hwndContactList;
nid.uFlags = NIF_ICON | NIF_TIP;
nid.hIcon = hNewIcon;
- if ( !hNewIcon)
+ if (!hNewIcon)
return -1;
int i;
@@ -352,7 +352,7 @@ int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPrefer cli.pfnTrayIconMakeTooltip(szNewTip, cli.trayIcon[i].szProto);
mir_free(cli.trayIcon[i].ptszToolTip);
cli.trayIcon[i].ptszToolTip = mir_tstrdup(cli.szTip);
- if ( !mToolTipTrayTips)
+ if (!mToolTipTrayTips)
lstrcpyn(nid.szTip, cli.szTip, SIZEOF(nid.szTip));
Shell_NotifyIcon(NIM_MODIFY, &nid);
@@ -374,7 +374,7 @@ int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPrefer cli.pfnTrayIconMakeTooltip(szNewTip, cli.trayIcon[i].szProto);
mir_free(cli.trayIcon[i].ptszToolTip);
cli.trayIcon[i].ptszToolTip = mir_tstrdup(cli.szTip);
- if ( !mToolTipTrayTips)
+ if (!mToolTipTrayTips)
lstrcpyn(nid.szTip, cli.szTip, SIZEOF(nid.szTip));
Shell_NotifyIcon(NIM_MODIFY, &nid);
@@ -399,7 +399,7 @@ int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPrefer int fnTrayIconSetBaseInfo(HICON hIcon, const char *szPreferredProto)
{
- if ( !fTrayInited) {
+ if (!fTrayInited) {
LBL_Error:
DestroyIcon(hIcon);
return -1;
@@ -470,7 +470,7 @@ void fnTrayIconUpdateBase(const char *szChangedProto) {
initcheck;
if (szChangedProto == NULL) return;
- if ( !cli.pfnGetProtocolVisibility(szChangedProto)) return;
+ if (!cli.pfnGetProtocolVisibility(szChangedProto)) return;
int netProtoCount;
mir_cslock lck(trayLockCS);
@@ -482,7 +482,7 @@ void fnTrayIconUpdateBase(const char *szChangedProto) }
for (int i=0; i < accounts.getCount(); i++)
- if ( !lstrcmpA(szChangedProto, accounts[i]->szModuleName))
+ if (!lstrcmpA(szChangedProto, accounts[i]->szModuleName))
cli.cycleStep = i;
int changed = cli.pfnTrayCalcChanged(szChangedProto, averageMode, netProtoCount);
@@ -519,7 +519,7 @@ int fnTrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoC ILD_NORMAL), NULL);
case SETTING_TRAYICON_MULTI:
- if ( !cli.trayIcon)
+ if (!cli.trayIcon)
cli.pfnTrayIconRemove(NULL, NULL);
else if ((cli.trayIconCount > 1 || netProtoCount == 1) || db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
return cli.pfnTrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(NULL, szChangedProto, CallProtoServiceInt(NULL,szChangedProto, PS_GETSTATUS, 0, 0)), (char*)szChangedProto);
@@ -624,7 +624,7 @@ static void CALLBACK TrayHideToolTipTimerProc(HWND hwnd, UINT, UINT_PTR, DWORD) static void CALLBACK TrayToolTipTimerProc(HWND hwnd, UINT, UINT_PTR id, DWORD)
{
- if ( !g_trayTooltipActive && !cli.bTrayMenuOnScreen) {
+ if (!g_trayTooltipActive && !cli.bTrayMenuOnScreen) {
POINT pt;
GetCursorPos(&pt);
if (abs(pt.x - tray_hover_pos.x) <= TOOLTIP_TOLERANCE && abs(pt.y - tray_hover_pos.y) <= TOOLTIP_TOLERANCE) {
@@ -698,7 +698,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) {
if ((unsigned)cli.trayIcon[i].id == msg->wParam)
{
- if ( !cli.trayIcon[i].szProto) break;
+ if (!cli.trayIcon[i].szProto) break;
int ind = 0;
for (int j = 0; j < accounts.getCount(); j++)
@@ -706,7 +706,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) int k = cli.pfnGetAccountIndexByPos(j);
if (k >= 0)
{
- if ( !strcmp(cli.trayIcon[i].szProto, accounts[k]->szModuleName))
+ if (!strcmp(cli.trayIcon[i].szProto, accounts[k]->szModuleName))
{
HMENU hm = GetSubMenu(hMenu, ind);
if (hm) hMenu = hm;
@@ -811,7 +811,7 @@ int fnCListTrayNotify(MIRANDASYSTRAYNOTIFY* msn) if (msn->szProto) {
for (int j = 0; j < cli.trayIconCount; j++) {
if (cli.trayIcon[j].szProto != NULL) {
- if ( !strcmp(msn->szProto, cli.trayIcon[j].szProto)) {
+ if (!strcmp(msn->szProto, cli.trayIcon[j].szProto)) {
iconId = cli.trayIcon[j].id;
break;
}
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index 569c8c9556..559e9b2b13 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -93,7 +93,7 @@ static int MenuItem_PreBuild(WPARAM, LPARAM) HWND hwndClist = GetFocus();
GetClassName(hwndClist, cls, SIZEOF(cls));
- hwndClist = ( !lstrcmp( _T(CLISTCONTROL_CLASS), cls)) ? hwndClist : cli.hwndContactList;
+ hwndClist = (!lstrcmp( _T(CLISTCONTROL_CLASS), cls)) ? hwndClist : cli.hwndContactList;
hItem = (HANDLE) SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
Menu_ShowItem(hRenameMenuItem, hItem != 0);
return 0;
@@ -106,7 +106,7 @@ static INT_PTR MenuItem_RenameContact(WPARAM, LPARAM) HWND hwndClist = GetFocus();
GetClassName(hwndClist, cls, SIZEOF(cls));
// worst case scenario, the rename is sent to the main contact list
- hwndClist = ( !lstrcmp( _T(CLISTCONTROL_CLASS), cls)) ? hwndClist : cli.hwndContactList;
+ hwndClist = (!lstrcmp( _T(CLISTCONTROL_CLASS), cls)) ? hwndClist : cli.hwndContactList;
hItem = (HANDLE) SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
if (hItem) {
SetFocus(hwndClist);
@@ -336,7 +336,7 @@ int LoadCLUIModule(void) int state = db_get_b(NULL, "CList", "State", SETTING_STATE_NORMAL);
cli.hMenuMain = GetMenu(cli.hwndContactList);
- if ( !db_get_b(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT))
+ if (!db_get_b(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT))
SetMenu(cli.hwndContactList, NULL);
if (state == SETTING_STATE_NORMAL)
ShowWindow(cli.hwndContactList, SW_SHOW);
@@ -550,12 +550,12 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
// drop thru
case WM_MOVE:
- if ( !IsIconic(hwnd)) {
+ if (!IsIconic(hwnd)) {
RECT rc;
GetWindowRect(hwnd, &rc);
//if docked, dont remember pos (except for width)
- if ( !CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) {
+ if (!CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) {
db_set_dw(NULL, "CList", "Height", (DWORD) (rc.bottom - rc.top));
db_set_dw(NULL, "CList", "x", (DWORD) rc.left);
db_set_dw(NULL, "CList", "y", (DWORD) rc.top);
@@ -586,7 +586,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case WM_SETCURSOR:
if (cluiopt.transparent) {
- if ( !transparentFocus && GetForegroundWindow() != hwnd) {
+ if (!transparentFocus && GetForegroundWindow() != hwnd) {
SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)cluiopt.alpha, LWA_ALPHA);
transparentFocus = 1;
SetTimer(hwnd, TM_AUTOALPHA, 250, NULL);
@@ -628,7 +628,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM else
SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
}
- if ( !transparentFocus)
+ if (!transparentFocus)
KillTimer(hwnd, TM_AUTOALPHA);
}
return TRUE;
@@ -638,7 +638,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
if (noRecurse)
break;
- if ( !db_get_b(NULL, "CLUI", "FadeInOut", 0))
+ if (!db_get_b(NULL, "CLUI", "FadeInOut", 0))
break;
if (GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_LAYERED) {
DWORD thisTick, startTick;
@@ -792,7 +792,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case CLN_DRAGGING:
ClientToScreen(hwnd, &nmc->pt);
- if ( !(nmc->flags & CLNF_ISGROUP))
+ if (!(nmc->flags & CLNF_ISGROUP))
if (NotifyEventHooks(hContactDraggingEvent, (WPARAM) nmc->hItem, MAKELPARAM(nmc->pt.x, nmc->pt.y))) {
SetCursor(LoadCursor(cli.hInst, MAKEINTRESOURCE(IDC_DROPUSER)));
return TRUE;
@@ -800,13 +800,13 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
case CLN_DRAGSTOP:
- if ( !(nmc->flags & CLNF_ISGROUP))
+ if (!(nmc->flags & CLNF_ISGROUP))
NotifyEventHooks(hContactDragStopEvent, (WPARAM) nmc->hItem, 0);
break;
case CLN_DROPPED:
ClientToScreen(hwnd, &nmc->pt);
- if ( !(nmc->flags & CLNF_ISGROUP))
+ if (!(nmc->flags & CLNF_ISGROUP))
if (NotifyEventHooks(hContactDroppedEvent, (WPARAM) nmc->hItem, MAKELPARAM(nmc->pt.x, nmc->pt.y))) {
SetCursor(LoadCursor(cli.hInst, MAKEINTRESOURCE(IDC_DROPUSER)));
return TRUE;
@@ -830,7 +830,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM RECT rcWindow, rcTree, rcWorkArea;
int maxHeight, newHeight;
- if ( !db_get_b(NULL, "CLUI", "AutoSize", 0))
+ if (!db_get_b(NULL, "CLUI", "AutoSize", 0))
break;
if (CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0))
break;
@@ -868,7 +868,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM HANDLE hItem = (HANDLE)SendMessage(cli.hwndContactTree, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nmc->pt.x, nmc->pt.y));
if (hItem) {
if (hitFlags & CLCHT_ONITEMEXTRA) {
- if ( !IsHContactGroup(hItem) && !IsHContactInfo(hItem))
+ if (!IsHContactGroup(hItem) && !IsHContactInfo(hItem))
if ( cli.pfnGetCacheEntry(nmc->hItem))
NotifyEventHooks(hEventExtraClick, (WPARAM)nmc->hItem, nmc->iColumn+1);
}
@@ -930,7 +930,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM int pos = LOWORD(wParam);
POINT pt;
GetCursorPos(&pt);
- if ((pos == 0 || pos == 1) && (HIWORD(wParam) & MF_POPUP) && ( !(HIWORD(wParam) & MF_MOUSESELECT) || MenuItemFromPoint(hwnd, cli.hMenuMain, pt) != -1)) {
+ if ((pos == 0 || pos == 1) && (HIWORD(wParam) & MF_POPUP) && (!(HIWORD(wParam) & MF_MOUSESELECT) || MenuItemFromPoint(hwnd, cli.hMenuMain, pt) != -1)) {
MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_SUBMENU;
mii.hSubMenu = (HMENU)CallService((pos == 0) ? MS_CLIST_MENUGETMAIN : MS_CLIST_MENUGETSTATUS, 0, 0);
@@ -952,7 +952,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, 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;
}
@@ -1036,7 +1036,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
if (showOpts & 4) {
TCHAR* szStatus = cli.pfnGetStatusModeDescription(status, 0);
- if ( !szStatus)
+ if (!szStatus)
szStatus = _T("");
GetTextExtentPoint32(dis->hDC, szStatus, lstrlen(szStatus), &textSize);
TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szStatus, lstrlen(szStatus));
@@ -1060,12 +1060,12 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM return FALSE;
case WM_DESTROY:
- if ( !IsIconic(hwnd)) {
+ if (!IsIconic(hwnd)) {
RECT rc;
GetWindowRect(hwnd, &rc);
//if docked, dont remember pos (except for width)
- if ( !CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) {
+ if (!CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) {
db_set_dw(NULL, "CList", "Height", (DWORD) (rc.bottom - rc.top));
db_set_dw(NULL, "CList", "x", (DWORD) rc.left);
db_set_dw(NULL, "CList", "y", (DWORD) rc.top);
diff --git a/src/modules/clist/cluiservices.cpp b/src/modules/clist/cluiservices.cpp index 01c82f9b86..e3702d61cc 100644 --- a/src/modules/clist/cluiservices.cpp +++ b/src/modules/clist/cluiservices.cpp @@ -44,7 +44,7 @@ static INT_PTR GroupAdded(WPARAM wParam, LPARAM lParam) HWND hwndFocus = GetFocus();
GetClassName(hwndFocus, szFocusClass, SIZEOF(szFocusClass));
- if ( !lstrcmp(szFocusClass, _T(CLISTCONTROL_CLASS))) {
+ if (!lstrcmp(szFocusClass, _T(CLISTCONTROL_CLASS))) {
hItem = (HANDLE) SendMessage(hwndFocus, CLM_FINDGROUP, wParam, 0);
if (hItem)
SendMessage(hwndFocus, CLM_EDITLABEL, (WPARAM) hItem, 0);
diff --git a/src/modules/clist/contact.cpp b/src/modules/clist/contact.cpp index 997061b117..4a7be77ba1 100644 --- a/src/modules/clist/contact.cpp +++ b/src/modules/clist/contact.cpp @@ -80,7 +80,7 @@ void fnLoadContactTree(void) int hideOffline = db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
int status = GetContactStatus(hContact);
- if (( !hideOffline || status != ID_STATUS_OFFLINE) && !db_get_b(hContact, "CList", "Hidden", 0))
+ if ((!hideOffline || status != ID_STATUS_OFFLINE) && !db_get_b(hContact, "CList", "Hidden", 0))
cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode(GetContactProto(hContact), status, hContact), 1);
}
sortByStatus = db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT);
diff --git a/src/modules/clist/contacts.cpp b/src/modules/clist/contacts.cpp index 845e8f2736..77e3145a0d 100644 --- a/src/modules/clist/contacts.cpp +++ b/src/modules/clist/contacts.cpp @@ -59,12 +59,12 @@ static int GetDatabaseString(CONTACTINFO *ci, const char* setting, DBVARIANT* db static int ProcessDatabaseValueDefault(CONTACTINFO *ci, const char* setting)
{
DBVARIANT dbv;
- if ( !GetDatabaseString(ci, setting, &dbv)) {
+ if (!GetDatabaseString(ci, setting, &dbv)) {
switch (dbv.type) {
case DBVT_ASCIIZ:
- if ( !dbv.pszVal[0]) break;
+ if (!dbv.pszVal[0]) break;
case DBVT_WCHAR:
- if ( !dbv.pwszVal[0]) break;
+ if (!dbv.pwszVal[0]) break;
ci->type = CNFT_ASCIIZ;
ci->pszVal = dbv.ptszVal;
return 0;
@@ -145,10 +145,10 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) { }
case CNF_COUNTRY:
case CNF_COCOUNTRY:
- if ( !GetDatabaseString(ci, (ci->dwFlag & 0x7F) == CNF_COUNTRY ? "CountryName" : "CompanyCountryName", &dbv))
+ if (!GetDatabaseString(ci, (ci->dwFlag & 0x7F) == CNF_COUNTRY ? "CountryName" : "CompanyCountryName", &dbv))
return 0;
- if ( !db_get(ci->hContact, ci->szProto, (ci->dwFlag & 0x7F) == CNF_COUNTRY ? "Country" : "CompanyCountry", &dbv)) {
+ if (!db_get(ci->hContact, ci->szProto, (ci->dwFlag & 0x7F) == CNF_COUNTRY ? "Country" : "CompanyCountry", &dbv)) {
if (dbv.type == DBVT_WORD) {
int i, countryCount;
struct CountryListEntry *countries;
@@ -176,9 +176,9 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) { break;
case CNF_FIRSTLAST:
- if ( !GetDatabaseString(ci, "FirstName", &dbv)) {
+ if (!GetDatabaseString(ci, "FirstName", &dbv)) {
DBVARIANT dbv2;
- if ( !GetDatabaseString(ci, "LastName", &dbv2)) {
+ if (!GetDatabaseString(ci, "LastName", &dbv2)) {
ci->type = CNFT_ASCIIZ;
if (ci->dwFlag & CNF_UNICODE) {
size_t len = wcslen(dbv.pwszVal) + wcslen(dbv2.pwszVal) + 2;
@@ -206,18 +206,18 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) { {
char *uid = (char*)CallProtoService(ci->szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid)
- if ( !ProcessDatabaseValueDefault(ci, uid))
+ if (!ProcessDatabaseValueDefault(ci, uid))
return 0;
break;
}
case CNF_DISPLAYUID:
{
- if ( !ProcessDatabaseValueDefault(ci, "display_uid"))
+ if (!ProcessDatabaseValueDefault(ci, "display_uid"))
return 0;
char *uid = (char*)CallProtoService(ci->szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid)
- if ( !ProcessDatabaseValueDefault(ci, uid))
+ if (!ProcessDatabaseValueDefault(ci, uid))
return 0;
break;
@@ -241,19 +241,19 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) { break;
}
case 1:
- if ( !ProcessDatabaseValueDefault(ci, "Nick")) // nick
+ if (!ProcessDatabaseValueDefault(ci, "Nick")) // nick
return 0;
break;
case 2:
- if ( !ProcessDatabaseValueDefault(ci, "FirstName")) // First Name
+ if (!ProcessDatabaseValueDefault(ci, "FirstName")) // First Name
return 0;
break;
case 3:
- if ( !ProcessDatabaseValueDefault(ci, "e-mail")) // E-mail
+ if (!ProcessDatabaseValueDefault(ci, "e-mail")) // E-mail
return 0;
break;
case 4:
- if ( !ProcessDatabaseValueDefault(ci, "LastName")) // Last Name
+ if (!ProcessDatabaseValueDefault(ci, "LastName")) // Last Name
return 0;
break;
case 5: // Unique id
@@ -261,7 +261,7 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) { // protocol must define a PFLAG_UNIQUEIDSETTING
char *uid = (char*)CallProtoService(ci->szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid) {
- if ( !GetDatabaseString(ci, uid, &dbv)) {
+ if (!GetDatabaseString(ci, uid, &dbv)) {
if (dbv.type == DBVT_BYTE || dbv.type == DBVT_WORD || dbv.type == DBVT_DWORD) {
long value = (dbv.type == DBVT_BYTE) ? dbv.bVal:(dbv.type == DBVT_WORD ? dbv.wVal : dbv.dVal);
if (ci->dwFlag & CNF_UNICODE) {
@@ -293,9 +293,9 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) { }
case 6: // first + last name
case 7: // last + first name
- if ( !GetDatabaseString(ci, nameOrder[i] == 6 ? "FirstName" : "LastName", &dbv)) {
+ if (!GetDatabaseString(ci, nameOrder[i] == 6 ? "FirstName" : "LastName", &dbv)) {
DBVARIANT dbv2;
- if ( !GetDatabaseString(ci, nameOrder[i] == 6 ? "LastName" : "FirstName", &dbv2)) {
+ if (!GetDatabaseString(ci, nameOrder[i] == 6 ? "LastName" : "FirstName", &dbv2)) {
ci->type = CNFT_ASCIIZ;
if (ci->dwFlag & CNF_UNICODE) {
@@ -350,7 +350,7 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) { }
case CNF_MYNOTES: {
char* saveProto = ci->szProto; ci->szProto = "UserInfo";
- if ( !ProcessDatabaseValueDefault(ci, "MyNotes")) {
+ if (!ProcessDatabaseValueDefault(ci, "MyNotes")) {
ci->szProto = saveProto;
return 0;
}
@@ -506,7 +506,7 @@ int LoadContactsModule(void) nameOrder[i] = i;
DBVARIANT dbv;
- if ( !db_get(NULL, "Contact", "NameOrder", &dbv)) {
+ if (!db_get(NULL, "Contact", "NameOrder", &dbv)) {
CopyMemory(nameOrder, dbv.pbVal, dbv.cpbVal);
db_free(&dbv);
}
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp index 3fa55b5f72..be411350a5 100644 --- a/src/modules/clist/genmenu.cpp +++ b/src/modules/clist/genmenu.cpp @@ -117,7 +117,7 @@ int MO_MeasureMenuItem(LPMEASUREITEMSTRUCT mis) mis->itemWidth = 0;
mis->itemHeight = 0;
- if ( !bIsGenMenuInited)
+ if (!bIsGenMenuInited)
return -1;
if (mis == NULL)
@@ -140,7 +140,7 @@ int MO_MeasureMenuItem(LPMEASUREITEMSTRUCT mis) //lparam = LPDRAWITEMSTRUCT
int MO_DrawMenuItem(LPDRAWITEMSTRUCT dis)
{
- if ( !bIsGenMenuInited)
+ if (!bIsGenMenuInited)
return -1;
if (dis == NULL)
@@ -193,7 +193,7 @@ int MO_RemoveAllObjects() //wparam = MenuObjectHandle
INT_PTR MO_RemoveMenuObject(WPARAM wParam, LPARAM)
{
- if ( !bIsGenMenuInited)
+ if (!bIsGenMenuInited)
return -1;
mir_cslock lck(csMenuHook);
@@ -210,7 +210,7 @@ INT_PTR MO_RemoveMenuObject(WPARAM wParam, LPARAM) //lparam = vKey
INT_PTR MO_ProcessHotKeys(HANDLE menuHandle, INT_PTR vKey)
{
- if ( !bIsGenMenuInited)
+ if (!bIsGenMenuInited)
return -1;
mir_cslock lck(csMenuHook);
@@ -221,9 +221,9 @@ INT_PTR MO_ProcessHotKeys(HANDLE menuHandle, INT_PTR vKey) for (PMO_IntMenuItem pimi = g_menus[objidx]->m_items.first; pimi != NULL; pimi = pimi->next) {
if (pimi->mi.hotKey == 0) continue;
if (HIWORD(pimi->mi.hotKey) != vKey) continue;
- if ( !(LOWORD(pimi->mi.hotKey) & MOD_ALT) != !(GetKeyState(VK_MENU) & 0x8000)) continue;
- if ( !(LOWORD(pimi->mi.hotKey) & MOD_CONTROL) != !(GetKeyState(VK_CONTROL) & 0x8000)) continue;
- if ( !(LOWORD(pimi->mi.hotKey) & MOD_SHIFT) != !(GetKeyState(VK_SHIFT) & 0x8000)) continue;
+ if (!(LOWORD(pimi->mi.hotKey) & MOD_ALT) != !(GetKeyState(VK_MENU) & 0x8000)) continue;
+ if (!(LOWORD(pimi->mi.hotKey) & MOD_CONTROL) != !(GetKeyState(VK_CONTROL) & 0x8000)) continue;
+ if (!(LOWORD(pimi->mi.hotKey) & MOD_SHIFT) != !(GetKeyState(VK_SHIFT) & 0x8000)) continue;
MO_ProcessCommand(pimi, 0);
return TRUE;
@@ -249,7 +249,7 @@ INT_PTR MO_GetProtoRootMenu(WPARAM wParam, LPARAM lParam) TIntMenuObject* pmo = g_menus[objidx];
for (PMO_IntMenuItem p = pmo->m_items.first; p != NULL; p = p->next)
- if ( !lstrcmpA(p->UniqName, szProto))
+ if (!lstrcmpA(p->UniqName, szProto))
return (INT_PTR)p;
return NULL;
@@ -260,7 +260,7 @@ INT_PTR MO_GetProtoRootMenu(WPARAM wParam, LPARAM lParam) INT_PTR MO_GetMenuItem(WPARAM wParam, LPARAM lParam)
{
PMO_MenuItem mi = (PMO_MenuItem)lParam;
- if ( !bIsGenMenuInited || mi == NULL)
+ if (!bIsGenMenuInited || mi == NULL)
return -1;
PMO_IntMenuItem pimi = MO_GetIntMenuItem((HGENMENU)wParam);
@@ -282,7 +282,7 @@ static int FindDefaultItem(PMO_IntMenuItem pimi, void*) INT_PTR MO_GetDefaultMenuItem(WPARAM wParam, LPARAM)
{
- if ( !bIsGenMenuInited)
+ if (!bIsGenMenuInited)
return -1;
PMO_IntMenuItem pimi = MO_GetIntMenuItem((HGENMENU)wParam);
@@ -296,7 +296,7 @@ int MO_ModifyMenuItem(PMO_IntMenuItem menuHandle, PMO_MenuItem pmi) {
int oldflags;
- if ( !bIsGenMenuInited || pmi == NULL || pmi->cbSize != sizeof(TMO_MenuItem))
+ if (!bIsGenMenuInited || pmi == NULL || pmi->cbSize != sizeof(TMO_MenuItem))
return -1;
mir_cslock lck(csMenuHook);
@@ -354,7 +354,7 @@ int MO_ModifyMenuItem(PMO_IntMenuItem menuHandle, PMO_MenuItem pmi) //NULL on error.
INT_PTR MO_MenuItemGetOwnerData(WPARAM wParam, LPARAM)
{
- if ( !bIsGenMenuInited)
+ if (!bIsGenMenuInited)
return -1;
mir_cslock lck(csMenuHook);
@@ -390,7 +390,7 @@ static int FindMenuByCommand(PMO_IntMenuItem pimi, void* pCommand) int MO_ProcessCommandBySubMenuIdent(int menuID, int command, LPARAM lParam)
{
- if ( !bIsGenMenuInited)
+ if (!bIsGenMenuInited)
return -1;
PMO_IntMenuItem pimi;
@@ -408,7 +408,7 @@ int MO_ProcessCommandBySubMenuIdent(int menuID, int command, LPARAM lParam) INT_PTR MO_ProcessCommandByMenuIdent(WPARAM wParam, LPARAM lParam)
{
- if ( !bIsGenMenuInited)
+ if (!bIsGenMenuInited)
return -1;
PMO_IntMenuItem pimi;
@@ -424,7 +424,7 @@ INT_PTR MO_ProcessCommandByMenuIdent(WPARAM wParam, LPARAM lParam) int MO_ProcessCommand(PMO_IntMenuItem aHandle, LPARAM lParam)
{
- if ( !bIsGenMenuInited)
+ if (!bIsGenMenuInited)
return -1;
PMO_IntMenuItem pimi;
@@ -442,7 +442,7 @@ int MO_ProcessCommand(PMO_IntMenuItem aHandle, LPARAM lParam) int MO_SetOptionsMenuItem(PMO_IntMenuItem aHandle, int setting, INT_PTR value)
{
- if ( !bIsGenMenuInited)
+ if (!bIsGenMenuInited)
return -1;
mir_cslock lck(csMenuHook);
@@ -460,7 +460,7 @@ int MO_SetOptionsMenuItem(PMO_IntMenuItem aHandle, int setting, INT_PTR value) int MO_SetOptionsMenuObject(HANDLE handle, int setting, INT_PTR value)
{
- if ( !bIsGenMenuInited)
+ if (!bIsGenMenuInited)
return -1;
mir_cslock lck(csMenuHook);
@@ -617,11 +617,11 @@ static int GetNextObjectMenuItemId() //return MenuItemHandle
PMO_IntMenuItem MO_AddNewMenuItem(HANDLE menuobjecthandle, PMO_MenuItem pmi)
{
- if ( !bIsGenMenuInited || pmi == NULL || pmi->cbSize != sizeof(TMO_MenuItem))
+ if (!bIsGenMenuInited || pmi == NULL || pmi->cbSize != sizeof(TMO_MenuItem))
return NULL;
//old mode
- if ( !(pmi->flags & CMIF_ROOTHANDLE))
+ if (!(pmi->flags & CMIF_ROOTHANDLE))
return MO_AddOldNewMenuItem(menuobjecthandle, pmi);
mir_cslock lck(csMenuHook);
@@ -666,7 +666,7 @@ PMO_IntMenuItem MO_AddNewMenuItem(HANDLE menuobjecthandle, PMO_MenuItem pmi) else
p->owner = &pmo->m_items;
- if ( !p->owner->first)
+ if (!p->owner->first)
p->owner->first = p;
if (p->owner->last)
p->owner->last->next = p;
@@ -688,7 +688,7 @@ int FindRoot(PMO_IntMenuItem pimi, void* param) PMO_IntMenuItem MO_AddOldNewMenuItem(HANDLE menuobjecthandle, PMO_MenuItem pmi)
{
- if ( !bIsGenMenuInited || pmi == NULL)
+ if (!bIsGenMenuInited || pmi == NULL)
return NULL;
int objidx = GetMenuObjbyId((int)menuobjecthandle);
@@ -793,7 +793,7 @@ static void InsertMenuItemWithSeparators(HMENU hMenu, int uItem, MENUITEMINFO *l if (p != NULL && fType != MFT_SEPARATOR) {
if ((p->mi.position / SEPARATORPOSITIONINTERVAL) != (pimi->mi.position / SEPARATORPOSITIONINTERVAL)) {
//but might be supposed to be after the next one instead
- if ( !(uItem < GetMenuItemCount(hMenu) && GetMenuItemType(hMenu, uItem) == MFT_SEPARATOR))
+ if (!(uItem < GetMenuItemCount(hMenu) && GetMenuItemType(hMenu, uItem) == MFT_SEPARATOR))
InsertSeparator(hMenu, uItem);
uItem++;
}
@@ -813,7 +813,7 @@ static void InsertMenuItemWithSeparators(HMENU hMenu, int uItem, MENUITEMINFO *l int count = GetMenuItemCount(hMenu);
if (count != 0 && (count % 33) == 0 && pimi->mi.root != NULL) {
- if ( !(mii.fMask & MIIM_FTYPE))
+ if (!(mii.fMask & MIIM_FTYPE))
mii.fType = 0;
mii.fMask |= MIIM_FTYPE;
mii.fType |= MFT_MENUBARBREAK;
@@ -832,7 +832,7 @@ static void InsertMenuItemWithSeparators(HMENU hMenu, int uItem, MENUITEMINFO *l INT_PTR MO_BuildMenu(WPARAM wParam, LPARAM lParam)
{
- if ( !bIsGenMenuInited)
+ if (!bIsGenMenuInited)
return -1;
mir_cslock lck(csMenuHook);
@@ -912,14 +912,14 @@ HMENU BuildRecursiveMenu(HMENU hMenu, PMO_IntMenuItem pRootMenu, ListParam *para db_set_b(NULL, MenuNameItems, DBString, 1);
pmi->OverrideShow = TRUE;
- if ( !db_get_b(NULL, MenuNameItems, DBString, 1)) {
+ if (!db_get_b(NULL, MenuNameItems, DBString, 1)) {
pmi->OverrideShow = FALSE;
continue; // find out what value to return if not getting added
}
// mi.pszName
mir_snprintf(DBString, SIZEOF(DBString), "%s_name", menuItemName);
- if ( !db_get_ts(NULL, MenuNameItems, DBString, &dbv)) {
+ if (!db_get_ts(NULL, MenuNameItems, DBString, &dbv)) {
if (_tcslen(dbv.ptszVal) > 0)
replaceStrT(pmi->CustomName, dbv.ptszVal);
db_free(&dbv);
@@ -1038,10 +1038,10 @@ static int MO_RegisterIcon(PMO_IntMenuItem pmi, void*) TCHAR *uname = (pmi->UniqName) ? mir_a2t(pmi->UniqName) : mir_tstrdup(pmi->CustomName),
*descr = GetMenuItemText(pmi);
- if ( !uname && !descr)
+ if (!uname && !descr)
return FALSE;
- if ( !pmi->hIcolibItem) {
+ if (!pmi->hIcolibItem) {
HICON hIcon = ImageList_GetIcon(pmi->parent->m_hMenuIcons, pmi->iconId, 0);
TCHAR sectionName[256];
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp index 6511c2d2b5..d21c7c7fd5 100644 --- a/src/modules/clist/genmenuopt.cpp +++ b/src/modules/clist/genmenuopt.cpp @@ -70,7 +70,7 @@ static BOOL GetCurrentMenuObjectID(HWND hwndDlg, int* result) static int SaveTree(HWND hwndDlg)
{
int MenuObjectId;
- if ( !GetCurrentMenuObjectID(hwndDlg, &MenuObjectId))
+ if (!GetCurrentMenuObjectID(hwndDlg, &MenuObjectId))
return 0;
HWND hTree = GetDlgItem(hwndDlg, IDC_MENUITEMS);
@@ -255,7 +255,7 @@ static int BuildTree(HWND hwndDlg, int MenuObjectId, BOOL bReread) DBVARIANT dbv;
mir_snprintf(buf, SIZEOF(buf), "%s_name", menuItemName);
- if ( !db_get_ts(NULL, MenuNameItems, buf, &dbv)) {
+ if (!db_get_ts(NULL, MenuNameItems, buf, &dbv)) {
PD->name = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -348,7 +348,7 @@ static HTREEITEM MoveItemAbove(HWND hTreeWnd, HTREEITEM hItem, HTREEITEM hInsert TVITEM tvi = { 0 };
tvi.mask = TVIF_HANDLE | TVIF_PARAM;
tvi.hItem = hItem;
- if ( !SendMessage(hTreeWnd, TVM_GETITEM, 0, (LPARAM)&tvi))
+ if (!SendMessage(hTreeWnd, TVM_GETITEM, 0, (LPARAM)&tvi))
return NULL;
if (hItem && hInsertAfter) {
TVINSERTSTRUCT tvis;
@@ -362,9 +362,9 @@ static HTREEITEM MoveItemAbove(HWND hTreeWnd, HTREEITEM hItem, HTREEITEM hInsert tvis.item.cchTextMax = sizeof(name);
tvis.item.hItem = hItem;
tvis.item.iImage = tvis.item.iSelectedImage = ((MenuItemOptData*)tvi.lParam)->bShow;
- if ( !SendMessage(hTreeWnd, TVM_GETITEM, 0, (LPARAM)&tvis.item))
+ if (!SendMessage(hTreeWnd, TVM_GETITEM, 0, (LPARAM)&tvis.item))
return NULL;
- if ( !TreeView_DeleteItem(hTreeWnd, hItem))
+ if (!TreeView_DeleteItem(hTreeWnd, hItem))
return NULL;
tvis.hParent = NULL;
tvis.hInsertAfter = hInsertAfter;
@@ -391,7 +391,7 @@ LRESULT CALLBACK LBTNDOWNProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam tvi.hItem = hti.hItem;
TreeView_GetItem(tvw, &tvi);
- if ( !((MenuItemOptData *)tvi.lParam)->bIsSelected) { /* is not Selected*/
+ if (!((MenuItemOptData *)tvi.lParam)->bIsSelected) { /* is not Selected*/
// reset all selection except current
HTREEITEM hit;
hit = TreeView_GetRoot(tvw);
@@ -738,7 +738,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA break;
case WM_MOUSEMOVE:
- if ( !dat || !dat->dragging) break;
+ if (!dat || !dat->dragging) break;
{
TVHITTESTINFO hti;
@@ -751,7 +751,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA HTREEITEM it = hti.hItem;
hti.pt.y -= TreeView_GetItemHeight( GetDlgItem(hwndDlg, IDC_MENUITEMS))/2;
TreeView_HitTest( GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti);
- if ( !(hti.flags&TVHT_ABOVE))
+ if (!(hti.flags&TVHT_ABOVE))
TreeView_SetInsertMark( GetDlgItem(hwndDlg, IDC_MENUITEMS), hti.hItem, 1);
else
TreeView_SetInsertMark( GetDlgItem(hwndDlg, IDC_MENUITEMS), it, 0);
@@ -765,7 +765,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA break;
case WM_LBUTTONUP:
- if ( !dat->dragging)
+ if (!dat->dragging)
break;
TreeView_SetInsertMark( GetDlgItem(hwndDlg, IDC_MENUITEMS), NULL, 0);
@@ -814,7 +814,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA for (i=0; i<uSic; i++) {
if (insertAfter) insertAfter = MoveItemAbove(tvw, pSIT[i], insertAfter);
else break;
- if ( !i) FirstItem = insertAfter;
+ if (!i) FirstItem = insertAfter;
}
}
// free pointers...
diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp index 641e9c55af..b6162fc17e 100644 --- a/src/modules/clist/groups.cpp +++ b/src/modules/clist/groups.cpp @@ -53,7 +53,7 @@ static int GroupNameExists(const TCHAR *name, int skipGroup) if (grpName == NULL)
break;
- if ( !_tcscmp((TCHAR*)grpName+1, name))
+ if (!_tcscmp((TCHAR*)grpName+1, name))
return i+1;
}
return 0;
@@ -250,7 +250,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) _itoa(i, str, 10);
if (db_get_ts(NULL, "CListGroups", str, &dbv))
break;
- if ( !_tcsncmp(dbv.ptszVal + 1, name, len) && dbv.pszVal[len + 1] == '\\' && _tcschr(dbv.ptszVal + len + 2, '\\') == NULL) {
+ if (!_tcsncmp(dbv.ptszVal + 1, name, len) && dbv.pszVal[len + 1] == '\\' && _tcschr(dbv.ptszVal + len + 2, '\\') == NULL) {
if (szNewParent[0])
mir_sntprintf(szNewName, SIZEOF(szNewName), _T("%s\\%s"), szNewParent, dbv.ptszVal + len + 2);
else
@@ -294,7 +294,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) //must rename setting in all child contacts too
for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
ClcCacheEntry *cache = cli.pfnGetCacheEntry(hContact);
- if ( !lstrcmp(cache->tszGroup, oldName)) {
+ if (!lstrcmp(cache->tszGroup, oldName)) {
db_set_ts(hContact, "CList", "Group", szName);
mir_free(cache->tszGroup);
cache->tszGroup = 0;
@@ -314,7 +314,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) _itoa(i, idstr, 10);
if (db_get_ts(NULL, "CListGroups", idstr, &dbv))
break;
- if ( !_tcsncmp(dbv.ptszVal + 1, oldName, len) && dbv.ptszVal[len + 1] == '\\' && _tcschr(dbv.ptszVal + len + 2, '\\') == NULL) {
+ if (!_tcsncmp(dbv.ptszVal + 1, oldName, len) && dbv.ptszVal[len + 1] == '\\' && _tcschr(dbv.ptszVal + len + 2, '\\') == NULL) {
mir_sntprintf(szNewName, SIZEOF(szNewName), _T("%s\\%s"), szName, dbv.ptszVal + len + 2);
RenameGroupWithMove(i, szNewName, 0); //luckily, child groups will never need reordering
}
@@ -335,7 +335,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) _itoa(i, idstr, 10);
if (db_get_ts(NULL, "CListGroups", idstr, &dbv))
break;
- if ( !lstrcmp(dbv.ptszVal + 1, str)) {
+ if (!lstrcmp(dbv.ptszVal + 1, str)) {
if (i < groupId)
break; //is OK
MoveGroupBefore(groupId + 1, i + 2);
diff --git a/src/modules/clist/keyboard.cpp b/src/modules/clist/keyboard.cpp index 13092615f6..d339e73c4a 100644 --- a/src/modules/clist/keyboard.cpp +++ b/src/modules/clist/keyboard.cpp @@ -35,7 +35,7 @@ static INT_PTR hkHideShow(WPARAM, LPARAM) INT_PTR hkSearch(WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbv = {0};
- if ( !db_get_s(NULL, "CList", "SearchUrl", &dbv)) {
+ if (!db_get_s(NULL, "CList", "SearchUrl", &dbv)) {
CallService(MS_UTILS_OPENURL, db_get_b(NULL, "CList", "HKSearchNewWnd", 0), (LPARAM)dbv.pszVal);
db_free(&dbv);
}
diff --git a/src/modules/clist/movetogroup.cpp b/src/modules/clist/movetogroup.cpp index b296a1c3a3..00d6817fb8 100644 --- a/src/modules/clist/movetogroup.cpp +++ b/src/modules/clist/movetogroup.cpp @@ -87,7 +87,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) int i;
OBJLIST<GroupItemSort> groups(10, GroupItemSort::compare);
- if ( !hMoveToGroupItem) {
+ if (!hMoveToGroupItem) {
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 100000;
mi.pszName = LPGEN("&Move to group");
diff --git a/src/modules/clist/protocolorder.cpp b/src/modules/clist/protocolorder.cpp index a2bf6dd2ea..747f81ddf4 100644 --- a/src/modules/clist/protocolorder.cpp +++ b/src/modules/clist/protocolorder.cpp @@ -106,7 +106,7 @@ bool CheckProtocolOrder(void) static bool ProtoToInclude(PROTOACCOUNT *pa)
{
- if ( !Proto_IsAccountEnabled(pa))
+ if (!Proto_IsAccountEnabled(pa))
return false;
PROTOCOLDESCRIPTOR *pd = Proto_IsProtocolLoaded(pa->szProtoName);
@@ -130,7 +130,7 @@ static int FillTree(HWND hwnd) continue;
PROTOACCOUNT *pa = accounts[idx];
- if ( !ProtoToInclude(pa))
+ if (!ProtoToInclude(pa))
continue;
ProtocolData *PD = (ProtocolData*)mir_alloc(sizeof(ProtocolData));
@@ -273,7 +273,7 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM HTREEITEM it = hti.hItem;
hti.pt.y -= TreeView_GetItemHeight(hwndProtoOrder) / 2;
TreeView_HitTest(hwndProtoOrder, &hti);
- if ( !(hti.flags & TVHT_ABOVE))
+ if (!(hti.flags & TVHT_ABOVE))
TreeView_SetInsertMark(hwndProtoOrder, hti.hItem, 1);
else
TreeView_SetInsertMark(hwndProtoOrder, it, 0);
|