X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/de6185e212ebc37ff11ff70278e3c4f68419b097..724999ee872d741f182af4eac6c137c5120fdd79:/src/x11/clipbrd.cpp diff --git a/src/x11/clipbrd.cpp b/src/x11/clipbrd.cpp index 731d49e668..f5747e507d 100644 --- a/src/x11/clipbrd.cpp +++ b/src/x11/clipbrd.cpp @@ -18,10 +18,9 @@ #ifndef WX_PRECOMP #include "wx/log.h" #include "wx/utils.h" + #include "wx/dataobj.h" #endif -#include "wx/dataobj.h" - #include "wx/x11/private.h" //----------------------------------------------------------------------------- @@ -33,11 +32,17 @@ Atom g_clipboardAtom = 0; Atom g_targetsAtom = 0; #endif +// avoid warnings about unused static variable (notice that we still use it +// even in release build if the compiler doesn't support variadic macros) +#if defined(__WXDEBUG__) || !defined(HAVE_VARIADIC_MACROS) + // 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!) static const wxChar *TRACE_CLIPBOARD = _T("clipboard"); +#endif // __WXDEBUG__ + //----------------------------------------------------------------------------- // reminder //----------------------------------------------------------------------------- @@ -211,7 +216,7 @@ selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event ) wxLogTrace(TRACE_CLIPBOARD, wxT("wxClipboard will get cleared" )); delete wxTheClipboard->m_data; - wxTheClipboard->m_data = (wxDataObject*) NULL; + wxTheClipboard->m_data = NULL; } } @@ -250,7 +255,7 @@ selection_handler( GtkWidget *WXUNUSED(widget), // transform Unicode text into multibyte before putting it on clipboard #if wxUSE_UNICODE - if ( format.GetType() == wxDF_TEXT ) + if ( format.GetType() == wxDF_TEXT || format.GetType() == wxDF_UNICODETEXT) { const wchar_t *wstr = (const wchar_t *)d; size_t len = wxConvCurrent->WC2MB(NULL, wstr, 0); @@ -288,8 +293,8 @@ wxClipboard::wxClipboard() m_ownsClipboard = false; m_ownsPrimarySelection = false; - m_data = (wxDataObject*) NULL; - m_receivedData = (wxDataObject*) NULL; + m_data = NULL; + m_receivedData = NULL; /* we use m_targetsWidget to query what formats are available */ @@ -301,8 +306,6 @@ wxClipboard::wxClipboard() m_formatSupported = false; m_targetRequested = 0; - - m_usePrimary = false; } wxClipboard::~wxClipboard() @@ -328,7 +331,7 @@ void wxClipboard::Clear() { m_waiting = true; - gtk_selection_owner_set( (GtkWidget*) NULL, g_clipboardAtom, + gtk_selection_owner_set( NULL, g_clipboardAtom, (guint32) GDK_CURRENT_TIME ); while (m_waiting) gtk_main_iteration(); @@ -338,7 +341,7 @@ void wxClipboard::Clear() { m_waiting = true; - gtk_selection_owner_set( (GtkWidget*) NULL, GDK_SELECTION_PRIMARY, + gtk_selection_owner_set( NULL, GDK_SELECTION_PRIMARY, (guint32) GDK_CURRENT_TIME ); while (m_waiting) gtk_main_iteration(); @@ -348,7 +351,7 @@ void wxClipboard::Clear() if (m_data) { delete m_data; - m_data = (wxDataObject*) NULL; + m_data = NULL; } #if wxUSE_THREADS