diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index b79323d664..8715e6a456 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -1535,13 +1535,13 @@ void wxAuiToolBar::ToggleTool(int tool_id, bool state) if (idx >= 0 && idx < count) { - for (i = idx; i < count; ++i) + for (i = idx + 1; i < count; ++i) { if (m_items[i].kind != wxITEM_RADIO) break; m_items[i].state &= ~wxAUI_BUTTON_STATE_CHECKED; } - for (i = idx; i > 0; i--) + for (i = idx - 1; i >= 0; i--) { if (m_items[i].kind != wxITEM_RADIO) break;