diff options
author | Alexandre Vicenzi <vicenzi.alexandre@gmail.com> | 2014-01-31 06:10:13 -0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-02-04 10:16:33 +0000 |
commit | 6ad41af76fc5a101e553472dd070b065a3e8b28c (patch) | |
tree | eef1b35947da8369309ee3347b817bd17e615d43 /dtrans | |
parent | a4835f66dd8335c9565af9d68630beadcba9a607 (diff) |
fdo#54938 Convert dtrans, remoteb., reportd., ucbhelper to cppu::supportsSer..
Change-Id: I42cf7dc139b79b715f3c330f9bca7d333de8bafc
Reviewed-on: https://gerrit.libreoffice.org/7762
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'dtrans')
-rw-r--r-- | dtrans/source/win32/dnd/source.cxx | 49 | ||||
-rw-r--r-- | dtrans/source/win32/dnd/target.cxx | 25 |
2 files changed, 15 insertions, 59 deletions
diff --git a/dtrans/source/win32/dnd/source.cxx b/dtrans/source/win32/dnd/source.cxx index 1335da549ea0..aed131fe94f7 100644 --- a/dtrans/source/win32/dnd/source.cxx +++ b/dtrans/source/win32/dnd/source.cxx @@ -21,7 +21,7 @@ #include <com/sun/star/datatransfer/XTransferable.hpp> #include <com/sun/star/awt/MouseButton.hpp> #include <com/sun/star/awt/MouseEvent.hpp> - +#include <cppuhelper/supportsservice.hxx> #include <process.h> #include <memory> @@ -68,7 +68,6 @@ DragSource::~DragSource() { } -//---------------------------------------------------- /** First start a new drag and drop thread if the last one has finished @@ -135,10 +134,7 @@ void DragSource::StartDragImpl( } // XInitialization - -//---------------------------------------------------- -/** aArguments contains a machine id -*/ +/** aArguments contains a machine id */ void SAL_CALL DragSource::initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException) { @@ -147,28 +143,21 @@ void SAL_CALL DragSource::initialize( const Sequence< Any >& aArguments ) OSL_ASSERT( IsWindow( m_hAppWindow) ); } -//---------------------------------------------------- -/** XDragSource -*/ +/** XDragSource */ sal_Bool SAL_CALL DragSource::isDragImageSupported( ) throw(RuntimeException) { return 0; } -//---------------------------------------------------- -/** -*/ sal_Int32 SAL_CALL DragSource::getDefaultCursor( sal_Int8 /*dragAction*/ ) throw( IllegalArgumentException, RuntimeException) { return 0; } -//---------------------------------------------------- /** Notifies the XDragSourceListener by - calling dragDropEnd -*/ + calling dragDropEnd */ void SAL_CALL DragSource::startDrag( const DragGestureEvent& trigger, sal_Int8 sourceActions, @@ -206,9 +195,7 @@ void SAL_CALL DragSource::startDrag( } } -//---------------------------------------------------- -/**IDropTarget -*/ +/** IDropTarget */ HRESULT STDMETHODCALLTYPE DragSource::QueryInterface( REFIID riid, void **ppvObject) { if( !ppvObject) @@ -230,18 +217,12 @@ HRESULT STDMETHODCALLTYPE DragSource::QueryInterface( REFIID riid, void **ppvOb } -//---------------------------------------------------- -/** -*/ ULONG STDMETHODCALLTYPE DragSource::AddRef( void) { acquire(); return (ULONG) m_refCount; } -//---------------------------------------------------- -/** -*/ ULONG STDMETHODCALLTYPE DragSource::Release( void) { ULONG ref= m_refCount; @@ -249,9 +230,7 @@ ULONG STDMETHODCALLTYPE DragSource::Release( void) return --ref; } -//---------------------------------------------------- -/** IDropSource -*/ +/** IDropSource */ HRESULT STDMETHODCALLTYPE DragSource::QueryContinueDrag( /* [in] */ BOOL fEscapePressed, /* [in] */ DWORD grfKeyState) @@ -292,9 +271,6 @@ HRESULT STDMETHODCALLTYPE DragSource::QueryContinueDrag( return retVal; } -//---------------------------------------------------- -/** -*/ HRESULT STDMETHODCALLTYPE DragSource::GiveFeedback( /* [in] */ DWORD #if defined DBG_CONSOLE_OUT @@ -317,9 +293,7 @@ OUString SAL_CALL DragSource::getImplementationName( ) throw (RuntimeException) // XServiceInfo sal_Bool SAL_CALL DragSource::supportsService( const OUString& ServiceName ) throw (RuntimeException) { - if( ServiceName == DNDSOURCE_SERVICE_NAME ) - return sal_True; - return sal_False; + return cppu::supportsService(this, ServiceName); } Sequence< OUString > SAL_CALL DragSource::getSupportedServiceNames( ) throw (RuntimeException) @@ -329,13 +303,11 @@ Sequence< OUString > SAL_CALL DragSource::getSupportedServiceNames( ) throw (Ru return Sequence<OUString>(names, 1); } -//---------------------------------------------------- -/**This function is called as extra thread from +/** This function is called as extra thread from DragSource::executeDrag. The function carries out a drag and drop operation by calling DoDragDrop. The thread also notifies all - XSourceListener. -*/ + XSourceListener. */ unsigned __stdcall DndOleSTAFunc(LPVOID pParams) { // The structure contains all arguments for DoDragDrop and other @@ -400,7 +372,4 @@ unsigned __stdcall DndOleSTAFunc(LPVOID pParams) return 0; } - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dtrans/source/win32/dnd/target.cxx b/dtrans/source/win32/dnd/target.cxx index 14b79b809e39..bdc0b05a51b2 100644 --- a/dtrans/source/win32/dnd/target.cxx +++ b/dtrans/source/win32/dnd/target.cxx @@ -19,7 +19,7 @@ #include <com/sun/star/datatransfer/dnd/DNDConstants.hpp> #include <com/sun/star/datatransfer/XTransferable.hpp> - +#include <cppuhelper/supportsservice.hxx> #include <stdio.h> #include "target.hxx" #include "idroptarget.hxx" @@ -27,6 +27,7 @@ #include "targetdropcontext.hxx" #include "targetdragcontext.hxx" #include <rtl/ustring.h> + using namespace cppu; using namespace osl; using namespace com::sun::star::datatransfer; @@ -238,9 +239,6 @@ DWORD WINAPI DndTargetOleSTAFunc(LPVOID pParams) return 0; } - - - // XServiceInfo OUString SAL_CALL DropTarget::getImplementationName( ) throw (RuntimeException) { @@ -249,9 +247,7 @@ OUString SAL_CALL DropTarget::getImplementationName( ) throw (RuntimeException) // XServiceInfo sal_Bool SAL_CALL DropTarget::supportsService( const OUString& ServiceName ) throw (RuntimeException) { - if( ServiceName == DNDTARGET_SERVICE_NAME ) - return sal_True; - return sal_False; + return cppu::supportsService(this, ServiceName); } Sequence< OUString > SAL_CALL DropTarget::getSupportedServiceNames( ) throw (RuntimeException) @@ -260,8 +256,7 @@ Sequence< OUString > SAL_CALL DropTarget::getSupportedServiceNames( ) throw (Ru return Sequence<OUString>(names, 1); } - -// XDropTarget ---------------------------------------------------------------- +// XDropTarget void SAL_CALL DropTarget::addDropTargetListener( const Reference< XDropTargetListener >& dtl ) throw(RuntimeException) { @@ -286,7 +281,6 @@ void SAL_CALL DropTarget::setActive( sal_Bool _b ) throw(RuntimeException) m_bActive= _b; } - sal_Int8 SAL_CALL DropTarget::getDefaultActions( ) throw(RuntimeException) { return m_nDefaultActions; @@ -298,7 +292,6 @@ void SAL_CALL DropTarget::setDefaultActions( sal_Int8 actions ) throw(RuntimeExc m_nDefaultActions= actions; } - HRESULT DropTarget::DragEnter( IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, @@ -490,8 +483,6 @@ HRESULT DropTarget::Drop( IDataObject * /*pDataObj*/, return S_OK; } - - void DropTarget::fire_drop( const DropTargetDropEvent& dte) { OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (Reference<XDropTargetListener>* )0 ) ); @@ -563,7 +554,7 @@ void DropTarget::fire_dropActionChanged( const DropTargetDragEvent& dtde ) } } -// Non - interface functions ============================================================ +// Non - interface functions // DropTarget fires events to XDropTargetListeners. The event object contains an // XDropTargetDropContext implementaion. When the listener calls on that interface // then the calls are delegated from DropContext (XDropTargetDropContext) to these @@ -597,7 +588,7 @@ void DropTarget::_dropComplete(sal_Bool success, const Reference<XDropTargetDrop m_bDropComplete= success; } } -// -------------------------------------------------------------------------------------- + // DropTarget fires events to XDropTargetListeners. The event object can contains an // XDropTargetDragContext implementaion. When the listener calls on that interface // then the calls are delegated from DragContext (XDropTargetDragContext) to these @@ -620,10 +611,6 @@ void DropTarget::_rejectDrag( const Reference<XDropTargetDragContext>& context) } } - -//-------------------------------------------------------------------------------------- - - // This function determines the action dependend on the pressed // key modifiers ( CTRL, SHIFT, ALT, Right Mouse Button). The result // is then checked against the allowed actions which can be set through |