X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6239ee05567eac71754f56c2a154222d10b57ff1..6cef0db28018fd2644ee4e38af715872e5242459:/src/mac/carbon/stattext.cpp diff --git a/src/mac/carbon/stattext.cpp b/src/mac/carbon/stattext.cpp index 2ae2746a0b..d2f9fd1cea 100644 --- a/src/mac/carbon/stattext.cpp +++ b/src/mac/carbon/stattext.cpp @@ -92,10 +92,10 @@ wxSize wxStaticText::DoGetBestSize() const OSStatus err = m_peer->GetData( kControlEntireControl, kControlFontStyleTag, &controlFont ); verify_noerr( err ); - SInt16 baseline; - wxMacCFStringHolder str( m_label, m_font.GetEncoding() ); + wxCFStringRef str( m_label, GetFont().GetEncoding() ); -#ifndef __LP64__ +#if wxMAC_USE_ATSU_TEXT + SInt16 baseline; if ( m_font.MacGetThemeFontID() != kThemeCurrentPortFont ) { err = GetThemeTextDimensions( @@ -106,23 +106,11 @@ wxSize wxStaticText::DoGetBestSize() const else #endif { - #if wxMAC_USE_CORE_GRAPHICS wxClientDC dc(const_cast(this)); wxCoord width, height ; dc.GetTextExtent( m_label , &width, &height); bounds.h = width; bounds.v = height; - #else - wxMacWindowStateSaver sv( this ); - ::TextFont( m_font.MacGetFontNum() ); - ::TextSize( (short)(m_font.MacGetFontSize()) ); - ::TextFace( m_font.MacGetFontStyle() ); - - err = GetThemeTextDimensions( - (!m_label.empty() ? (CFStringRef)str : CFSTR(" ")), - kThemeCurrentPortFont, kThemeStateActive, false, &bounds, &baseline ); - verify_noerr( err ); - #endif } if ( m_label.empty() ) @@ -191,7 +179,7 @@ void wxStaticText::DoSetLabel(const wxString& label) m_labelOrig = label; m_label = RemoveMnemonics(label); - wxMacCFStringHolder str( m_label, m_font.GetEncoding() ); + wxCFStringRef str( m_label, GetFont().GetEncoding() ); OSStatus err = m_peer->SetData(kControlEntireControl, kControlStaticTextCFStringTag, str); verify_noerr( err ); }