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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user