]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/clipbrd.cpp
Merge in from trunk r64802 - r68625
[wxWidgets.git] / src / x11 / clipbrd.cpp
index 1e8fa4ba38359694e9874f16906d0c62db1c00a0..0e5f06f2ac55411828ee660972ae72d4b35a07e0 100644 (file)
@@ -32,13 +32,14 @@ Atom  g_clipboardAtom   = 0;
 Atom  g_targetsAtom     = 0;
 #endif
 
 Atom  g_targetsAtom     = 0;
 #endif
 
-// avoid warnings about unused static variable
-#if defined(__WXDEBUG__) && defined(HAVE_VARIADIC_MACROS)
+// 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!)
 
 // 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");
+static const wxChar *TRACE_CLIPBOARD = wxT("clipboard");
 
 #endif // __WXDEBUG__
 
 
 #endif // __WXDEBUG__
 
@@ -90,7 +91,7 @@ targets_selection_received( GtkWidget *WXUNUSED(widget),
             if ( strcmp(gdk_atom_name(type), "TARGETS") )
             {
                 wxLogTrace( TRACE_CLIPBOARD,
             if ( strcmp(gdk_atom_name(type), "TARGETS") )
             {
                 wxLogTrace( TRACE_CLIPBOARD,
-                            _T("got unsupported clipboard target") );
+                            wxT("got unsupported clipboard target") );
 
                 clipboard->m_waiting = false;
                 return;
 
                 clipboard->m_waiting = false;
                 return;
@@ -214,8 +215,7 @@ selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event )
         {
             wxLogTrace(TRACE_CLIPBOARD, wxT("wxClipboard will get cleared" ));
 
         {
             wxLogTrace(TRACE_CLIPBOARD, wxT("wxClipboard will get cleared" ));
 
-            delete wxTheClipboard->m_data;
-            wxTheClipboard->m_data = (wxDataObject*) NULL;
+            wxDELETE(wxTheClipboard->m_data);
         }
     }
 
         }
     }
 
@@ -292,8 +292,8 @@ wxClipboard::wxClipboard()
     m_ownsClipboard = false;
     m_ownsPrimarySelection = false;
 
     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 */
 
 
     /* we use m_targetsWidget to query what formats are available */
 
@@ -305,8 +305,6 @@ wxClipboard::wxClipboard()
 
     m_formatSupported = false;
     m_targetRequested = 0;
 
     m_formatSupported = false;
     m_targetRequested = 0;
-
-    m_usePrimary = false;
 }
 
 wxClipboard::~wxClipboard()
 }
 
 wxClipboard::~wxClipboard()
@@ -332,7 +330,7 @@ void wxClipboard::Clear()
         {
             m_waiting = true;
 
         {
             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();
                                      (guint32) GDK_CURRENT_TIME );
 
             while (m_waiting) gtk_main_iteration();
@@ -342,18 +340,14 @@ void wxClipboard::Clear()
         {
             m_waiting = true;
 
         {
             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();
         }
 #endif
 
                                      (guint32) GDK_CURRENT_TIME );
 
             while (m_waiting) gtk_main_iteration();
         }
 #endif
 
-        if (m_data)
-        {
-            delete m_data;
-            m_data = (wxDataObject*) NULL;
-        }
+        wxDELETE(m_data);
 
 #if wxUSE_THREADS
         /* re-enable GUI threads */
 
 #if wxUSE_THREADS
         /* re-enable GUI threads */