Avoid code duplication in wxAuiToolBar::DeleteTool()

Delegate to the existing DeleteByIndex() instead of repeating its code
in DeleteTool().

No real changes, this is just a refactoring.
This commit is contained in:
Vadim Zeitlin
2020-03-10 22:32:05 +01:00
parent 7c6d816d4a
commit ec36eb990b

View File

@@ -1165,15 +1165,7 @@ void wxAuiToolBar::Clear()
bool wxAuiToolBar::DeleteTool(int tool_id)
{
int idx = GetToolIndex(tool_id);
if (idx >= 0 && idx < (int)m_items.GetCount())
{
m_items.RemoveAt(idx);
Realize();
return true;
}
return false;
return DeleteByIndex(GetToolIndex(tool_id));
}
bool wxAuiToolBar::DeleteByIndex(int idx)