X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e135f09367836c25fc6268881d3260244bdd98d5..cea43339ac7a88fc4c0cf083ff6afec1cee3a9e3:/src/mac/carbon/clipbrd.cpp diff --git a/src/mac/carbon/clipbrd.cpp b/src/mac/carbon/clipbrd.cpp index d7a5b8bc52..5ef8fdb107 100644 --- a/src/mac/carbon/clipbrd.cpp +++ b/src/mac/carbon/clipbrd.cpp @@ -136,18 +136,14 @@ 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 ; + char * buf = (char*) data ; + while( (buf=strchr(buf,0x0a)) != NULL ) + { + *buf = 13 ; + buf++ ; + } } return data; @@ -252,8 +248,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 ;