From 0458ad6c4ad5ee0c61acb67baf7d56737adefea5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 9 Jun 2020 01:11:37 +0200 Subject: [PATCH] Use temporary NSLayoutManager variable No real changes, just make the code slightly shorter. --- src/osx/cocoa/textctrl.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osx/cocoa/textctrl.mm b/src/osx/cocoa/textctrl.mm index da72115bea..da1a9e0cda 100644 --- a/src/osx/cocoa/textctrl.mm +++ b/src/osx/cocoa/textctrl.mm @@ -1222,9 +1222,9 @@ void wxNSTextViewControl::EnableAutomaticDashSubstitution(bool enable) wxSize wxNSTextViewControl::GetBestSize() const { - if (m_textView && [m_textView layoutManager]) + if ( NSLayoutManager* const layoutManager = [m_textView layoutManager] ) { - NSRect rect = [[m_textView layoutManager] usedRectForTextContainer: [m_textView textContainer]]; + NSRect rect = [layoutManager usedRectForTextContainer: [m_textView textContainer]]; return wxSize((int)(rect.size.width + [m_textView textContainerInset].width), (int)(rect.size.height + [m_textView textContainerInset].height)); }