X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6670f56440ae9209b3e2e51e06acf3bc5aaf1905..ee5aa9d44fa75e88bce9981d7d02dea9f6d5f3c4:/src/os2/dnd.cpp diff --git a/src/os2/dnd.cpp b/src/os2/dnd.cpp index 3a2492f741..3a968d3586 100644 --- a/src/os2/dnd.cpp +++ b/src/os2/dnd.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: dnd.cpp +// Name: src/os2/dnd.cpp // Purpose: wxDropTarget, wxDropSource, wxDataObject implementation // Author: David Webster // Modified by: @@ -9,20 +9,19 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "dnd.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #if wxUSE_DRAG_AND_DROP -#include "wx/window.h" -#include "wx/app.h" -#include "wx/gdicmn.h" #include "wx/dnd.h" +#ifndef WX_PRECOMP + #include "wx/app.h" + #include "wx/window.h" + #include "wx/gdicmn.h" +#endif + #define INCL_PM #define INCL_DOS #include @@ -388,7 +387,7 @@ wxDataFormat wxDropTarget::GetSupportedFormat ( for (i = 0; i < ulItems; i++) { pDragItem = ::DrgQueryDragitemPtr(pDataSource, i); - if (::DrgVerifyRMF(pDragItem, (PSZ)sMechanism.c_str(), (PSZ)sFormat.c_str())) + if (::DrgVerifyRMF(pDragItem, sMechanism.c_str(), sFormat.c_str())) { bValid = true; break; @@ -444,17 +443,12 @@ bool wxDropTarget::OnDrop ( // wxDropSource //------------------------------------------------------------------------- -wxDropSource::wxDropSource ( - wxWindow* pWin -) +wxDropSource::wxDropSource ( wxWindow* WXUNUSED(pWin) ) { Init(); } // end of wxDropSource::wxDropSource -wxDropSource::wxDropSource ( - wxDataObject& rData -, wxWindow* pWin -) +wxDropSource::wxDropSource ( wxDataObject& rData, wxWindow* WXUNUSED(pWin) ) { Init(); SetData(rData); @@ -552,13 +546,13 @@ void wxDropSource::Init () m_vDragImage.cxOffset = 0; m_vDragImage.cyOffset = 0; - HSTR hStrType = ::DrgAddStrHandle(DRT_UNKNOWN); - HSTR hStrRMF; - HSTR hStrContainer; - wxChar zFormats[128]; - wxChar zContainer[128]; - USHORT uSize = GetDataObject()->GetDataSize(GetDataObject()->GetPreferredFormat()) + 1; - wxChar* pzBuffer = new wxChar[uSize]; + HSTR hStrType = ::DrgAddStrHandle(DRT_UNKNOWN); + HSTR hStrRMF; + HSTR hStrContainer; + wxChar zFormats[128]; + wxChar zContainer[128]; + USHORT uSize = (USHORT)(GetDataObject()->GetDataSize(GetDataObject()->GetPreferredFormat()) + 1); + wxChar* pzBuffer = new wxChar[uSize]; memset(pzBuffer, '\0', GetDataObject()->GetDataSize(GetDataObject()->GetPreferredFormat())); pzBuffer[GetDataObject()->GetDataSize(GetDataObject()->GetPreferredFormat())] = '\0';