diff options
author | George Hazan <ghazan@miranda.im> | 2018-02-21 18:40:03 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-02-21 18:40:14 +0300 |
commit | 477a6ea70d0bb1b1dfe9cbd9a15b6dad0284ddeb (patch) | |
tree | 247eed13a5231c3983e343f0b7fc2a95012353c2 /plugins/Nudge/src/options.cpp | |
parent | 9d0174ebe2bd005418855b18f737c36d5c20ab4a (diff) |
all another C++'11 iterators
Diffstat (limited to 'plugins/Nudge/src/options.cpp')
-rw-r--r-- | plugins/Nudge/src/options.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/plugins/Nudge/src/options.cpp b/plugins/Nudge/src/options.cpp index fce6159268..c72e07390c 100644 --- a/plugins/Nudge/src/options.cpp +++ b/plugins/Nudge/src/options.cpp @@ -21,11 +21,9 @@ static void UpdateControls(HWND hwnd) if (GlobalNudge.useByProtocol) {
proto = GetSelProto(hwnd, nullptr);
ActualNudge = nullptr;
- for (int i = 0; i < arNudges.getCount(); i++) {
- CNudgeElement &p = arNudges[i];
- if (p.iProtoNumber == proto)
- ActualNudge = &p;
- }
+ for (auto &p : arNudges)
+ if (p->iProtoNumber == proto)
+ ActualNudge = p;
}
else ActualNudge = &DefaultNudge;
@@ -71,11 +69,9 @@ static void CheckChange(HWND hwnd, HTREEITEM hItem) if (GlobalNudge.useByProtocol) {
proto = GetSelProto(hwnd, hItem);
ActualNudge = nullptr;
- for (int i = 0; i < arNudges.getCount(); i++) {
- CNudgeElement &p = arNudges[i];
- if (p.iProtoNumber == proto)
- ActualNudge = &p;
- }
+ for (auto &p : arNudges)
+ if (p->iProtoNumber == proto)
+ ActualNudge = p;
}
else ActualNudge = &DefaultNudge;
@@ -208,9 +204,8 @@ static void CreateImageList(HWND hWnd) // Create and populate image list
HIMAGELIST hImList = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK | ILC_COLOR32, nProtocol, 0);
- for (int i = 0; i < arNudges.getCount(); i++) {
- CNudgeElement &p = arNudges[i];
- INT_PTR res = CallProtoService(p.ProtocolName, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL | PLIF_ICOLIB, 0);
+ for (auto &p : arNudges) {
+ INT_PTR res = CallProtoService(p->ProtocolName, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL | PLIF_ICOLIB, 0);
if (res == CALLSERVICE_NOTFOUND)
res = (INT_PTR)IcoLib_GetIcon("Nudge_Default");
|