diff options
author | Tino Rachui <tra@openoffice.org> | 2001-03-23 08:39:59 +0000 |
---|---|---|
committer | Tino Rachui <tra@openoffice.org> | 2001-03-23 08:39:59 +0000 |
commit | d57a1faf4adf52954a64a0cb51d034e2fea8a85b (patch) | |
tree | 18f5beca0574bdfe135e4cce17a2c1882744616f /dtrans | |
parent | 74066748219dd60744bbcfe4f87d736e7bbaf47f (diff) |
shortcut implemented
Diffstat (limited to 'dtrans')
-rw-r--r-- | dtrans/source/win32/dnd/globals.cxx | 14 | ||||
-rw-r--r-- | dtrans/source/win32/dnd/globals.hxx | 6 | ||||
-rw-r--r-- | dtrans/source/win32/dnd/source.cxx | 21 | ||||
-rw-r--r-- | dtrans/source/win32/dnd/target.cxx | 28 |
4 files changed, 56 insertions, 13 deletions
diff --git a/dtrans/source/win32/dnd/globals.cxx b/dtrans/source/win32/dnd/globals.cxx index be169bc52dc1..1d18e7628d9b 100644 --- a/dtrans/source/win32/dnd/globals.cxx +++ b/dtrans/source/win32/dnd/globals.cxx @@ -2,9 +2,9 @@ * * $RCSfile: globals.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jl $ $Date: 2001-02-08 14:30:48 $ + * last change: $Author: tra $ $Date: 2001-03-23 09:39:43 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,6 +65,16 @@ #include "globals.hxx" +//--> TRA +#ifndef _COM_SUN_STAR_DATATRANSFER_XTRANSFERABLE_HPP_ +#include <com/sun/star/datatransfer/XTransferable.hpp> +#endif + +// used as shortcut when drag-source and drop-target are the same +::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > g_XTransferable; + +//<-- TRA + using namespace com::sun::star::datatransfer::dnd::DNDConstants; sal_Int8 dndOleKeysToAction( DWORD grfKeyState) diff --git a/dtrans/source/win32/dnd/globals.hxx b/dtrans/source/win32/dnd/globals.hxx index 5fbb69325159..bcbe3a8bc69b 100644 --- a/dtrans/source/win32/dnd/globals.hxx +++ b/dtrans/source/win32/dnd/globals.hxx @@ -2,9 +2,9 @@ * * $RCSfile: globals.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: obr $ $Date: 2001-02-14 16:07:46 $ + * last change: $Author: tra $ $Date: 2001-03-23 09:39:43 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,8 +77,6 @@ #define DNDTARGET_IMPL_NAME "com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1" #define DNDTARGET_REGKEY_NAME "/com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1/UNO/SERVICES/com.sun.star.datatransfer.dnd.OleDropTarget" - - // This maps key states as occur as parameter, e.g. in IDropTarget::DragEnter, // IDropSource::QueryContinueDrag, to actions as are declared in // com::sun::star::datatransfer::dnd::DNDConstants ( ACTION_MOVE etc). diff --git a/dtrans/source/win32/dnd/source.cxx b/dtrans/source/win32/dnd/source.cxx index b4f947de79aa..8e371d604de3 100644 --- a/dtrans/source/win32/dnd/source.cxx +++ b/dtrans/source/win32/dnd/source.cxx @@ -2,9 +2,9 @@ * * $RCSfile: source.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: jl $ $Date: 2001-03-02 13:15:15 $ + * last change: $Author: tra $ $Date: 2001-03-23 09:39:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -94,6 +94,13 @@ using namespace com::sun::star::awt::MouseButton; using namespace com::sun::star::awt; using namespace com::sun::star::lang; + +//--> TRA + +extern Reference< XTransferable > g_XTransferable; + +//<-- TRA + DWORD WINAPI DndOleSTAFunc(LPVOID pParams); @@ -164,6 +171,11 @@ void SAL_CALL DragSource::startDrag( const DragGestureEvent& trigger, static_cast<DragSource*>(this), listener ) ); // Convert the XTransferable data object into an IDataObject object; + + //--> TRA + g_XTransferable = trans; + //<-- TRA + m_spDataObject= m_aDataConverter.createDataObjFromTransferable( m_serviceFactory, trans); @@ -308,6 +320,11 @@ DWORD WINAPI DndOleSTAFunc(LPVOID pParams) dndActionsToDropEffects( pSource->m_sourceActions), &dwEffect); + //--> TRA + // clear the global transferable again + g_XTransferable = Reference< XTransferable >( ); + //<-- TRA + OSL_ENSURE( hr != E_INVALIDARG, "IDataObject impl does not contain valid data"); //Fire event diff --git a/dtrans/source/win32/dnd/target.cxx b/dtrans/source/win32/dnd/target.cxx index 44d64a567ad5..593dd0341c58 100644 --- a/dtrans/source/win32/dnd/target.cxx +++ b/dtrans/source/win32/dnd/target.cxx @@ -2,9 +2,9 @@ * * $RCSfile: target.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: tra $ $Date: 2001-03-08 08:09:16 $ + * last change: $Author: tra $ $Date: 2001-03-23 09:39:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -80,6 +80,12 @@ using namespace com::sun::star::datatransfer; using namespace com::sun::star::datatransfer::dnd; using namespace com::sun::star::datatransfer::dnd::DNDConstants; +//--> TRA + +extern Reference< XTransferable > g_XTransferable; + +//<-- TRA + DropTarget::DropTarget( const Reference<XMultiServiceFactory>& sf): m_hWnd( NULL), m_serviceFactory( sf), @@ -239,9 +245,21 @@ HRESULT DropTarget::DragEnter( IDataObject *pDataObj, m_currentDragContext= static_cast<XDropTargetDragContext*>( new TargetDragContext( static_cast<DropTarget*>(this) ) ); - // Convert the IDataObject to a XTransferable - m_currentData= m_aDataConverter.createTransferableFromDataObj( - m_serviceFactory, pDataObj); + + //--> TRA + + // shortcut + if ( g_XTransferable.is( ) ) + m_currentData = g_XTransferable; + else + { + // Convert the IDataObject to a XTransferable + m_currentData= m_aDataConverter.createTransferableFromDataObj( + m_serviceFactory, pDataObj); + } + + //<-- TRA + if( m_nListenerDropAction != ACTION_NONE) { DropTargetDragEnterEvent e; |