X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e135f09367836c25fc6268881d3260244bdd98d5..b77b87881bae2e6306366d79e7fe160334b3d4a2:/src/mac/carbon/clipbrd.cpp diff --git a/src/mac/carbon/clipbrd.cpp b/src/mac/carbon/clipbrd.cpp index d7a5b8bc52..91fc234410 100644 --- a/src/mac/carbon/clipbrd.cpp +++ b/src/mac/carbon/clipbrd.cpp @@ -136,18 +136,9 @@ void *wxGetClipboardData(wxDataFormat dataFormat, long *len) return NULL ; } - if ( dataFormat.GetType() == wxDF_TEXT && wxApp::s_macDefaultEncodingIsPC ) + if ( dataFormat.GetType() == wxDF_TEXT ) { - wxString st = wxMacMakeStringFromCString( (char*) data ) ; -#if wxUSE_UNICODE - wxCharBuffer buf = st.ToAscii() ; -#else - const char* buf = st ; -#endif - char* newdata = new char[strlen(buf)+1] ; - memcpy( newdata , buf , strlen(buf)+1 ) ; - delete[] ((char*) data ) ; - data = newdata ; + wxMacConvertNewlines10To13( (char*) data ) ; } return data; @@ -252,8 +243,7 @@ bool wxClipboard::AddData( wxDataObject *data ) case wxDF_OEMTEXT: { wxTextDataObject* textDataObject = (wxTextDataObject*) data; - wxString str(textDataObject->GetText()); - wxCharBuffer buf = wxMacStringToCString( str ) ; + wxCharBuffer buf = textDataObject->GetText().mb_str() ; err = UMAPutScrap( strlen(buf) , kScrapFlavorTypeText , (void*) buf.data() ) ; } break ;