X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f66ecdc4fbfa14f18f95331ba859a85baee36ae6..3cd3739570ae08024c520adda9bd466a883cebaf:/src/osx/core/cfstring.cpp diff --git a/src/osx/core/cfstring.cpp b/src/osx/core/cfstring.cpp index b603e5b48d..96bc244d38 100644 --- a/src/osx/core/cfstring.cpp +++ b/src/osx/core/cfstring.cpp @@ -186,8 +186,8 @@ wxUint32 wxMacGetSystemEncFromFontEnc(wxFontEncoding encoding) #if 0 case wxFONTENCODING_UTF7 : enc = CreateTextEncoding(kCFStringEncodingUnicodeDefault,0,kUnicodeUTF7Format) ; -#endif break ; +#endif case wxFONTENCODING_UTF8 : enc = kCFStringEncodingUTF8; break ; @@ -638,10 +638,9 @@ wxString wxCFStringRef::AsString( CFStringRef ref, wxFontEncoding WXUNUSED_IN_UN return wxEmptyString ; Size cflen = CFStringGetLength( ref ) ; - char* buf = NULL ; - CFStringEncoding cfencoding = 0; - wxString result; + CFStringEncoding cfencoding; + wxString result; #if wxUSE_UNICODE #if wxUSE_UNICODE_WCHAR cfencoding = kCFStringEncodingUTF32Native; @@ -657,10 +656,10 @@ wxString wxCFStringRef::AsString( CFStringRef ref, wxFontEncoding WXUNUSED_IN_UN CFIndex cStrLen ; CFStringGetBytes( ref , CFRangeMake(0, cflen) , cfencoding , '?' , false , NULL , 0 , &cStrLen ) ; - buf = new char[ cStrLen ] ; + char* buf = new char[cStrLen]; CFStringGetBytes( ref , CFRangeMake(0, cflen) , cfencoding, '?' , false , (unsigned char*) buf , cStrLen , &cStrLen) ; - + #if wxUSE_UNICODE #if wxUSE_UNICODE_WCHAR result = wxString( (const wchar_t*) buf , cStrLen/4); @@ -672,7 +671,7 @@ wxString wxCFStringRef::AsString( CFStringRef ref, wxFontEncoding WXUNUSED_IN_UN #else result = wxString(buf, cStrLen) ; #endif - + delete[] buf ; wxMacConvertNewlines10To13( &result); return result ; @@ -684,7 +683,7 @@ wxString wxCFStringRef::AsString(wxFontEncoding encoding) const } #if wxOSX_USE_COCOA_OR_IPHONE -wxString wxCFStringRef::AsString( NSString* ref, wxFontEncoding encoding ) +wxString wxCFStringRef::AsString( NSString* ref, wxFontEncoding encoding ) { return AsString( (CFStringRef) ref, encoding ); } @@ -731,11 +730,11 @@ wxMacUniCharBuffer::~wxMacUniCharBuffer() free( m_ubuf ) ; } -UniCharPtr wxMacUniCharBuffer::GetBuffer() +UniCharPtr wxMacUniCharBuffer::GetBuffer() { return m_ubuf ; } - + UniCharCount wxMacUniCharBuffer::GetChars() { return m_chars ;