summaryrefslogtreecommitdiff
path: root/plugins/TopToolBar/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TopToolBar/src')
-rw-r--r--plugins/TopToolBar/src/toolbar.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp
index 380daf02dd..a0a77b8536 100644
--- a/plugins/TopToolBar/src/toolbar.cpp
+++ b/plugins/TopToolBar/src/toolbar.cpp
@@ -25,11 +25,11 @@ LIST<TopButtonInt> Buttons(8, sortfunc);
TopButtonInt *idtopos(int id, int *pPos)
{
- for (int i = 0; i < Buttons.getCount(); i++)
- if (Buttons[i]->id == id) {
+ for (auto &it : Buttons)
+ if (it->id == id) {
if (pPos)
- *pPos = i;
- return Buttons[i];
+ *pPos = Buttons.indexOf(&it);
+ return it;
}
if (pPos)