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
This commit is contained in:
Stefan Csomor 2005-02-15 20:00:52 +00:00
parent 85445d3445
commit a4ea2d8dbb

View File

@ -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 ) ;