Avoid unnecessary checks in wxStaticText::SetFont() in wxGTK

There is no need to do anything if the font didn't actually change.
This commit is contained in:
Vadim Zeitlin
2018-01-16 16:26:35 +01:00
parent 6651999719
commit 51bfc68423

View File

@@ -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