]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/dnd.cpp
avoid setting initial position if it was not specified, broken in r70734
[wxWidgets.git] / src / osx / carbon / dnd.cpp
index b46737b0aa9168b53d8f359c65128f01b6024a2e..7310caed04385bbbf5fb684288fb6aecefdf637e 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Stefan Csomor
 // Modified by:
 // Created:     1998-01-01
-// RCS-ID:      $Id$
 // Copyright:   (c) 1998 Stefan Csomor
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
@@ -58,94 +57,6 @@ wxDropTarget::wxDropTarget( wxDataObject *data )
     wxMacEnsureTrackingHandlersInstalled();
 }
 
-bool wxDropTarget::CurrentDragHasSupportedFormat()
-{
-    bool supported = false;
-    if (m_dataObject == NULL)
-        return false;
-
-    if ( gTrackingGlobals.m_currentSource != NULL )
-    {
-        wxDataObject* data = gTrackingGlobals.m_currentSource->GetDataObject();
-
-        if ( data )
-        {
-            size_t formatcount = data->GetFormatCount();
-            wxDataFormat *array = new wxDataFormat[formatcount];
-            data->GetAllFormats( array );
-            for (size_t i = 0; !supported && i < formatcount; i++)
-            {
-                wxDataFormat format = array[i];
-                if ( m_dataObject->IsSupported( format ) )
-                {
-                    supported = true;
-                    break;
-                }
-            }
-
-            delete [] array;
-        }
-    }
-
-    if ( !supported )
-    {
-        supported = m_dataObject->HasDataInPasteboard( m_currentDragPasteboard );
-    }
-
-    return supported;
-}
-
-bool wxDropTarget::GetData()
-{
-    if (m_dataObject == NULL)
-        return false;
-
-    if ( !CurrentDragHasSupportedFormat() )
-        return false;
-
-    bool transferred = false;
-    if ( gTrackingGlobals.m_currentSource != NULL )
-    {
-        wxDataObject* data = gTrackingGlobals.m_currentSource->GetDataObject();
-
-        if (data != NULL)
-        {
-            size_t formatcount = data->GetFormatCount();
-            wxDataFormat *array = new wxDataFormat[formatcount];
-            data->GetAllFormats( array );
-            for (size_t i = 0; !transferred && i < formatcount; i++)
-            {
-                wxDataFormat format = array[i];
-                if ( m_dataObject->IsSupported( format ) )
-                {
-                    int size = data->GetDataSize( format );
-                    transferred = true;
-
-                    if (size == 0)
-                    {
-                        m_dataObject->SetData( format, 0, 0 );
-                    }
-                    else
-                    {
-                        char *d = new char[size];
-                        data->GetDataHere( format, (void*)d );
-                        m_dataObject->SetData( format, size, d );
-                        delete [] d;
-                    }
-                }
-            }
-
-            delete [] array;
-        }
-    }
-
-    if ( !transferred )
-    {
-        transferred = m_dataObject->GetFromPasteboard( m_currentDragPasteboard );
-    }
-
-    return transferred;
-}
 
 //-------------------------------------------------------------------------
 // wxDropSource
@@ -162,6 +73,11 @@ wxDropSource::wxDropSource(wxWindow *win,
     m_window = win;
 }
 
+wxDropSource* wxDropSource::GetCurrentDropSource()
+{
+    return gTrackingGlobals.m_currentSource;
+}
+
 wxDropSource::wxDropSource(wxDataObject& data,
                            wxWindow *win,
                            const wxCursor &cursorCopy,