From cf92614370139e8cf6154c2c31d1716e73f189de Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 28 Jun 2008 01:40:42 +0000 Subject: [PATCH] don't call OnData() if OnEnter() rejected the drag (#9634) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@54398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/ole/droptgt.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/msw/ole/droptgt.cpp b/src/msw/ole/droptgt.cpp index 6be0765f45..8e8a1eece4 100644 --- a/src/msw/ole/droptgt.cpp +++ b/src/msw/ole/droptgt.cpp @@ -239,15 +239,20 @@ STDMETHODIMP wxIDropTarget::DragOver(DWORD grfKeyState, result = wxDragNone; } - // we need client coordinates to pass to wxWin functions - if ( !ScreenToClient(m_hwnd, (POINT *)&pt) ) - { - wxLogLastError(wxT("ScreenToClient")); - } + if ( result != wxDragNone ) { + // we need client coordinates to pass to wxWin functions + if ( !ScreenToClient(m_hwnd, (POINT *)&pt) ) + { + wxLogLastError(wxT("ScreenToClient")); + } - *pdwEffect = ConvertDragResultToEffect( - m_pTarget->OnDragOver(pt.x, pt.y, result) - ); + *pdwEffect = ConvertDragResultToEffect( + m_pTarget->OnDragOver(pt.x, pt.y, result) + ); + } + else { + *pdwEffect = DROPEFFECT_NONE; + } return S_OK; }