diff options
author | Noel Grandin <noel@peralex.com> | 2013-02-11 14:44:18 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-02-12 10:14:47 +0200 |
commit | 0e286f768ed028ce91bb4730010363dac30acec6 (patch) | |
tree | 7336a8b7ec05c5677a42e789fea6c14b477b7d0c /dtrans/source/win32/dnd | |
parent | 851067c2684c68758afeaa7da23bb6dd69c51358 (diff) |
fdo#46808, use constructor for datatransfer::DataFormatTranslator
Change-Id: I68fd87ae71f764099b00b05a29cf5194d24da58d
Diffstat (limited to 'dtrans/source/win32/dnd')
-rw-r--r-- | dtrans/source/win32/dnd/dndentry.cxx | 5 | ||||
-rw-r--r-- | dtrans/source/win32/dnd/source.cxx | 6 | ||||
-rw-r--r-- | dtrans/source/win32/dnd/source.hxx | 4 | ||||
-rw-r--r-- | dtrans/source/win32/dnd/target.cxx | 6 | ||||
-rw-r--r-- | dtrans/source/win32/dnd/target.hxx | 4 |
5 files changed, 13 insertions, 12 deletions
diff --git a/dtrans/source/win32/dnd/dndentry.cxx b/dtrans/source/win32/dnd/dndentry.cxx index 6a45cbee6289..c463dee880b5 100644 --- a/dtrans/source/win32/dnd/dndentry.cxx +++ b/dtrans/source/win32/dnd/dndentry.cxx @@ -18,6 +18,7 @@ */ #include <cppuhelper/factory.hxx> +#include <comphelper/processfactory.hxx> #include <com/sun/star/container/XSet.hpp> #include <osl/diagnose.h> @@ -34,13 +35,13 @@ rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT; Reference< XInterface > SAL_CALL createDragSource( const Reference< XMultiServiceFactory >& rServiceManager ) { - DragSource* pSource= new DragSource( rServiceManager ); + DragSource* pSource= new DragSource( comphelper::getComponentContext(rServiceManager) ); return Reference<XInterface>( static_cast<XInitialization*>(pSource), UNO_QUERY); } Reference< XInterface > SAL_CALL createDropTarget( const Reference< XMultiServiceFactory >& rServiceManager ) { - DropTarget* pTarget= new DropTarget( rServiceManager ); + DropTarget* pTarget= new DropTarget( comphelper::getComponentContext(rServiceManager) ); return Reference<XInterface>( static_cast<XInitialization*>(pTarget), UNO_QUERY); } diff --git a/dtrans/source/win32/dnd/source.cxx b/dtrans/source/win32/dnd/source.cxx index 2b4cd8314baa..bc3ad7f591f3 100644 --- a/dtrans/source/win32/dnd/source.cxx +++ b/dtrans/source/win32/dnd/source.cxx @@ -67,9 +67,9 @@ unsigned __stdcall DndOleSTAFunc(LPVOID pParams); //---------------------------------------------------- /** Ctor */ -DragSource::DragSource( const Reference<XMultiServiceFactory>& sf): +DragSource::DragSource( const Reference<XComponentContext>& rxContext): WeakComponentImplHelper3< XDragSource, XInitialization, XServiceInfo >(m_mutex), - m_serviceFactory( sf), + m_xContext( rxContext ), // m_pcurrentContext_impl(0), m_hAppWindow(0), m_MouseButton(0), @@ -131,7 +131,7 @@ void DragSource::StartDragImpl( //<-- TRA m_spDataObject= m_aDataConverter.createDataObjFromTransferable( - m_serviceFactory, trans); + m_xContext, trans); // Obtain the id of the thread that created the window DWORD processId; diff --git a/dtrans/source/win32/dnd/source.hxx b/dtrans/source/win32/dnd/source.hxx index 5690b04b493c..736e2bc9f4c0 100644 --- a/dtrans/source/win32/dnd/source.hxx +++ b/dtrans/source/win32/dnd/source.hxx @@ -51,7 +51,7 @@ class DragSource: public IDropSource { - Reference<XMultiServiceFactory> m_serviceFactory; + Reference<XComponentContext> m_xContext; HWND m_hAppWindow; // The mouse button that set off the drag and drop operation @@ -89,7 +89,7 @@ public: sal_Int8 m_sourceActions; public: - DragSource(const Reference<XMultiServiceFactory>& sf); + DragSource(const Reference<XComponentContext>& rxContext); virtual ~DragSource(); // XInitialization diff --git a/dtrans/source/win32/dnd/target.cxx b/dtrans/source/win32/dnd/target.cxx index cb9430ec0b2a..4afce4bf271e 100644 --- a/dtrans/source/win32/dnd/target.cxx +++ b/dtrans/source/win32/dnd/target.cxx @@ -46,7 +46,7 @@ extern Reference< XTransferable > g_XTransferable; extern rtl_StandardModuleCount g_moduleCount; DWORD WINAPI DndTargetOleSTAFunc(LPVOID pParams); -DropTarget::DropTarget( const Reference<XMultiServiceFactory>& sf): +DropTarget::DropTarget( const Reference<XComponentContext>& rxContext): WeakComponentImplHelper3<XInitialization,XDropTarget, XServiceInfo>(m_mutex), m_hWnd( NULL), m_threadIdWindow(0), @@ -54,7 +54,7 @@ DropTarget::DropTarget( const Reference<XMultiServiceFactory>& sf): m_hOleThread(0), m_oleThreadId( 0), m_pDropTarget( NULL), - m_serviceFactory( sf), + m_xContext( rxContext ), m_bActive(sal_True), m_nDefaultActions(ACTION_COPY|ACTION_MOVE|ACTION_LINK|ACTION_DEFAULT), m_nCurrentDropAction( ACTION_NONE), @@ -340,7 +340,7 @@ HRESULT DropTarget::DragEnter( IDataObject *pDataObj, { // Convert the IDataObject to a XTransferable m_currentData= m_aDataConverter.createTransferableFromDataObj( - m_serviceFactory, IDataObjectPtr(pDataObj)); + m_xContext, IDataObjectPtr(pDataObj)); } //<-- TRA diff --git a/dtrans/source/win32/dnd/target.hxx b/dtrans/source/win32/dnd/target.hxx index d78e3afa4a8b..16e5b8921ec4 100644 --- a/dtrans/source/win32/dnd/target.hxx +++ b/dtrans/source/win32/dnd/target.hxx @@ -85,7 +85,7 @@ private: // this class. IDropTarget* m_pDropTarget; - Reference<XMultiServiceFactory> m_serviceFactory; + Reference<XComponentContext> m_xContext; // If m_bActive == sal_True then events are fired to XDropTargetListener s, // none otherwise. The default value is sal_True. sal_Bool m_bActive; @@ -116,7 +116,7 @@ private: DropTarget &operator= (DropTarget&); public: - DropTarget(const Reference<XMultiServiceFactory>& sf); + DropTarget(const Reference<XComponentContext>& rxContext); virtual ~DropTarget(); // Overrides WeakComponentImplHelper::disposing which is called by |