Use temporary NSLayoutManager variable

No real changes, just make the code slightly shorter.
This commit is contained in:
Vadim Zeitlin
2020-06-09 01:11:37 +02:00
parent c351f80481
commit 0458ad6c4a

View File

@@ -1222,9 +1222,9 @@ void wxNSTextViewControl::EnableAutomaticDashSubstitution(bool enable)
wxSize wxNSTextViewControl::GetBestSize() const 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), return wxSize((int)(rect.size.width + [m_textView textContainerInset].width),
(int)(rect.size.height + [m_textView textContainerInset].height)); (int)(rect.size.height + [m_textView textContainerInset].height));
} }