Simplify wxAuiToolBar::GetOverflowRect()

Don't call m_overflowSizerItem->GetRect() unnecessarily: all fields of
overflow_rect were overwritten immediately after assigning the result of
this call to it, so this was just useless.

Also replace "cli_rect" with "cli_size" as we only used the size part
anyhow.

No real changes.
This commit is contained in:
Vadim Zeitlin
2026-02-24 23:20:44 +01:00
parent 00ebfc9275
commit 3e07039934

View File

@@ -2244,23 +2244,23 @@ int wxAuiToolBar::GetOverflowState() const
wxRect wxAuiToolBar::GetOverflowRect() const
{
wxRect cli_rect(wxPoint(0,0), GetClientSize());
wxRect overflow_rect = m_overflowSizerItem->GetRect();
const wxSize cli_size = GetClientSize();
wxRect overflow_rect;
int overflow_size = m_art->GetElementSizeForWindow(wxAUI_TBART_OVERFLOW_SIZE, this);
if (m_orientation == wxVERTICAL)
{
overflow_rect.y = cli_rect.height - overflow_size;
overflow_rect.y = cli_size.y - overflow_size;
overflow_rect.x = 0;
overflow_rect.width = cli_rect.width;
overflow_rect.width = cli_size.x;
overflow_rect.height = overflow_size;
}
else
{
overflow_rect.x = cli_rect.width - overflow_size;
overflow_rect.x = cli_size.x - overflow_size;
overflow_rect.y = 0;
overflow_rect.width = overflow_size;
overflow_rect.height = cli_rect.height;
overflow_rect.height = cli_size.y;
}
return overflow_rect;