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;
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 ;
void wxClipboard::Close()
{
m_open = false ;
+
+ // Get rid of cached object. If this is not done copying from another application will
+ // only work once
+ if (m_data)
+ {
+ delete m_data;
+ m_data = (wxDataObject*) NULL;
+ }
+
}
bool wxClipboard::IsSupported( const wxDataFormat &dataFormat )