Don't call UpdateSize() unnecessarily at the end of Realize()

SetRows(), called just above in most case, already calls UpdateSize(),
so there is no need to do it again.
This commit is contained in:
Vadim Zeitlin
2019-02-24 22:34:32 +01:00
parent dc0586aad6
commit 385ebf2f4a

View File

@@ -1312,8 +1312,16 @@ bool wxToolBar::Realize()
if ( !IsVertical() )
{
if ( m_maxRows == 0 )
{
// if not set yet, only one row
SetRows(1);
}
else
{
// In all the other cases, UpdateSize() is called by SetRows(), but
// when we don't call it here, call it directly instead.
UpdateSize();
}
}
else if ( m_nButtons > 0 ) // vertical non empty toolbar
{
@@ -1323,7 +1331,6 @@ bool wxToolBar::Realize()
}
InvalidateBestSize();
UpdateSize();
return true;
}