Remove unnecessary call to wxClientDC::SetFont() in wxStaticText

wxClientDC already uses the font of the associated window by default, so
there is no need to set it explicitly.

No real changes, this is just a micro optimization.
This commit is contained in:
Vadim Zeitlin 2024-02-28 01:51:36 +01:00
parent be3ea1768a
commit 9f8d56b283

View file

@ -89,11 +89,6 @@ WXDWORD wxStaticText::MSWGetStyle(long style, WXDWORD *exstyle) const
wxSize wxStaticText::DoGetBestClientSize() const
{
wxClientDC dc(const_cast<wxStaticText *>(this));
wxFont font(GetFont());
if (!font.IsOk())
font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
dc.SetFont(font);
wxCoord widthTextMax, heightTextTotal;
dc.GetMultiLineTextExtent(GetLabelText(), &widthTextMax, &heightTextTotal);