]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/ole/dataobj.cpp
fix an unused variable warning in release build
[wxWidgets.git] / src / msw / ole / dataobj.cpp
index e02973d999a345da83a4a926f0cb811878ca18ac..3003abdd38bf4fab236fda378e6b3461222327c8 100644 (file)
@@ -686,13 +686,14 @@ size_t wxDataObject::GetBufferOffset(const wxDataFormat& format )
     return NeedsVerbatimData(format) ? 0 : sizeof(size_t);
 }
 
-const void* wxDataObject::GetSizeFromBuffer( const void* buffer, size_t* size,
-                                               const wxDataFormat& format )
+const void *wxDataObject::GetSizeFromBuffer(const void *buffer,
+                                            size_t *size,
+                                            const wxDataFormat& WXUNUSED(format))
 {
     // hack: the third parameter is declared non-const in Wine's headers so
     // cast away the const
-    size_t realsz = ::HeapSize(::GetProcessHeap(), 0,
-                               wx_const_cast(void*, buffer));
+    const size_t realsz = ::HeapSize(::GetProcessHeap(), 0,
+                                     wx_const_cast(void*, buffer));
     if ( realsz == (size_t)-1 )
     {
         // note that HeapSize() does not set last error
@@ -702,18 +703,7 @@ const void* wxDataObject::GetSizeFromBuffer( const void* buffer, size_t* size,
 
     *size = realsz;
 
-    // check if this data has its size prepended (as it was by default for wx
-    // programs prior 2.6.3):
-    size_t *p = (size_t *)buffer;
-    if ( *p == realsz )
-    {
-        if ( NeedsVerbatimData(format) )
-            wxLogDebug(wxT("Apparent data format mismatch: size not needed"));
-
-        p++; // this data has its size prepended; skip first DWORD
-    }
-
-    return p;
+    return buffer;
 }
 
 void* wxDataObject::SetSizeInBuffer( void* buffer, size_t size,
@@ -1259,11 +1249,15 @@ void wxURLDataObject::SetURL(const wxString& url)
     if ( urlMB )
     {
         const size_t len = strlen(urlMB) + 1; // size with trailing NUL
+#if !wxUSE_UNICODE
         SetData(wxDF_TEXT, len, urlMB);
+#endif
         SetData(wxDataFormat(CFSTR_SHELLURL), len, urlMB);
     }
 
+#if wxUSE_UNICODE
     SetData(wxDF_UNICODETEXT, url.length() + 1, url.wc_str());
+#endif
 }
 
 // ----------------------------------------------------------------------------