X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/258e4e914f18ec5990040bdcd5499c879573e210..5ea02ed5dfa37a4208486a3f6824658313f4ee08:/src/mac/choice.cpp diff --git a/src/mac/choice.cpp b/src/mac/choice.cpp index c130d3798a..55a9268e10 100644 --- a/src/mac/choice.cpp +++ b/src/mac/choice.cpp @@ -245,12 +245,11 @@ wxSize wxChoice::DoGetBestSize() const #endif { wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef) MacGetRootWindow() ) ) ; - wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ; - if ( font ) + if ( m_font.Ok() ) { - ::TextFont( font->m_macFontNum ) ; - ::TextSize( short(font->m_macFontSize) ) ; - ::TextFace( font->m_macFontStyle ) ; + ::TextFont( m_font.GetMacFontNum() ) ; + ::TextSize( m_font.GetMacFontSize() ) ; + ::TextFace( m_font.GetMacFontStyle() ) ; } else { @@ -272,8 +271,7 @@ wxSize wxChoice::DoGetBestSize() const &baseline ); wLine = bounds.h ; #else - wxCharBuffer text = wxMacStringToCString( str ) ; - wLine = ::TextWidth( text , 0 , strlen(text) ) ; + wLine = ::TextWidth( str.c_str() , 0 , str.Length() ) ; #endif lbWidth = wxMax(lbWidth, wLine); }