X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/524c47aa3adf2af11a3069fd5da035a604f08f66..cdbd62d6ff290fd58acd1bc5574dfc79db3a6f70:/src/osx/carbon/clipbrd.cpp diff --git a/src/osx/carbon/clipbrd.cpp b/src/osx/carbon/clipbrd.cpp index 56ad3acfe9..7835430e65 100644 --- a/src/osx/carbon/clipbrd.cpp +++ b/src/osx/carbon/clipbrd.cpp @@ -5,7 +5,6 @@ // Generalized clipboard implementation by Matthew Flatt // Modified by: // Created: 1998-01-01 -// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -36,7 +35,7 @@ // the trace mask we use with wxLogTrace() - call // wxLog::AddTraceMask(TRACE_CLIPBOARD) to enable the trace messages from here // (there will be a *lot* of them!) -#define TRACE_CLIPBOARD _T("clipboard") +#define TRACE_CLIPBOARD wxT("clipboard") IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject) @@ -61,11 +60,9 @@ wxClipboard::~wxClipboard() 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) @@ -139,11 +136,7 @@ void wxClipboard::Close() // 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 = (wxDataObject*) NULL; - } + wxDELETE(m_data); } bool wxClipboard::IsSupported( const wxDataFormat &dataFormat ) @@ -163,10 +156,10 @@ bool wxClipboard::GetData( wxDataObject& data ) 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;