summaryrefslogtreecommitdiff
path: root/plugins/FavContacts/src/menu.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-02-21 18:40:03 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-02-21 18:40:14 +0300
commit477a6ea70d0bb1b1dfe9cbd9a15b6dad0284ddeb (patch)
tree247eed13a5231c3983e343f0b7fc2a95012353c2 /plugins/FavContacts/src/menu.cpp
parent9d0174ebe2bd005418855b18f737c36d5c20ab4a (diff)
all another C++'11 iterators
Diffstat (limited to 'plugins/FavContacts/src/menu.cpp')
-rw-r--r--plugins/FavContacts/src/menu.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/FavContacts/src/menu.cpp b/plugins/FavContacts/src/menu.cpp
index f0c8e1072e..4770696e65 100644
--- a/plugins/FavContacts/src/menu.cpp
+++ b/plugins/FavContacts/src/menu.cpp
@@ -458,21 +458,21 @@ int ShowMenu(bool centered)
g_maxItemWidth /= favList.groupCount();
prevGroup = nullptr;
- for (int i = 0; i < favList.getCount(); ++i) {
- hContact = favList[i]->getHandle();
+ for (auto &it : favList) {
+ hContact = it->getHandle();
MEASUREITEMSTRUCT mis = { 0 };
mis.CtlID = 0;
mis.CtlType = ODT_MENU;
- if (!prevGroup || mir_wstrcmp(prevGroup, favList[i]->getGroup())) {
+ if (!prevGroup || mir_wstrcmp(prevGroup, it->getGroup())) {
if (prevGroup && g_Options.bUseColumns) {
szMenu.cx += szColumn.cx;
szMenu.cy = max(szMenu.cy, szColumn.cy);
szColumn.cx = szColumn.cy = 0;
}
- int groupID = -((INT_PTR)Clist_GroupExists(favList[i]->getGroup()) + 1);
+ int groupID = -((INT_PTR)Clist_GroupExists(it->getGroup()) + 1);
AppendMenu(hMenu,
MF_OWNERDRAW | MF_SEPARATOR | ((prevGroup && g_Options.bUseColumns) ? MF_MENUBREAK : 0),
@@ -493,7 +493,7 @@ int ShowMenu(bool centered)
szColumn.cx = max(szColumn.cx, (int)mis.itemWidth);
szColumn.cy += mis.itemHeight;
- prevGroup = favList[i]->getGroup();
+ prevGroup = it->getGroup();
}
szMenu.cx += szColumn.cx;
szMenu.cy = max(szMenu.cy, szColumn.cy);