summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-14 19:59:06 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-14 19:59:06 +0300
commitdad59528ccd770301b29c7db8148ff8ab8e89c92 (patch)
treeb93aa1b9149ddf20d6317d44cf924be8d0be276a /plugins/SmileyAdd/src
parent1a3f9ca88310cb9080a4c0073087bebc4c1e3a0a (diff)
reverse iterators for LIST<>
Diffstat (limited to 'plugins/SmileyAdd/src')
-rw-r--r--plugins/SmileyAdd/src/SmileyBase.cpp6
-rw-r--r--plugins/SmileyAdd/src/imagecache.cpp4
-rw-r--r--plugins/SmileyAdd/src/richcall.cpp12
3 files changed, 10 insertions, 12 deletions
diff --git a/plugins/SmileyAdd/src/SmileyBase.cpp b/plugins/SmileyAdd/src/SmileyBase.cpp
index 3ecc9e7a10..e9ef6722d8 100644
--- a/plugins/SmileyAdd/src/SmileyBase.cpp
+++ b/plugins/SmileyAdd/src/SmileyBase.cpp
@@ -368,9 +368,9 @@ HRESULT ISmileyBase::GetTooltip(BSTR *bstrHint)
void CloseSmileys(void)
{
- for (int i = regSmileys.getCount() - 1; i >= 0; i--) {
- regSmileys[i]->OnClose();
- regSmileys[i]->Close(OLECLOSE_NOSAVE);
+ for (auto &it : regSmileys.rev_iter()) {
+ it->OnClose();
+ it->Close(OLECLOSE_NOSAVE);
}
}
diff --git a/plugins/SmileyAdd/src/imagecache.cpp b/plugins/SmileyAdd/src/imagecache.cpp
index 87043a9e26..cbf5c69a39 100644
--- a/plugins/SmileyAdd/src/imagecache.cpp
+++ b/plugins/SmileyAdd/src/imagecache.cpp
@@ -36,8 +36,8 @@ static void CALLBACK timerProc(HWND, UINT, UINT_PTR, DWORD)
lastdllname.Empty();
}
- for (int i = g_imagecache.getCount() - 1; i >= 0; i--)
- g_imagecache[i].ProcessTimerTick(ts);
+ for (auto &it : g_imagecache.rev_iter())
+ it->ProcessTimerTick(ts);
if (g_imagecache.getCount() == 0) {
g_imagecache.destroy();
diff --git a/plugins/SmileyAdd/src/richcall.cpp b/plugins/SmileyAdd/src/richcall.cpp
index 67ab0a5c98..a5a81e12cb 100644
--- a/plugins/SmileyAdd/src/richcall.cpp
+++ b/plugins/SmileyAdd/src/richcall.cpp
@@ -421,8 +421,7 @@ void CloseRichOwnerCallback(HWND hwnd)
void ProcessAllInputAreas(bool restoreText)
{
- for (int i = g_RichEditList.getCount() - 1; i >= 0; i--) {
- RichEditData *rdt = g_RichEditList[i];
+ for (auto &rdt : g_RichEditList.rev_iter())
if (rdt->inputarea) {
if (restoreText) {
CHARRANGE sel = allsel;
@@ -430,16 +429,15 @@ void ProcessAllInputAreas(bool restoreText)
}
else ReplaceContactSmileys(rdt, allsel, false, false);
}
- }
}
void RichEditData_Destroy(void)
{
- for (int i = g_RichEditList.getCount() - 1; i >= 0; i--)
- CloseRichCallback(g_RichEditList[i]->hwnd);
+ for (auto &it : g_RichEditList.rev_iter())
+ CloseRichCallback(it->hwnd);
g_RichEditList.destroy();
- for (int i = g_RichEditOwnerList.getCount() - 1; i >= 0; i--)
- CloseRichOwnerCallback(g_RichEditOwnerList[i]->hwnd);
+ for (auto &it : g_RichEditOwnerList.rev_iter())
+ CloseRichOwnerCallback(it->hwnd);
g_RichEditOwnerList.destroy();
}