From 211967c3ae7d510f2e63aac7fe912d040ad1ebc3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 30 Oct 2015 16:41:09 +0000 Subject: old unused code that belongs to StdClist moved from the core to plugin git-svn-id: http://svn.miranda-ng.org/main/trunk@15652 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_clcmsgs.cpp | 168 ++++++++++++++-------------- 1 file changed, 83 insertions(+), 85 deletions(-) (limited to 'plugins/Clist_modern/src/modern_clcmsgs.cpp') diff --git a/plugins/Clist_modern/src/modern_clcmsgs.cpp b/plugins/Clist_modern/src/modern_clcmsgs.cpp index e8cf1a0e75..07ace535a6 100644 --- a/plugins/Clist_modern/src/modern_clcmsgs.cpp +++ b/plugins/Clist_modern/src/modern_clcmsgs.cpp @@ -41,12 +41,11 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP return 0; case CLM_AUTOREBUILD: - if (dat->force_in_dialog) + if (dat->force_in_dialog) { pcli->pfnSaveStateAndRebuildList(hwnd, dat); - else - clcSetDelayTimer(TIMERID_REBUILDAFTER, hwnd); - - pcli->bAutoRebuild = false; + pcli->bAutoRebuild = false; + } + else clcSetDelayTimer(TIMERID_REBUILDAFTER, hwnd); return 0; case CLM_SETFONT: @@ -62,17 +61,17 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP return 0; case CLM_SETHIDEEMPTYGROUPS: - { - BOOL old = ((GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) != 0); - if (wParam) - SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | CLS_HIDEEMPTYGROUPS); - else - SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) &~CLS_HIDEEMPTYGROUPS); - BOOL newval = ((GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) != 0); - if (newval != old) - pcli->pfnInitAutoRebuild(hwnd); - } - return 0; + { + BOOL old = ((GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) != 0); + if (wParam) + SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | CLS_HIDEEMPTYGROUPS); + else + SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) &~CLS_HIDEEMPTYGROUPS); + BOOL newval = ((GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) != 0); + if (newval != old) + pcli->pfnInitAutoRebuild(hwnd); + } + return 0; case CLM_SETTEXTCOLOR: if (wParam > FONTID_MODERN_MAX) break; @@ -105,76 +104,76 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP return 0; case CLM_GETNEXTITEM: - { - int i = 0; - if (wParam != CLGN_ROOT) { - if (!pcli->pfnFindItem(hwnd, dat, lParam, &contact, &group, NULL)) - return NULL; - i = List_IndexOf((SortedList*)&group->cl, contact); - if (i < 0) return 0; - } - switch (wParam) { - case CLGN_ROOT: - if (dat->list.cl.count) - return (LRESULT)pcli->pfnContactToHItem(dat->list.cl.items[0]); - else - return NULL; - case CLGN_CHILD: - if (contact->type != CLCIT_GROUP) - return NULL; - group = contact->group; - if (group->cl.count == 0) - return NULL; - return (LRESULT)pcli->pfnContactToHItem(group->cl.items[0]); - case CLGN_PARENT: - return group->groupId | HCONTACT_ISGROUP; - case CLGN_NEXT: - do { - if (++i >= group->cl.count) + { + int i = 0; + if (wParam != CLGN_ROOT) { + if (!pcli->pfnFindItem(hwnd, dat, lParam, &contact, &group, NULL)) return NULL; - } while (group->cl.items[i]->type == CLCIT_DIVIDER); - return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]); - case CLGN_PREVIOUS: - do { - if (--i < 0) + i = List_IndexOf((SortedList*)&group->cl, contact); + if (i < 0) return 0; + } + switch (wParam) { + case CLGN_ROOT: + if (dat->list.cl.count) + return (LRESULT)pcli->pfnContactToHItem(dat->list.cl.items[0]); + else + return NULL; + case CLGN_CHILD: + if (contact->type != CLCIT_GROUP) + return NULL; + group = contact->group; + if (group->cl.count == 0) + return NULL; + return (LRESULT)pcli->pfnContactToHItem(group->cl.items[0]); + case CLGN_PARENT: + return group->groupId | HCONTACT_ISGROUP; + case CLGN_NEXT: + do { + if (++i >= group->cl.count) + return NULL; + } while (group->cl.items[i]->type == CLCIT_DIVIDER); + return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]); + case CLGN_PREVIOUS: + do { + if (--i < 0) + return NULL; + } while (group->cl.items[i]->type == CLCIT_DIVIDER); + return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]); + case CLGN_NEXTCONTACT: + for (i++; i < group->cl.count; i++) + if (group->cl.items[i]->type == CLCIT_CONTACT) + break; + if (i >= group->cl.count) + return NULL; + return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]); + case CLGN_PREVIOUSCONTACT: + if (i >= group->cl.count) + return NULL; + for (i--; i >= 0; i--) + if (group->cl.items[i]->type == CLCIT_CONTACT) + break; + if (i < 0) return NULL; - } while (group->cl.items[i]->type == CLCIT_DIVIDER); - return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]); - case CLGN_NEXTCONTACT: - for (i++; i < group->cl.count; i++) - if (group->cl.items[i]->type == CLCIT_CONTACT) - break; - if (i >= group->cl.count) - return NULL; - return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]); - case CLGN_PREVIOUSCONTACT: - if (i >= group->cl.count) - return NULL; - for (i--; i >= 0; i--) - if (group->cl.items[i]->type == CLCIT_CONTACT) - break; - if (i < 0) - return NULL; - return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]); - case CLGN_NEXTGROUP: - for (i++; i < group->cl.count; i++) - if (group->cl.items[i]->type == CLCIT_GROUP) - break; - if (i >= group->cl.count) - return NULL; - return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]); - case CLGN_PREVIOUSGROUP: - if (i >= group->cl.count) - return NULL; - for (i--; i >= 0; i--) - if (group->cl.items[i]->type == CLCIT_GROUP) - break; - if (i < 0) - return NULL; - return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]); + return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]); + case CLGN_NEXTGROUP: + for (i++; i < group->cl.count; i++) + if (group->cl.items[i]->type == CLCIT_GROUP) + break; + if (i >= group->cl.count) + return NULL; + return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]); + case CLGN_PREVIOUSGROUP: + if (i >= group->cl.count) + return NULL; + for (i--; i >= 0; i--) + if (group->cl.items[i]->type == CLCIT_GROUP) + break; + if (i < 0) + return NULL; + return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]); + } } - } - return NULL; + return NULL; case CLM_SELECTITEM: ClcGroup *tgroup; @@ -198,8 +197,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP BYTE k = db_get_b(NULL, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT); if (k) { - for (int i = 0; i < mainindex; i++) - { + for (int i = 0; i < mainindex; i++) { ClcContact *tempCont = group->cl.items[i]; if (tempCont->type == CLCIT_CONTACT && tempCont->SubAllocated && tempCont->SubExpanded) index += tempCont->SubAllocated; -- cgit v1.2.3