X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/93c5dd39af2fb5eb12c5c837999be944543b21b0..c127177f8dc31dbe99764852b8dbcc047d3ad826:/src/gtk/dataobj.cpp diff --git a/src/gtk/dataobj.cpp b/src/gtk/dataobj.cpp index 161a6b5e3e..cbcce96e5f 100644 --- a/src/gtk/dataobj.cpp +++ b/src/gtk/dataobj.cpp @@ -44,6 +44,12 @@ wxDataFormat::wxDataFormat( wxDataType type ) SetType( type ); } +wxDataFormat::wxDataFormat( const wxChar *id ) +{ + if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE ); + SetId( id ); +} + wxDataFormat::wxDataFormat( const wxString &id ) { if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE ); @@ -121,7 +127,7 @@ wxString wxDataFormat::GetId() const return m_id; } -void wxDataFormat::SetId( const wxString &id ) +void wxDataFormat::SetId( const wxChar *id ) { m_type = wxDF_PRIVATE; m_id = id; @@ -335,7 +341,7 @@ size_t wxTextDataObject::GetSize() const void wxTextDataObject::WriteString( const wxString &str, void *dest ) const { - memcpy( dest, m_data.c_str(), GetSize() ); + memcpy( dest, str.mb_str(), str.Len()+1 ); } // ---------------------------------------------------------------------------- @@ -362,7 +368,7 @@ wxString wxFileDataObject::GetFiles() const void wxFileDataObject::WriteData( void *dest ) const { - memcpy( dest, m_files.c_str(), GetSize() ); + memcpy( dest, m_files.mbc_str(), GetSize() ); } size_t wxFileDataObject::GetSize() const @@ -421,7 +427,7 @@ IMPLEMENT_DYNAMIC_CLASS( wxPrivateDataObject, wxDataObject ) wxPrivateDataObject::wxPrivateDataObject() { - m_id = "application/"; + m_id = _T("application/"); m_id += wxTheApp->GetAppName(); m_format.SetId( m_id );