From: Stefan Csomor Date: Tue, 15 Feb 2005 20:00:52 +0000 (+0000) Subject: guard against errors like in wxStringBase::AllocBeforeWrite code (1123226) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a4ea2d8dbbba4c352ccf56645fdd90c219664dcf guard against errors like in wxStringBase::AllocBeforeWrite code (1123226) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32085 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/corefoundation/cfstring.cpp b/src/mac/corefoundation/cfstring.cpp index 0bb09db851..73430139db 100644 --- a/src/mac/corefoundation/cfstring.cpp +++ b/src/mac/corefoundation/cfstring.cpp @@ -107,6 +107,10 @@ wxUint32 wxMacGetSystemEncFromFontEnc(wxFontEncoding encoding) encoding = wxLocale::GetSystemEncoding() ; #endif } + if ( encoding == wxFONTENCODING_SYSTEM ) + { + enc = CFStringGetSystemEncoding(); + } switch( encoding) { @@ -629,7 +633,9 @@ wxFontEncoding wxMacGetFontEncFromSystemEnc(wxUint32 encoding) // converts this string into a carbon foundation string with optional pc 2 mac encoding void wxMacCFStringHolder::Assign( const wxString &st , wxFontEncoding encoding ) { - Release() ; + Release() ; + if (st.IsEmpty()) + return ; wxString str = st ; wxMacConvertNewlines13To10( &str ) ;