From abb88ef36b622958aee316eae76c79b145b831dd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 13 Sep 2007 18:37:00 +0000 Subject: [PATCH] remove the drag-and-drop compatibility hack for extracting the embedded size of the object from the beginning of data itself: this fixes bug 1791459 for the trunk git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48662 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/ole/dataobj.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index e02973d999..21c81b5bb4 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -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& 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, -- 2.45.2