diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-10-14 16:57:04 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-10-16 14:19:20 +0000 |
commit | 1f9b6013e507ee4acb9374cee909f59139d52978 (patch) | |
tree | 014cc1248815b7722cea3e20af0c09d58fe37f46 /dtrans/source/win32/dnd | |
parent | 5eab3e5eec67ad97f39f792852e88003fea89d1c (diff) |
clang-cl loplugin: dtrans
Change-Id: I1d55f3e7ecbde486f318d5175b1570f0caa33255
Reviewed-on: https://gerrit.libreoffice.org/29870
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'dtrans/source/win32/dnd')
-rw-r--r-- | dtrans/source/win32/dnd/dndentry.cxx | 6 | ||||
-rw-r--r-- | dtrans/source/win32/dnd/idroptarget.cxx | 2 | ||||
-rw-r--r-- | dtrans/source/win32/dnd/idroptarget.hxx | 14 | ||||
-rw-r--r-- | dtrans/source/win32/dnd/source.cxx | 26 | ||||
-rw-r--r-- | dtrans/source/win32/dnd/source.hxx | 26 | ||||
-rw-r--r-- | dtrans/source/win32/dnd/sourcecontext.cxx | 8 | ||||
-rw-r--r-- | dtrans/source/win32/dnd/sourcecontext.hxx | 12 | ||||
-rw-r--r-- | dtrans/source/win32/dnd/target.cxx | 72 | ||||
-rw-r--r-- | dtrans/source/win32/dnd/target.hxx | 30 | ||||
-rw-r--r-- | dtrans/source/win32/dnd/targetdragcontext.hxx | 6 | ||||
-rw-r--r-- | dtrans/source/win32/dnd/targetdropcontext.hxx | 8 |
11 files changed, 107 insertions, 103 deletions
diff --git a/dtrans/source/win32/dnd/dndentry.cxx b/dtrans/source/win32/dnd/dndentry.cxx index 79aa8cc08324..170fe5388375 100644 --- a/dtrans/source/win32/dnd/dndentry.cxx +++ b/dtrans/source/win32/dnd/dndentry.cxx @@ -48,7 +48,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL dnd_component_getFactory( const sal_Char* pImplName, void* pSrvManager, void* /*pRegistryKey*/ ) { - void* pRet = 0; + void* pRet = nullptr; Reference< XSingleServiceFactory > xFactory; if ( pSrvManager && ( 0 == rtl_str_compare( pImplName, DNDSOURCE_IMPL_NAME ) ) ) @@ -56,7 +56,7 @@ dnd_component_getFactory( const sal_Char* pImplName, void* pSrvManager, void* /* Sequence< OUString > aSNS { DNDSOURCE_SERVICE_NAME }; xFactory= createSingleFactory( - reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ), + static_cast< XMultiServiceFactory* > ( pSrvManager ), OUString::createFromAscii( pImplName ), createDragSource, aSNS); @@ -67,7 +67,7 @@ dnd_component_getFactory( const sal_Char* pImplName, void* pSrvManager, void* /* Sequence< OUString > aSNS { DNDTARGET_SERVICE_NAME }; xFactory= createSingleFactory( - reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ), + static_cast< XMultiServiceFactory* > ( pSrvManager ), OUString::createFromAscii( pImplName ), createDropTarget, aSNS); diff --git a/dtrans/source/win32/dnd/idroptarget.cxx b/dtrans/source/win32/dnd/idroptarget.cxx index 0edc50ab4b04..1686baf0d718 100644 --- a/dtrans/source/win32/dnd/idroptarget.cxx +++ b/dtrans/source/win32/dnd/idroptarget.cxx @@ -40,7 +40,7 @@ HRESULT STDMETHODCALLTYPE IDropTargetImpl::QueryInterface( REFIID riid, void ** { if( !ppvObject) return E_POINTER; - *ppvObject= NULL; + *ppvObject= nullptr; if( riid == __uuidof( IUnknown)) *ppvObject= static_cast<IUnknown*>( this); diff --git a/dtrans/source/win32/dnd/idroptarget.hxx b/dtrans/source/win32/dnd/idroptarget.hxx index c7843a3de951..a86739f87cdd 100644 --- a/dtrans/source/win32/dnd/idroptarget.hxx +++ b/dtrans/source/win32/dnd/idroptarget.hxx @@ -36,30 +36,30 @@ public: // IDropTarget virtual HRESULT STDMETHODCALLTYPE QueryInterface( /* [in] */ REFIID riid, - /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); + /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject) override; - virtual ULONG STDMETHODCALLTYPE AddRef( ); + virtual ULONG STDMETHODCALLTYPE AddRef( ) override; - virtual ULONG STDMETHODCALLTYPE Release( ); + virtual ULONG STDMETHODCALLTYPE Release( ) override; virtual HRESULT STDMETHODCALLTYPE DragEnter( /* [unique][in] */ IDataObject __RPC_FAR *pDataObj, /* [in] */ DWORD grfKeyState, /* [in] */ POINTL pt, - /* [out][in] */ DWORD __RPC_FAR *pdwEffect); + /* [out][in] */ DWORD __RPC_FAR *pdwEffect) override; virtual HRESULT STDMETHODCALLTYPE DragOver( /* [in] */ DWORD grfKeyState, /* [in] */ POINTL pt, - /* [out][in] */ DWORD __RPC_FAR *pdwEffect); + /* [out][in] */ DWORD __RPC_FAR *pdwEffect) override; - virtual HRESULT STDMETHODCALLTYPE DragLeave( ) ; + virtual HRESULT STDMETHODCALLTYPE DragLeave( ) override; virtual HRESULT STDMETHODCALLTYPE Drop( /* [unique][in] */ IDataObject __RPC_FAR *pDataObj, /* [in] */ DWORD grfKeyState, /* [in] */ POINTL pt, - /* [out][in] */ DWORD __RPC_FAR *pdwEffect); + /* [out][in] */ DWORD __RPC_FAR *pdwEffect) override; }; #endif diff --git a/dtrans/source/win32/dnd/source.cxx b/dtrans/source/win32/dnd/source.cxx index fb5e6c0830fc..7bf94f8b8000 100644 --- a/dtrans/source/win32/dnd/source.cxx +++ b/dtrans/source/win32/dnd/source.cxx @@ -22,6 +22,8 @@ #include <com/sun/star/awt/MouseButton.hpp> #include <com/sun/star/awt/MouseEvent.hpp> #include <cppuhelper/supportsservice.hxx> +#include <o3tl/any.hxx> + #include <process.h> #include <memory> @@ -59,7 +61,7 @@ DragSource::DragSource( const Reference<XComponentContext>& rxContext): WeakComponentImplHelper< XDragSource, XInitialization, XServiceInfo >(m_mutex), m_xContext( rxContext ), // m_pcurrentContext_impl(0), - m_hAppWindow(0), + m_hAppWindow(nullptr), m_MouseButton(0), m_RunningDndOperationCount(0) { @@ -104,7 +106,7 @@ void DragSource::StartDragImpl( // while this function executes). The source context is also used // in DragSource::QueryContinueDrag. m_currentContext= static_cast<XDragSourceContext*>( new SourceContext( - static_cast<DragSource*>(this), listener ) ); + this, listener ) ); // Convert the XTransferable data object into an IDataObject object; @@ -128,7 +130,7 @@ void DragSource::StartDragImpl( // Hopefully this instance is not destroyed before the thread has terminated. unsigned threadId; HANDLE hThread= reinterpret_cast<HANDLE>(_beginthreadex( - 0, 0, DndOleSTAFunc, reinterpret_cast<void*>(this), 0, &threadId)); + nullptr, 0, DndOleSTAFunc, this, 0, &threadId)); // detach from thread CloseHandle(hThread); @@ -140,7 +142,7 @@ void SAL_CALL DragSource::initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException) { if( aArguments.getLength() >=2) - m_hAppWindow= *(HWND*)aArguments[1].getValue(); + m_hAppWindow= reinterpret_cast<HWND>(static_cast<sal_uIntPtr>(*o3tl::doAccess<sal_uInt64>(aArguments[1]))); OSL_ASSERT( IsWindow( m_hAppWindow) ); } @@ -148,7 +150,7 @@ void SAL_CALL DragSource::initialize( const Sequence< Any >& aArguments ) sal_Bool SAL_CALL DragSource::isDragImageSupported( ) throw(RuntimeException) { - return 0; + return false; } sal_Int32 SAL_CALL DragSource::getDefaultCursor( sal_Int8 /*dragAction*/ ) @@ -201,7 +203,7 @@ HRESULT STDMETHODCALLTYPE DragSource::QueryInterface( REFIID riid, void **ppvOb { if( !ppvObject) return E_POINTER; - *ppvObject= NULL; + *ppvObject= nullptr; if( riid == __uuidof( IUnknown) ) *ppvObject= static_cast<IUnknown*>( this); @@ -314,17 +316,17 @@ unsigned __stdcall DndOleSTAFunc(LPVOID pParams) osl_setThreadName("DragSource DndOleSTAFunc"); // The structure contains all arguments for DoDragDrop and other - DragSource *pSource= (DragSource*)pParams; + DragSource *pSource= static_cast<DragSource*>(pParams); // Drag and drop only works in a thread in which OleInitialize is called. - HRESULT hr= OleInitialize( NULL); + HRESULT hr= OleInitialize( nullptr); if(SUCCEEDED(hr)) { // We force the creation of a thread message queue. This is necessary // for a later call to AttachThreadInput MSG msgtemp; - PeekMessage( &msgtemp, NULL, WM_USER, WM_USER, PM_NOREMOVE); + PeekMessage( &msgtemp, nullptr, WM_USER, WM_USER, PM_NOREMOVE); DWORD threadId= GetCurrentThreadId(); @@ -356,12 +358,12 @@ unsigned __stdcall DndOleSTAFunc(LPVOID pParams) sal_Int8 action= hr == DRAGDROP_S_DROP ? dndOleDropEffectsToActions( dwEffect) : ACTION_NONE; static_cast<SourceContext*>(pSource->m_currentContext.get())->fire_dragDropEnd( - hr == DRAGDROP_S_DROP ? sal_True : sal_False, action); + hr == DRAGDROP_S_DROP, action); // Destroy SourceContextslkfgj - pSource->m_currentContext= 0; + pSource->m_currentContext= nullptr; // Destroy the XTransferable wrapper - pSource->m_spDataObject=0; + pSource->m_spDataObject=nullptr; OleUninitialize(); } diff --git a/dtrans/source/win32/dnd/source.hxx b/dtrans/source/win32/dnd/source.hxx index 61f21ebdcfde..15a06f9f62ea 100644 --- a/dtrans/source/win32/dnd/source.hxx +++ b/dtrans/source/win32/dnd/source.hxx @@ -84,46 +84,46 @@ public: public: explicit DragSource(const Reference<XComponentContext>& rxContext); - virtual ~DragSource(); + virtual ~DragSource() override; DragSource(const DragSource&) = delete; DragSource &operator= ( const DragSource&) = delete; // XInitialization virtual void SAL_CALL initialize( const Sequence< Any >& aArguments ) - throw(Exception, RuntimeException); + throw(Exception, RuntimeException) override; // XDragSource - virtual sal_Bool SAL_CALL isDragImageSupported( ) throw(RuntimeException); + virtual sal_Bool SAL_CALL isDragImageSupported( ) throw(RuntimeException) override; virtual sal_Int32 SAL_CALL getDefaultCursor( sal_Int8 dragAction ) - throw( IllegalArgumentException, RuntimeException); + throw( IllegalArgumentException, RuntimeException) override; virtual void SAL_CALL startDrag( const DragGestureEvent& trigger, sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image, const Reference<XTransferable >& trans, const Reference<XDragSourceListener >& listener ) - throw( RuntimeException); + throw( RuntimeException) override; // XServiceInfo - virtual OUString SAL_CALL getImplementationName( ) throw (RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (RuntimeException); - virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (RuntimeException); + virtual OUString SAL_CALL getImplementationName( ) throw (RuntimeException) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (RuntimeException) override; + virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (RuntimeException) override; virtual HRESULT STDMETHODCALLTYPE QueryInterface( /* [in] */ REFIID riid, - /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); + /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject) override; - virtual ULONG STDMETHODCALLTYPE AddRef( ); + virtual ULONG STDMETHODCALLTYPE AddRef( ) override; - virtual ULONG STDMETHODCALLTYPE Release( ); + virtual ULONG STDMETHODCALLTYPE Release( ) override; // IDropSource virtual HRESULT STDMETHODCALLTYPE QueryContinueDrag( /* [in] */ BOOL fEscapePressed, - /* [in] */ DWORD grfKeyState); + /* [in] */ DWORD grfKeyState) override; virtual HRESULT STDMETHODCALLTYPE GiveFeedback( - /* [in] */ DWORD dwEffect); + /* [in] */ DWORD dwEffect) override; }; diff --git a/dtrans/source/win32/dnd/sourcecontext.cxx b/dtrans/source/win32/dnd/sourcecontext.cxx index 84e54da21cfc..3408c2913359 100644 --- a/dtrans/source/win32/dnd/sourcecontext.cxx +++ b/dtrans/source/win32/dnd/sourcecontext.cxx @@ -75,20 +75,20 @@ void SAL_CALL SourceContext::transferablesFlavorsChanged( ) // non -interface functions // Fires XDragSourceListener::dragDropEnd events. -void SourceContext::fire_dragDropEnd( sal_Bool success, sal_Int8 effect) +void SourceContext::fire_dragDropEnd( bool success, sal_Int8 effect) { DragSourceDropEvent e; - if( success == sal_True) + if( success ) { e.DropAction= effect; - e.DropSuccess= sal_True; + e.DropSuccess= true; } else { e.DropAction= ACTION_NONE; - e.DropSuccess= sal_False; + e.DropSuccess= false; } e.DragSource= m_dragSource; e.DragSourceContext= static_cast<XDragSourceContext*>( this); diff --git a/dtrans/source/win32/dnd/sourcecontext.hxx b/dtrans/source/win32/dnd/sourcecontext.hxx index 9f1788b22e56..b70a0cec8ead 100644 --- a/dtrans/source/win32/dnd/sourcecontext.hxx +++ b/dtrans/source/win32/dnd/sourcecontext.hxx @@ -46,7 +46,7 @@ class SourceContext: public MutexDummy, public: SourceContext( DragSource* pSource, const Reference<XDragSourceListener>& listener); - ~SourceContext(); + ~SourceContext() override; SourceContext(const SourceContext&) = delete; SourceContext &operator= (const SourceContext&) = delete; @@ -55,16 +55,16 @@ public: virtual void SAL_CALL removeDragSourceListener( const Reference<XDragSourceListener >& dsl ) throw( RuntimeException); virtual sal_Int32 SAL_CALL getCurrentCursor( ) - throw( RuntimeException); + throw( RuntimeException) override; virtual void SAL_CALL setCursor( sal_Int32 cursorId ) - throw( RuntimeException); + throw( RuntimeException) override; virtual void SAL_CALL setImage( sal_Int32 imageId ) - throw( RuntimeException); + throw( RuntimeException) override; virtual void SAL_CALL transferablesFlavorsChanged( ) - throw( RuntimeException); + throw( RuntimeException) override; // non - interface functions - void fire_dragDropEnd( sal_Bool success, sal_Int8 byte); + void fire_dragDropEnd( bool success, sal_Int8 byte); void fire_dropActionChanged( sal_Int8 dropAction, sal_Int8 userAction); }; diff --git a/dtrans/source/win32/dnd/target.cxx b/dtrans/source/win32/dnd/target.cxx index ba76771a484f..5f2dea68d5a1 100644 --- a/dtrans/source/win32/dnd/target.cxx +++ b/dtrans/source/win32/dnd/target.cxx @@ -20,6 +20,8 @@ #include <com/sun/star/datatransfer/dnd/DNDConstants.hpp> #include <com/sun/star/datatransfer/XTransferable.hpp> #include <cppuhelper/supportsservice.hxx> +#include <o3tl/any.hxx> + #include <stdio.h> #include "target.hxx" #include "idroptarget.hxx" @@ -45,14 +47,14 @@ DWORD WINAPI DndTargetOleSTAFunc(LPVOID pParams); DropTarget::DropTarget( const Reference<XComponentContext>& rxContext): WeakComponentImplHelper<XInitialization,XDropTarget, XServiceInfo>(m_mutex), - m_hWnd( NULL), + m_hWnd( nullptr), m_threadIdWindow(0), m_threadIdTarget(0), - m_hOleThread(0), + m_hOleThread(nullptr), m_oleThreadId( 0), - m_pDropTarget( NULL), + m_pDropTarget( nullptr), m_xContext( rxContext ), - m_bActive(sal_True), + m_bActive(true), m_nDefaultActions(ACTION_COPY|ACTION_MOVE|ACTION_LINK|ACTION_DEFAULT), m_nCurrentDropAction( ACTION_NONE), m_nLastDropAction(0), @@ -75,7 +77,7 @@ void SAL_CALL DropTarget::disposing() if( m_threadIdTarget) { // Call RevokeDragDrop and wait for the OLE thread to die; - PostThreadMessage( m_threadIdTarget, WM_REVOKEDRAGDROP, (WPARAM)this, 0); + PostThreadMessage( m_threadIdTarget, WM_REVOKEDRAGDROP, reinterpret_cast<WPARAM>(this), 0); WaitForSingleObject( m_hOleThread, INFINITE); CloseHandle( m_hOleThread); //OSL_ENSURE( SUCCEEDED( hr), "HWND not valid!" ); @@ -83,7 +85,7 @@ void SAL_CALL DropTarget::disposing() else { RevokeDragDrop( m_hWnd); - m_hWnd= 0; + m_hWnd= nullptr; } if( m_pDropTarget) { @@ -122,33 +124,33 @@ void SAL_CALL DropTarget::initialize( const Sequence< Any >& aArguments ) if( aArguments.getLength() > 0) { // Get the window handle from aArgument. It is needed for RegisterDragDrop. - m_hWnd= *(HWND*)aArguments[0].getValue(); + m_hWnd= reinterpret_cast<HWND>(static_cast<sal_uIntPtr>(*o3tl::doAccess<sal_uInt64>(aArguments[0]))); OSL_ASSERT( IsWindow( m_hWnd) ); // Obtain the id of the thread that created the window - m_threadIdWindow= GetWindowThreadProcessId( m_hWnd, NULL); + m_threadIdWindow= GetWindowThreadProcessId( m_hWnd, nullptr); - HRESULT hr= OleInitialize( NULL); + HRESULT hr= OleInitialize( nullptr); // Current thread is MTA or Current thread and Window thread are not identical if( hr == RPC_E_CHANGED_MODE || GetCurrentThreadId() != m_threadIdWindow ) { OSL_ENSURE( ! m_threadIdTarget,"initialize was called twice"); // create the IDropTargetImplementation - m_pDropTarget= new IDropTargetImpl( *static_cast<DropTarget*>( this) ); + m_pDropTarget= new IDropTargetImpl( *this ); m_pDropTarget->AddRef(); // Obtain the id of the thread that created the window - m_threadIdWindow= GetWindowThreadProcessId( m_hWnd, NULL); + m_threadIdWindow= GetWindowThreadProcessId( m_hWnd, nullptr); // The event is set by the thread that we will create momentarily. // It indicates that the thread is ready to receive messages. - HANDLE m_evtThreadReady= CreateEvent( NULL, FALSE, FALSE, NULL); + HANDLE m_evtThreadReady= CreateEvent( nullptr, FALSE, FALSE, nullptr); - m_hOleThread= CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE)DndTargetOleSTAFunc, + m_hOleThread= CreateThread( nullptr, 0, DndTargetOleSTAFunc, &m_evtThreadReady, 0, &m_threadIdTarget); WaitForSingleObject( m_evtThreadReady, INFINITE); CloseHandle( m_evtThreadReady); - PostThreadMessage( m_threadIdTarget, WM_REGISTERDRAGDROP, (WPARAM)static_cast<DropTarget*>(this), 0); + PostThreadMessage( m_threadIdTarget, WM_REGISTERDRAGDROP, reinterpret_cast<WPARAM>(this), 0); } else if( hr == S_OK || hr == S_FALSE) { @@ -164,7 +166,7 @@ void SAL_CALL DropTarget::initialize( const Sequence< Any >& aArguments ) // Get the window handle from aArgument. It is needed for RegisterDragDrop. // create the IDropTargetImplementation - m_pDropTarget= new IDropTargetImpl( *static_cast<DropTarget*>( this) ); + m_pDropTarget= new IDropTargetImpl( *this ); m_pDropTarget->AddRef(); // CoLockObjectExternal is prescribed by the protocol. It bumps up the ref count if( SUCCEEDED( CoLockObjectExternal( m_pDropTarget, TRUE, FALSE))) @@ -175,7 +177,7 @@ void SAL_CALL DropTarget::initialize( const Sequence< Any >& aArguments ) CoLockObjectExternal( m_pDropTarget, FALSE, FALSE); m_pDropTarget->Release(); m_pDropTarget = nullptr; - m_hWnd= NULL; + m_hWnd= nullptr; } } } @@ -192,25 +194,25 @@ DWORD WINAPI DndTargetOleSTAFunc(LPVOID pParams) { osl_setThreadName("DropTarget DndTargetOleSTAFunc"); - HRESULT hr= OleInitialize( NULL); + HRESULT hr= OleInitialize( nullptr); if( SUCCEEDED( hr) ) { MSG msg; // force the creation of a message queue - PeekMessage( &msg, (HWND)NULL, 0, 0, PM_NOREMOVE); + PeekMessage( &msg, nullptr, 0, 0, PM_NOREMOVE); // Signal the creator ( DropTarget::initialize) that the thread is // ready to receive messages. - SetEvent( *(HANDLE*) pParams); + SetEvent( *static_cast<HANDLE*>(pParams)); // Thread id is needed for attaching this message queue to the one of the // thread where the window was created. DWORD threadId= GetCurrentThreadId(); // We force the creation of a thread message queue. This is necessary // for a later call to AttachThreadInput - while( GetMessage(&msg, (HWND)NULL, 0, 0) ) + while( GetMessage(&msg, nullptr, 0, 0) ) { if( msg.message == WM_REGISTERDRAGDROP) { - DropTarget *pTarget= (DropTarget*)msg.wParam; + DropTarget *pTarget= reinterpret_cast<DropTarget*>(msg.wParam); // This thread is attached to the thread that created the window. Hence // this thread also receives all mouse and keyboard messages which are // needed @@ -224,17 +226,17 @@ DWORD WINAPI DndTargetOleSTAFunc(LPVOID pParams) CoLockObjectExternal( pTarget->m_pDropTarget, FALSE, FALSE); pTarget->m_pDropTarget->Release(); pTarget->m_pDropTarget = nullptr; - pTarget->m_hWnd= NULL; + pTarget->m_hWnd= nullptr; } } } else if( msg.message == WM_REVOKEDRAGDROP) { - DropTarget *pTarget= (DropTarget*)msg.wParam; + DropTarget *pTarget= reinterpret_cast<DropTarget*>(msg.wParam); RevokeDragDrop( pTarget-> m_hWnd); // Detach this thread from the window thread AttachThreadInput( threadId, pTarget->m_threadIdWindow, FALSE); - pTarget->m_hWnd= 0; + pTarget->m_hWnd= nullptr; break; } TranslateMessage( &msg); @@ -315,7 +317,7 @@ HRESULT DropTarget::DragEnter( IDataObject *pDataObj, m_nLastDropAction= ACTION_DEFAULT | ACTION_MOVE; m_currentDragContext= static_cast<XDropTargetDragContext*>( new TargetDragContext( - static_cast<DropTarget*>(this) ) ); + this ) ); //--> TRA @@ -423,9 +425,9 @@ HRESULT DropTarget::DragLeave() if( m_bActive) { - m_currentData=0; - m_currentDragContext= 0; - m_currentDropContext= 0; + m_currentData=nullptr; + m_currentDragContext= nullptr; + m_currentDropContext= nullptr; m_nLastDropAction= 0; if( m_nDefaultActions != ACTION_NONE) @@ -450,10 +452,10 @@ HRESULT DropTarget::Drop( IDataObject * /*pDataObj*/, if( m_bActive) { - m_bDropComplete= sal_False; + m_bDropComplete= false; m_nCurrentDropAction= getFilteredActions( grfKeyState, *pdwEffect); - m_currentDropContext= static_cast<XDropTargetDropContext*>( new TargetDropContext( static_cast<DropTarget*>(this )) ); + m_currentDropContext= static_cast<XDropTargetDropContext*>( new TargetDropContext( this ) ); if( m_nCurrentDropAction) { DropTargetDropEvent e; @@ -469,7 +471,7 @@ HRESULT DropTarget::Drop( IDataObject * /*pDataObj*/, fire_drop( e); //if fire_drop returns than a listener might have modified m_nCurrentDropAction - if( m_bDropComplete == sal_True) + if( m_bDropComplete ) { sal_Int8 allowedActions= dndOleDropEffectsToActions( *pdwEffect); *pdwEffect= dndActionsToSingleDropEffect( m_nCurrentDropAction & allowedActions); @@ -480,9 +482,9 @@ HRESULT DropTarget::Drop( IDataObject * /*pDataObj*/, else *pdwEffect= DROPEFFECT_NONE; - m_currentData= 0; - m_currentDragContext= 0; - m_currentDropContext= 0; + m_currentData= nullptr; + m_currentDragContext= nullptr; + m_currentDropContext= nullptr; m_nLastDropAction= 0; } return S_OK; @@ -586,7 +588,7 @@ void DropTarget::_rejectDrop( const Reference<XDropTargetDropContext>& context) } } -void DropTarget::_dropComplete(sal_Bool success, const Reference<XDropTargetDropContext>& context) +void DropTarget::_dropComplete(bool success, const Reference<XDropTargetDropContext>& context) { if(context == m_currentDropContext) { diff --git a/dtrans/source/win32/dnd/target.hxx b/dtrans/source/win32/dnd/target.hxx index 47ff87ce6fb9..ada9301a04f1 100644 --- a/dtrans/source/win32/dnd/target.hxx +++ b/dtrans/source/win32/dnd/target.hxx @@ -87,7 +87,7 @@ private: 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; + bool m_bActive; sal_Int8 m_nDefaultActions; // This value is set when a XDropTargetListener calls accept or reject on @@ -102,39 +102,39 @@ private: // action has changed (dropActionChanged) // sal_Int8 m_userAction; // Set by listeners when they call XDropTargetDropContext::dropComplete - sal_Bool m_bDropComplete; + bool m_bDropComplete; Reference<XDropTargetDragContext> m_currentDragContext; Reference<XDropTargetDropContext> m_currentDropContext; public: explicit DropTarget(const Reference<XComponentContext>& rxContext); - virtual ~DropTarget(); + virtual ~DropTarget() override; DropTarget(DropTarget&) = delete; DropTarget &operator= (DropTarget&) = delete; // Overrides WeakComponentImplHelper::disposing which is called by // WeakComponentImplHelper::dispose // Must be called. - virtual void SAL_CALL disposing(); + virtual void SAL_CALL disposing() override; // XInitialization virtual void SAL_CALL initialize( const Sequence< Any >& aArguments ) - throw(Exception, RuntimeException); + throw(Exception, RuntimeException) override; // XDropTarget virtual void SAL_CALL addDropTargetListener( const Reference< XDropTargetListener >& dtl ) - throw(RuntimeException); + throw(RuntimeException) override; virtual void SAL_CALL removeDropTargetListener( const Reference< XDropTargetListener >& dtl ) - throw(RuntimeException); + throw(RuntimeException) override; // Default is not active - virtual sal_Bool SAL_CALL isActive( ) throw(RuntimeException); - virtual void SAL_CALL setActive( sal_Bool isActive ) throw(RuntimeException); - virtual sal_Int8 SAL_CALL getDefaultActions( ) throw(RuntimeException); - virtual void SAL_CALL setDefaultActions( sal_Int8 actions ) throw(RuntimeException); + virtual sal_Bool SAL_CALL isActive( ) throw(RuntimeException) override; + virtual void SAL_CALL setActive( sal_Bool isActive ) throw(RuntimeException) override; + virtual sal_Int8 SAL_CALL getDefaultActions( ) throw(RuntimeException) override; + virtual void SAL_CALL setDefaultActions( sal_Int8 actions ) throw(RuntimeException) override; // XServiceInfo - virtual OUString SAL_CALL getImplementationName( ) throw (RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (RuntimeException); - virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (RuntimeException); + virtual OUString SAL_CALL getImplementationName( ) throw (RuntimeException) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (RuntimeException) override; + virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (RuntimeException) override; // Functions called from the IDropTarget implementation ( m_pDropTarget) virtual HRESULT DragEnter( @@ -161,7 +161,7 @@ public: void _acceptDrop( sal_Int8 dropOperation, const Reference<XDropTargetDropContext>& context); void _rejectDrop( const Reference<XDropTargetDropContext>& context); - void _dropComplete( sal_Bool success, const Reference<XDropTargetDropContext>& context); + void _dropComplete( bool success, const Reference<XDropTargetDropContext>& context); // XDropTargetDragContext delegated from DragContext void _acceptDrag( sal_Int8 dragOperation, const Reference<XDropTargetDragContext>& context); diff --git a/dtrans/source/win32/dnd/targetdragcontext.hxx b/dtrans/source/win32/dnd/targetdragcontext.hxx index 3d061b4e866a..00c3d40d2382 100644 --- a/dtrans/source/win32/dnd/targetdragcontext.hxx +++ b/dtrans/source/win32/dnd/targetdragcontext.hxx @@ -39,14 +39,14 @@ class TargetDragContext: public WeakImplHelper<XDropTargetDragContext> public: explicit TargetDragContext(DropTarget* pTarget); - ~TargetDragContext(); + ~TargetDragContext() override; TargetDragContext( const TargetDragContext&) = delete; TargetDragContext &operator= ( const TargetDragContext&) = delete; virtual void SAL_CALL acceptDrag( sal_Int8 dragOperation ) - throw( RuntimeException); + throw( RuntimeException) override; virtual void SAL_CALL rejectDrag( ) - throw( RuntimeException); + throw( RuntimeException) override; }; #endif diff --git a/dtrans/source/win32/dnd/targetdropcontext.hxx b/dtrans/source/win32/dnd/targetdropcontext.hxx index ec2e5b20e1d6..f240e6897fbb 100644 --- a/dtrans/source/win32/dnd/targetdropcontext.hxx +++ b/dtrans/source/win32/dnd/targetdropcontext.hxx @@ -38,19 +38,19 @@ class TargetDropContext: public WeakImplHelper<XDropTargetDropContext> public: explicit TargetDropContext(DropTarget* pTarget); - ~TargetDropContext(); + ~TargetDropContext() override; TargetDropContext( const TargetDropContext&) = delete; TargetDropContext &operator= ( const TargetDropContext&) = delete; // XDropTargetDragContext virtual void SAL_CALL acceptDrop( sal_Int8 dropOperation ) - throw( RuntimeException); + throw( RuntimeException) override; virtual void SAL_CALL rejectDrop( ) - throw( RuntimeException); + throw( RuntimeException) override; // XDropTargetDropContext (inherits XDropTargetDragContext) virtual void SAL_CALL dropComplete( sal_Bool success ) - throw( RuntimeException); + throw( RuntimeException) override; }; #endif |