From 9f8d56b28371746a9dd5dbd6959e76f6fab6660c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 28 Feb 2024 01:51:36 +0100 Subject: [PATCH] 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. --- src/msw/stattext.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/msw/stattext.cpp b/src/msw/stattext.cpp index 64887380ba..4fcbe2c6d6 100644 --- a/src/msw/stattext.cpp +++ b/src/msw/stattext.cpp @@ -89,11 +89,6 @@ WXDWORD wxStaticText::MSWGetStyle(long style, WXDWORD *exstyle) const wxSize wxStaticText::DoGetBestClientSize() const { wxClientDC dc(const_cast(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);