Use temporary NSLayoutManager variable
No real changes, just make the code slightly shorter.
This commit is contained in:
@@ -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));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user