From 51bfc68423d735dfa24e7c1e6dd807110bfeafae Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 16 Jan 2018 16:26:35 +0100 Subject: [PATCH] Avoid unnecessary checks in wxStaticText::SetFont() in wxGTK There is no need to do anything if the font didn't actually change. --- src/gtk/stattext.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gtk/stattext.cpp b/src/gtk/stattext.cpp index bda1f6d135..78e154c006 100644 --- a/src/gtk/stattext.cpp +++ b/src/gtk/stattext.cpp @@ -175,7 +175,8 @@ bool wxStaticText::SetFont( const wxFont &font ) const bool wasUnderlined = GetFont().GetUnderlined(); const bool wasStrickenThrough = GetFont().GetStrikethrough(); - bool ret = wxControl::SetFont(font); + if ( !wxControl::SetFont(font) ) + return false; const bool isUnderlined = GetFont().GetUnderlined(); const bool isStrickenThrough = GetFont().GetStrikethrough(); @@ -219,7 +220,7 @@ bool wxStaticText::SetFont( const wxFont &font ) AutoResizeIfNecessary(); - return ret; + return true; } wxSize wxStaticText::DoGetBestSize() const