diff options
author | George Hazan <george.hazan@gmail.com> | 2016-05-28 09:20:04 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-05-28 09:20:04 +0000 |
commit | 22d42330716a38bfe2faef08eec2b2d3cab1886d (patch) | |
tree | 520ebae4befdcba00e2262f061b1e3355f4938c3 /plugins/Clist_modern/src | |
parent | aa22627377b06fd781e1f3667ac48687dda03247 (diff) |
SortedList emulation expunged
git-svn-id: http://svn.miranda-ng.org/main/trunk@16878 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src')
-rw-r--r-- | plugins/Clist_modern/src/modern_cachefuncs.cpp | 20 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clc.cpp | 8 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcidents.cpp | 16 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcitems.cpp | 35 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcmsgs.cpp | 54 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcpaint.cpp | 40 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcutils.cpp | 6 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_rowheight_funcs.cpp | 18 |
8 files changed, 98 insertions, 99 deletions
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index 99d5a93fcc..de7d5078df 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -65,8 +65,8 @@ void Cache_GetText(ClcData *dat, ClcContact *contact) if (!dat->force_in_dialog) { if (dat->secondLine.show) - Cache_GetNthLineText(dat, contact->pce, 2);
- if (dat->thirdLine.show)
+ Cache_GetNthLineText(dat, contact->pce, 2); + if (dat->thirdLine.show) Cache_GetNthLineText(dat, contact->pce, 3); } } @@ -602,19 +602,19 @@ static BOOL ExecuteOnAllContactsOfGroup(ClcGroup *group, ExecuteOnAllContactsFun 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)) + for (int scanIndex = 0; scanIndex < group->cl.getCount(); scanIndex++) { + if (group->cl[scanIndex]->type == CLCIT_CONTACT) { + if (!func(group->cl[scanIndex], FALSE, param)) return FALSE; - if (group->cl.items[scanIndex]->iSubAllocated > 0) { - for (int i = 0; i < group->cl.items[scanIndex]->iSubAllocated; i++) - if (!func(&group->cl.items[scanIndex]->subcontacts[i], TRUE, param)) + if (group->cl[scanIndex]->iSubAllocated > 0) { + for (int i = 0; i < group->cl[scanIndex]->iSubAllocated; i++) + if (!func(&group->cl[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)) + else if (group->cl[scanIndex]->type == CLCIT_GROUP) + if (!ExecuteOnAllContactsOfGroup(group->cl[scanIndex]->group, func, param)) return FALSE; } diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index b4fdd72147..187c06b76d 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -211,14 +211,14 @@ static int clcSearchNextContact(HWND hwnd, ClcData *dat, int index, const TCHAR if (index == -1) fReturnAsFound = TRUE;
group->scanIndex = 0;
for (;;) {
- if (group->scanIndex == group->cl.count) {
+ if (group->scanIndex == group->cl.getCount()) {
if ((group = group->parent) == NULL)
break;
group->scanIndex++;
continue;
}
- ClcContact *cc = group->cl.items[group->scanIndex];
+ ClcContact *cc = group->cl[group->scanIndex];
if (cc->type != CLCIT_DIVIDER) {
bool found;
if (cc->type == CLCIT_GROUP) {
@@ -281,7 +281,7 @@ static BOOL clcItemNotHiddenOffline(ClcGroup *group, ClcContact *contact) static LRESULT clcOnCreate(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- dat = (ClcData*)mir_calloc(sizeof(ClcData));
+ dat = new ClcData();
SetWindowLongPtr(hwnd, 0, (LONG_PTR)dat);
dat->hCheckBoxTheme = xpt_AddThemeHandle(hwnd, L"BUTTON");
dat->m_paintCouter = 0;
@@ -1404,7 +1404,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam if (hSelItem) {
if (pcli->pfnFindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, NULL))
- dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf((SortedList*)&selgroup->cl, selcontact));
+ dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
else
dat->selection = -1;
}
diff --git a/plugins/Clist_modern/src/modern_clcidents.cpp b/plugins/Clist_modern/src/modern_clcidents.cpp index 27d645eb3c..8cb539e218 100644 --- a/plugins/Clist_modern/src/modern_clcidents.cpp +++ b/plugins/Clist_modern/src/modern_clcidents.cpp @@ -26,8 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. int GetContactIndex(ClcGroup *group, ClcContact *contact)
{
- for (int i = 0; i < group->cl.count; i++)
- if (group->cl.items[i]->hContact == contact->hContact)
+ for (int i = 0; i < group->cl.getCount(); i++)
+ if (group->cl[i]->hContact == contact->hContact)
return i;
return -1;
@@ -40,7 +40,7 @@ int cliGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex) bool bMetaExpanding = db_get_b(NULL, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT) != 0;
group->scanIndex = 0;
for (;;) {
- if (group->scanIndex == group->cl.count) {
+ if (group->scanIndex == group->cl.getCount()) {
if ((group = group->parent) == NULL)
break;
group->scanIndex++;
@@ -49,7 +49,7 @@ int cliGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex) if (group == subgroup && contactIndex - subcontactscount == group->scanIndex) return count;
count++;
- ClcContact *cc = group->cl.items[group->scanIndex];
+ ClcContact *cc = group->cl[group->scanIndex];
if (cc->type == CLCIT_GROUP) {
if (cc->group == subgroup && contactIndex == -1)
return count - 1;
@@ -92,7 +92,7 @@ int FindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGro group = &dat->list;
for (;;) {
- if (group->scanIndex == group->cl.count) {
+ if (group->scanIndex == group->cl.getCount()) {
if ((group = group->parent) == NULL)
break;
@@ -110,7 +110,7 @@ int FindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGro if (nowVisible)
index++;
- ClcContact *cc = group->cl.items[group->scanIndex];
+ ClcContact *cc = group->cl[group->scanIndex];
if ((IsHContactGroup(dwItem) && cc->type == CLCIT_GROUP && (dwItem & ~HCONTACT_ISGROUP) == cc->groupId) ||
(IsHContactContact(dwItem) && cc->type == CLCIT_CONTACT && cc->hContact == dwItem) ||
(IsHContactInfo(dwItem) && cc->type == CLCIT_INFO && cc->hContact == (dwItem & ~HCONTACT_ISINFO))) {
@@ -167,14 +167,14 @@ int cliGetRowByIndex(ClcData *dat, int testindex, ClcContact **contact, ClcGroup group->scanIndex = 0;
for (;;) {
- if (group->scanIndex == group->cl.count) {
+ if (group->scanIndex == group->cl.getCount()) {
if ((group = group->parent) == NULL)
break;
group->scanIndex++;
continue;
}
- ClcContact *cc = group->cl.items[group->scanIndex];
+ ClcContact *cc = group->cl[group->scanIndex];
if (testindex == index) {
if (contact) *contact = cc;
if (subgroup) *subgroup = group;
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index fc14c85bc9..578a8b8fd0 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -172,14 +172,14 @@ static ClcContact* AddContactToGroup(ClcData *dat, ClcGroup *group, MCONTACT hCo dat->bNeedsResort = true;
int i;
- for (i = group->cl.count - 1; i >= 0; i--)
- if (group->cl.items[i]->type != CLCIT_INFO || !(group->cl.items[i]->flags & CLCIIF_BELOWCONTACTS))
+ for (i = group->cl.getCount() - 1; i >= 0; i--)
+ if (group->cl[i]->type != CLCIT_INFO || !(group->cl[i]->flags & CLCIIF_BELOWCONTACTS))
break;
i = pcli->pfnAddItemToGroup(group, i + 1);
- _LoadDataToContact(group->cl.items[i], group, dat, hContact);
- return group->cl.items[i];
+ _LoadDataToContact(group->cl[i], group, dat, hContact);
+ return group->cl[i];
}
void cli_AddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTotalCount, int checkHideOffline)
@@ -228,9 +228,9 @@ int RestoreSelection(ClcData *dat, MCONTACT hSelected) }
if (!selcontact->iSubNumber)
- dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf((SortedList*)&selgroup->cl, selcontact));
+ dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
else {
- dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf((SortedList*)&selgroup->cl, selcontact->subcontacts));
+ dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact->subcontacts));
if (dat->selection != -1)
dat->selection += selcontact->iSubNumber;
}
@@ -251,9 +251,8 @@ void cliRebuildEntireList(HWND hwnd, ClcData *dat) RowHeights_GetMaxRowHeight(dat, hwnd);
dat->list.expanded = 1;
- dat->list.hideOffline = db_get_b(NULL, "CLC", "HideOfflineRoot", SETTING_HIDEOFFLINEATROOT_DEFAULT) && style&CLS_USEGROUPS;
- dat->list.cl.count = dat->list.cl.limit = 0;
- dat->list.cl.increment = 50;
+ dat->list.hideOffline = db_get_b(NULL, "CLC", "HideOfflineRoot", SETTING_HIDEOFFLINEATROOT_DEFAULT) && style & CLS_USEGROUPS;
+ dat->list.cl.destroy();
dat->bNeedsResort = true;
MCONTACT hSelected = SaveSelection(dat);
@@ -307,16 +306,16 @@ void cliRebuildEntireList(HWND hwnd, ClcData *dat) group = &dat->list;
group->scanIndex = 0;
for (;;) {
- if (group->scanIndex == group->cl.count) {
+ if (group->scanIndex == group->cl.getCount()) {
if ((group = group->parent) == NULL)
break;
group->scanIndex++;
continue;
}
- ClcContact *cc = group->cl.items[group->scanIndex];
+ ClcContact *cc = group->cl[group->scanIndex];
if (cc->type == CLCIT_GROUP) {
- if (cc->group->cl.count == 0)
+ if (cc->group->cl.getCount() == 0)
group = pcli->pfnRemoveItemFromGroup(hwnd, group, cc, 0);
else {
group = cc->group;
@@ -351,7 +350,7 @@ int GetNewSelection(ClcGroup *group, int selection, int direction) group->scanIndex = 0;
for (;;) {
- if (group->scanIndex == group->cl.count) {
+ if (group->scanIndex == group->cl.getCount()) {
if ((group = group->parent) == NULL)
break;
group->scanIndex++;
@@ -366,7 +365,7 @@ int GetNewSelection(ClcGroup *group, int selection, int direction) if (!direction && count > selection)
return lastcount;
- ClcContact *cc = group->cl.items[group->scanIndex];
+ ClcContact *cc = group->cl[group->scanIndex];
if (cc->type == CLCIT_GROUP && (cc->group->expanded)) {
group = cc->group;
group->scanIndex = 0;
@@ -431,12 +430,12 @@ void cli_SetContactCheckboxes(ClcContact *cc, int checked) int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly)
{
- int count = group->cl.count;
+ int count = group->cl.getCount();
ClcGroup *topgroup = group;
group->scanIndex = 0;
for (;;) {
- if (group->scanIndex == group->cl.count) {
+ if (group->scanIndex == group->cl.getCount()) {
if (group == topgroup)
break;
group = group->parent;
@@ -444,11 +443,11 @@ int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly) continue;
}
- ClcContact *cc = group->cl.items[group->scanIndex];
+ ClcContact *cc = group->cl[group->scanIndex];
if (cc->type == CLCIT_GROUP && (!(visibleOnly & 0x01) || cc->group->expanded)) {
group = cc->group;
group->scanIndex = 0;
- count += group->cl.count;
+ count += group->cl.getCount();
continue;
}
if (cc->type == CLCIT_CONTACT && cc->subcontacts != NULL && (cc->bSubExpanded || !visibleOnly))
diff --git a/plugins/Clist_modern/src/modern_clcmsgs.cpp b/plugins/Clist_modern/src/modern_clcmsgs.cpp index 0f21a91832..8d540bf13b 100644 --- a/plugins/Clist_modern/src/modern_clcmsgs.cpp +++ b/plugins/Clist_modern/src/modern_clcmsgs.cpp @@ -108,68 +108,68 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP if (wParam != CLGN_ROOT) {
if (!pcli->pfnFindItem(hwnd, dat, lParam, &contact, &group, NULL))
return NULL;
- i = List_IndexOf((SortedList*)&group->cl, contact);
+ i = group->cl.indexOf(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]);
+ if (dat->list.cl.getCount())
+ return (LRESULT)pcli->pfnContactToHItem(dat->list.cl[0]);
else
return NULL;
case CLGN_CHILD:
if (contact->type != CLCIT_GROUP)
return NULL;
group = contact->group;
- if (group->cl.count == 0)
+ if (group->cl.getCount() == 0)
return NULL;
- return (LRESULT)pcli->pfnContactToHItem(group->cl.items[0]);
+ return (LRESULT)pcli->pfnContactToHItem(group->cl[0]);
case CLGN_PARENT:
return group->groupId | HCONTACT_ISGROUP;
case CLGN_NEXT:
do {
- if (++i >= group->cl.count)
+ if (++i >= group->cl.getCount())
return NULL;
- } while (group->cl.items[i]->type == CLCIT_DIVIDER);
- return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
+ } while (group->cl[i]->type == CLCIT_DIVIDER);
+ return (LRESULT)pcli->pfnContactToHItem(group->cl[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]);
+ } while (group->cl[i]->type == CLCIT_DIVIDER);
+ return (LRESULT)pcli->pfnContactToHItem(group->cl[i]);
case CLGN_NEXTCONTACT:
- for (i++; i < group->cl.count; i++)
- if (group->cl.items[i]->type == CLCIT_CONTACT)
+ for (i++; i < group->cl.getCount(); i++)
+ if (group->cl[i]->type == CLCIT_CONTACT)
break;
- if (i >= group->cl.count)
+ if (i >= group->cl.getCount())
return NULL;
- return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
+ return (LRESULT)pcli->pfnContactToHItem(group->cl[i]);
case CLGN_PREVIOUSCONTACT:
- if (i >= group->cl.count)
+ if (i >= group->cl.getCount())
return NULL;
for (i--; i >= 0; i--)
- if (group->cl.items[i]->type == CLCIT_CONTACT)
+ if (group->cl[i]->type == CLCIT_CONTACT)
break;
if (i < 0)
return NULL;
- return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
+ return (LRESULT)pcli->pfnContactToHItem(group->cl[i]);
case CLGN_NEXTGROUP:
- for (i++; i < group->cl.count; i++)
- if (group->cl.items[i]->type == CLCIT_GROUP)
+ for (i++; i < group->cl.getCount(); i++)
+ if (group->cl[i]->type == CLCIT_GROUP)
break;
- if (i >= group->cl.count)
+ if (i >= group->cl.getCount())
return NULL;
- return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
+ return (LRESULT)pcli->pfnContactToHItem(group->cl[i]);
case CLGN_PREVIOUSGROUP:
- if (i >= group->cl.count)
+ if (i >= group->cl.getCount())
return NULL;
for (i--; i >= 0; i--)
- if (group->cl.items[i]->type == CLCIT_GROUP)
+ if (group->cl[i]->type == CLCIT_GROUP)
break;
if (i < 0)
return NULL;
- return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
+ return (LRESULT)pcli->pfnContactToHItem(group->cl[i]);
}
}
return NULL;
@@ -185,11 +185,11 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP pcli->pfnSetGroupExpand(hwnd, dat, tgroup, 1);
if (!contact->iSubNumber) {
- index = List_IndexOf((SortedList*)&group->cl, contact);
+ index = group->cl.indexOf(contact);
mainindex = index;
}
else {
- index = List_IndexOf((SortedList*)&group->cl, contact->subcontacts);
+ index = group->cl.indexOf(contact->subcontacts);
mainindex = index;
index += contact->iSubNumber;
}
@@ -197,7 +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++) {
- ClcContact *tempCont = group->cl.items[i];
+ ClcContact *tempCont = group->cl[i];
if (tempCont->type == CLCIT_CONTACT && tempCont->iSubAllocated && tempCont->bSubExpanded)
index += tempCont->iSubAllocated;
}
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp index 2c89f39c2f..0091db8bce 100644 --- a/plugins/Clist_modern/src/modern_clcpaint.cpp +++ b/plugins/Clist_modern/src/modern_clcpaint.cpp @@ -544,7 +544,7 @@ MODERNMASK* CLCPaint::_GetCLCContactRowBackModernMask(ClcGroup *group, ClcContac _AddParamShort(mpModernMask, hi_Type, hi_Group);
if (Drawing->group) {
_AddParamShort(mpModernMask, hi_Open, Drawing->group->expanded ? hi_True : hi_False);
- _AddParamShort(mpModernMask, hi_IsEmpty, (Drawing->group->cl.count == 0) ? hi_True : hi_False);
+ _AddParamShort(mpModernMask, hi_IsEmpty, (Drawing->group->cl.getCount() == 0) ? hi_True : hi_False);
}
break;
@@ -598,11 +598,11 @@ MODERNMASK* CLCPaint::_GetCLCContactRowBackModernMask(ClcGroup *group, ClcContac break;
}
- if (group->scanIndex == 0 && group->cl.count == 1)
+ if (group->scanIndex == 0 && group->cl.getCount() == 1)
_AddParamShort(mpModernMask, hi_GroupPos, hi_First_Single);
else if (group->scanIndex == 0)
_AddParamShort(mpModernMask, hi_GroupPos, hi_First);
- else if (group->scanIndex + 1 == group->cl.count)
+ else if (group->scanIndex + 1 == group->cl.getCount())
_AddParamShort(mpModernMask, hi_GroupPos, hi_Last);
else
_AddParamShort(mpModernMask, hi_GroupPos, hi_Mid);
@@ -625,7 +625,7 @@ MODERNMASK* CLCPaint::_GetCLCContactRowBackModernMask(ClcGroup *group, ClcContac }
if (group->parent) {
- TCHAR *b2 = NEWTSTR_ALLOCA(group->parent->cl.items[0]->szText);
+ TCHAR *b2 = NEWTSTR_ALLOCA(group->parent->cl[0]->szText);
for (int i = 0; b2[i] != 0; i++)
if (b2[i] == _T(','))
b2[i] = _T('.');
@@ -663,7 +663,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R if (Drawing->type == CLCIT_GROUP &&
Drawing->group->parent->groupId == 0 &&
- Drawing->group->parent->cl.items[0] != Drawing) {
+ Drawing->group->parent->cl[0] != Drawing) {
dg = dat->row_before_group_space;
free_row_rc.top += dg;
height -= dg;
@@ -1619,7 +1619,7 @@ void CLCPaint::_DrawLines(HWND hWnd, ClcData *dat, int paintMode, RECT *rcPaint, while (y < rcPaint->bottom) {
if (subindex == -1) {
- if (group->scanIndex >= group->cl.count) {
+ if (group->scanIndex >= group->cl.getCount()) {
group = group->parent;
indent--;
if (group == NULL) break; // Finished list
@@ -1638,11 +1638,11 @@ void CLCPaint::_DrawLines(HWND hWnd, ClcData *dat, int paintMode, RECT *rcPaint, // Get item to draw
int subident = 0;
ClcContact *Drawing;
- if (group->scanIndex < group->cl.count) {
+ if (group->scanIndex < group->cl.getCount()) {
if (subindex == -1)
- Drawing = group->cl.items[group->scanIndex];
+ Drawing = group->cl[group->scanIndex];
else {
- Drawing = &group->cl.items[group->scanIndex]->subcontacts[subindex];
+ Drawing = &group->cl[group->scanIndex]->subcontacts[subindex];
subident = dat->subIndent;
}
}
@@ -1702,8 +1702,8 @@ void CLCPaint::_DrawLines(HWND hWnd, ClcData *dat, int paintMode, RECT *rcPaint, RECT mrc = row_rc;
if (group->parent == 0
&& group->scanIndex != 0
- && group->scanIndex < group->cl.count
- && group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
+ && group->scanIndex < group->cl.getCount()
+ && group->cl[group->scanIndex]->type == CLCIT_GROUP) {
mrc.top += dat->row_before_group_space;
}
SkinDrawGlyphMask(pc.hdcMem, &mrc, rcPaint, mpRequest);
@@ -1712,7 +1712,7 @@ void CLCPaint::_DrawLines(HWND hWnd, ClcData *dat, int paintMode, RECT *rcPaint, RECT mrc = row_rc;
if (Drawing->type == CLCIT_GROUP &&
Drawing->group->parent->groupId == 0 &&
- Drawing->group->parent->cl.items[0] != Drawing) {
+ Drawing->group->parent->cl[0] != Drawing) {
mrc.top += dat->row_before_group_space;
}
// Selection background ( only if hole line - full/less )
@@ -1789,7 +1789,7 @@ void CLCPaint::_DrawLines(HWND hWnd, ClcData *dat, int paintMode, RECT *rcPaint, RECT mrc = row_rc;
if (Drawing->type == CLCIT_GROUP &&
Drawing->group->parent->groupId == 0 &&
- Drawing->group->parent->cl.items[0] != Drawing) {
+ Drawing->group->parent->cl[0] != Drawing) {
mrc.top += dat->row_before_group_space;
}
SkinDrawGlyphMask(pc.hdcMem, &mrc, rcPaint, mpRequest);
@@ -1802,17 +1802,17 @@ void CLCPaint::_DrawLines(HWND hWnd, ClcData *dat, int paintMode, RECT *rcPaint, y += iRowHeight;
// increment by subcontacts
- if ((group->cl.items && group->scanIndex < group->cl.count && group->cl.items[group->scanIndex]->subcontacts != NULL && group->cl.items[group->scanIndex]->type != CLCIT_GROUP)
- && (group->cl.items[group->scanIndex]->bSubExpanded && dat->expandMeta)) {
- if (subindex < group->cl.items[group->scanIndex]->iSubAllocated - 1)
+ ClcContact *cc = group->cl[group->scanIndex];
+ if (cc != NULL && cc->subcontacts != NULL && cc->type != CLCIT_GROUP && cc->bSubExpanded && dat->expandMeta) {
+ if (subindex < cc->iSubAllocated - 1)
subindex++;
else
subindex = -1;
}
- if (subindex == -1 && group->scanIndex < group->cl.count) {
- if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && group->cl.items[group->scanIndex]->group->expanded) {
- group = group->cl.items[group->scanIndex]->group;
+ if (cc && subindex == -1) {
+ if (cc->type == CLCIT_GROUP && cc->group->expanded) {
+ group = cc->group;
indent++;
group->scanIndex = 0;
subindex = -1;
@@ -1820,7 +1820,7 @@ void CLCPaint::_DrawLines(HWND hWnd, ClcData *dat, int paintMode, RECT *rcPaint, }
group->scanIndex++;
}
- else if (group->scanIndex >= group->cl.count) {
+ else if (group->scanIndex >= group->cl.getCount()) {
subindex = -1;
}
}
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp index 6c0364836f..fa95b706b5 100644 --- a/plugins/Clist_modern/src/modern_clcutils.cpp +++ b/plugins/Clist_modern/src/modern_clcutils.cpp @@ -341,7 +341,7 @@ int GetDropTargetInformation(HWND hwnd, ClcData *dat, POINT pt) ok = 1;
}
else if ((pt.y + dat->yScroll >= cliGetRowTopY(dat, hit + 1) - dat->insertionMarkHitHeight)
- || (contact->type == CLCIT_GROUP && contact->group->expanded && contact->group->cl.count > 0)) {
+ || (contact->type == CLCIT_GROUP && contact->group->expanded && contact->group->cl.getCount() > 0)) {
//could be insertion mark (below)
topItem = hit; bottomItem = hit + 1;
topcontact = contact; topgroup = group;
@@ -664,14 +664,14 @@ int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk) group->scanIndex = 0;
for (;;) {
- if (group->scanIndex == group->cl.count) {
+ if (group->scanIndex == group->cl.getCount()) {
if ((group = group->parent) == NULL)
break;
group->scanIndex++;
continue;
}
- ClcContact *cc = group->cl.items[group->scanIndex];
+ ClcContact *cc = group->cl[group->scanIndex];
if (cc->type != CLCIT_DIVIDER) {
bool found;
if (dat->bFilterSearch) {
diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp index d57c546a3a..b239ea046e 100644 --- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp +++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp @@ -78,7 +78,7 @@ int RowHeight_CalcRowHeight(ClcData *dat, ClcContact *contact, int item) tmp = max(tmp, ICON_HEIGHT);
tmp = max(tmp, dat->row_min_heigh);
tmp += dat->row_border * 2;
- if (contact->type == CLCIT_GROUP && contact->group->parent->groupId == 0 && contact->group->parent->cl.items[0] != contact)
+ if (contact->type == CLCIT_GROUP && contact->group->parent->groupId == 0 && contact->group->parent->cl[0] != contact)
tmp += dat->row_before_group_space;
if (item != -1)
dat->row_heights[item] = tmp;
@@ -417,7 +417,7 @@ void RowHeights_CalcRowHeights(ClcData *dat, HWND hwnd) int subident;
ClcContact *Drawing;
if (subindex == -1) {
- if (group->scanIndex == group->cl.count) {
+ if (group->scanIndex == group->cl.getCount()) {
if ((group = group->parent) == NULL)
break;
group->scanIndex++;
@@ -426,12 +426,12 @@ void RowHeights_CalcRowHeights(ClcData *dat, HWND hwnd) }
// Get item to draw
- Drawing = group->cl.items[group->scanIndex];
+ Drawing = group->cl[group->scanIndex];
subident = 0;
}
else {
// Get item to draw
- Drawing = &group->cl.items[group->scanIndex]->subcontacts[subindex];
+ Drawing = &group->cl[group->scanIndex]->subcontacts[subindex];
subident = dat->subIndent;
}
@@ -444,9 +444,9 @@ void RowHeights_CalcRowHeights(ClcData *dat, HWND hwnd) RowHeight_CalcRowHeight(dat, Drawing, line_num);
// increment by subcontacts
- if (group->cl.items[group->scanIndex]->subcontacts != NULL && group->cl.items[group->scanIndex]->type != CLCIT_GROUP) {
- if (group->cl.items[group->scanIndex]->bSubExpanded && dat->expandMeta) {
- if (subindex < group->cl.items[group->scanIndex]->iSubAllocated - 1)
+ if (group->cl[group->scanIndex]->subcontacts != NULL && group->cl[group->scanIndex]->type != CLCIT_GROUP) {
+ if (group->cl[group->scanIndex]->bSubExpanded && dat->expandMeta) {
+ if (subindex < group->cl[group->scanIndex]->iSubAllocated - 1)
subindex++;
else
subindex = -1;
@@ -454,8 +454,8 @@ void RowHeights_CalcRowHeights(ClcData *dat, HWND hwnd) }
if (subindex == -1) {
- if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && group->cl.items[group->scanIndex]->group->expanded) {
- group = group->cl.items[group->scanIndex]->group;
+ if (group->cl[group->scanIndex]->type == CLCIT_GROUP && group->cl[group->scanIndex]->group->expanded) {
+ group = group->cl[group->scanIndex]->group;
indent++;
group->scanIndex = 0;
subindex = -1;
|