// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "dataobj.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
void wxDataFormat::SetType( wxDataFormatId type )
{
PrepareFormats();
-
+
m_type = type;
-
+
#if wxUSE_UNICODE
if (m_type == wxDF_UNICODETEXT)
m_format = g_textAtom;
wxString wxDataFormat::GetId() const
{
- wxString ret = wxString::FromAscii( gdk_atom_name( m_format ) );
+ gchar* atom_name = gdk_atom_name( m_format );
+ wxString ret = wxString::FromAscii( atom_name );
+ g_free(atom_name);
return ret;
}
PrepareFormats();
m_type = wxDF_PRIVATE;
wxString tmp( id );
- m_format = gdk_atom_intern( (const char*) tmp.ToAscii(), FALSE );
+ m_format = gdk_atom_intern( (const char*) tmp.ToAscii(), FALSE );
}
void wxDataFormat::PrepareFormats()
bool wxDataObject::IsSupportedFormat(const wxDataFormat& format, Direction dir) const
{
size_t nFormatCount = GetFormatCount(dir);
- if ( nFormatCount == 1 )
+ if ( nFormatCount == 1 )
{
return format == GetPreferredFormat();
}
- else
+ else
{
wxDataFormat *formats = new wxDataFormat[nFormatCount];
GetAllFormats(formats,dir);
size_t n;
- for ( n = 0; n < nFormatCount; n++ )
+ for ( n = 0; n < nFormatCount; n++ )
{
if ( formats[n] == format )
break;
}
}
-// ----------------------------------------------------------------------------
-// wxTextDataObject
-// ----------------------------------------------------------------------------
-
-#if defined(__WXGTK20__) && wxUSE_UNICODE
-void wxTextDataObject::GetAllFormats(wxDataFormat *formats, wxDataObjectBase::Direction dir) const
-{
- *formats++ = GetPreferredFormat();
- *formats = g_altTextAtom;
-}
-#endif
-
// ----------------------------------------------------------------------------
// wxFileDataObject
// ----------------------------------------------------------------------------