void wxClipboard::Clear()
{
- if (m_data != NULL)
- {
- delete m_data;
- m_data = NULL;
- }
+ wxDELETE(m_data);
+
+ wxCHECK_RET( m_pasteboard, "Clipboard creation failed." );
OSStatus err = PasteboardClear( m_pasteboard );
if (err != noErr)
// Get rid of cached object.
// If this is not done, copying data from
// another application will only work once
- if (m_data)
- {
- delete m_data;
- m_data = NULL;
- }
+ wxDELETE(m_data);
}
bool wxClipboard::IsSupported( const wxDataFormat &dataFormat )
wxCHECK_MSG( m_open, false, wxT("clipboard not open") );
- size_t formatcount = data.GetFormatCount() + 1;
+ size_t formatcount = data.GetFormatCount(wxDataObject::Set) + 1;
wxDataFormat *array = new wxDataFormat[ formatcount ];
- array[0] = data.GetPreferredFormat();
- data.GetAllFormats( &array[1] );
+ array[0] = data.GetPreferredFormat(wxDataObject::Set);
+ data.GetAllFormats( &array[1], wxDataObject::Set );
bool transferred = false;