X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ab0f37b97b488f0ec3082dbb0abac66bd0c48bd6..ed6e7f8cfeb41348e13032c5a323d96bcfb22c6d:/src/mac/carbon/stattext.cpp diff --git a/src/mac/carbon/stattext.cpp b/src/mac/carbon/stattext.cpp index fdbdf4ba0f..d0285e6b06 100644 --- a/src/mac/carbon/stattext.cpp +++ b/src/mac/carbon/stattext.cpp @@ -75,7 +75,7 @@ wxSize wxStaticText::DoGetBestSize() const { Rect bestsize = { 0 , 0 , 0 , 0 } ; Point bounds; - + // try the built-in best size if available Boolean former = m_peer->GetData( kControlStaticTextIsMultilineTag); m_peer->SetData( kControlStaticTextIsMultilineTag, (Boolean)0 ); @@ -92,9 +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() ); +#if wxMAC_USE_ATSU_TEXT + SInt16 baseline; if ( m_font.MacGetThemeFontID() != kThemeCurrentPortFont ) { err = GetThemeTextDimensions( @@ -103,24 +104,13 @@ wxSize wxStaticText::DoGetBestSize() const verify_noerr( err ); } 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() ) @@ -189,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 ); }