Kaydet (Commit) 1f9b6013 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

clang-cl loplugin: dtrans

Change-Id: I1d55f3e7ecbde486f318d5175b1570f0caa33255
Reviewed-on: https://gerrit.libreoffice.org/29870Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 5eab3e5e
......@@ -21,6 +21,10 @@ $(eval $(call gb_Library_Library,dnd))
$(eval $(call gb_Library_set_componentfile,dnd,dtrans/util/dnd))
$(eval $(call gb_Library_use_externals,dnd, \
boost_headers \
))
$(eval $(call gb_Library_use_sdk_api,dnd))
$(eval $(call gb_Library_use_libraries,dnd,\
......
......@@ -147,7 +147,7 @@ void SAL_CALL ClipboardManager::dispose()
ClearableMutexGuard aGuard( rBHelper.rMutex );
if (!rBHelper.bDisposed && !rBHelper.bInDispose)
{
rBHelper.bInDispose = sal_True;
rBHelper.bInDispose = true;
aGuard.clear();
// give everyone a chance to save his clipboard instance
......@@ -182,8 +182,8 @@ void SAL_CALL ClipboardManager::dispose()
}
}
rBHelper.bDisposed = sal_True;
rBHelper.bInDispose = sal_False;
rBHelper.bDisposed = true;
rBHelper.bInDispose = false;
}
}
......@@ -199,7 +199,7 @@ void SAL_CALL ClipboardManager::disposing( const EventObject& event )
Reference< XInterface > SAL_CALL ClipboardManager_createInstance(
const Reference< XMultiServiceFactory > & /*xMultiServiceFactory*/)
{
return Reference < XInterface >( ( OWeakObject * ) new ClipboardManager());
return Reference < XInterface >(static_cast<OWeakObject *>(new ClipboardManager()));
}
Sequence< OUString > SAL_CALL ClipboardManager_getSupportedServiceNames()
......
......@@ -45,7 +45,7 @@ namespace dtrans
const OUString m_aDefaultName;
virtual ~ClipboardManager();
virtual ~ClipboardManager() override;
protected:
using WeakComponentImplHelperBase::disposing;
public:
......@@ -57,27 +57,27 @@ namespace dtrans
*/
virtual OUString SAL_CALL getImplementationName( )
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( )
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
/*
* XComponent
*/
virtual void SAL_CALL dispose()
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
/*
* XEventListener
*/
virtual void SAL_CALL disposing( const css::lang::EventObject& Source )
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
/*
* XClipboardManager
......@@ -85,18 +85,18 @@ namespace dtrans
virtual css::uno::Reference< css::datatransfer::clipboard::XClipboard > SAL_CALL getClipboard( const OUString& aName )
throw(css::container::NoSuchElementException,
css::uno::RuntimeException);
css::uno::RuntimeException) override;
virtual void SAL_CALL addClipboard( const css::uno::Reference< css::datatransfer::clipboard::XClipboard >& xClipboard )
throw(css::lang::IllegalArgumentException,
css::container::ElementExistException,
css::uno::RuntimeException);
css::uno::RuntimeException) override;
virtual void SAL_CALL removeClipboard( const OUString& aName )
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
virtual css::uno::Sequence< OUString > SAL_CALL listClipboardNames( )
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
};
......
......@@ -35,7 +35,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL dtrans_component_getFactory(
void * /*pRegistryKey*/
)
{
void * pRet = 0;
void * pRet = nullptr;
if (pServiceManager)
{
......@@ -44,7 +44,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL dtrans_component_getFactory(
if (rtl_str_compare( pImplName, CLIPBOARDMANAGER_IMPLEMENTATION_NAME ) == 0)
{
xFactory = createOneInstanceFactory(
reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
static_cast< XMultiServiceFactory * >( pServiceManager ),
OUString::createFromAscii( pImplName ),
ClipboardManager_createInstance,
ClipboardManager_getSupportedServiceNames() );
......@@ -52,7 +52,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL dtrans_component_getFactory(
else if (rtl_str_compare( pImplName, GENERIC_CLIPBOARD_IMPLEMENTATION_NAME ) == 0)
{
xFactory = createSingleFactory(
reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
static_cast< XMultiServiceFactory * >( pServiceManager ),
OUString::createFromAscii( pImplName ),
GenericClipboard_createInstance,
GenericClipboard_getSupportedServiceNames() );
......
......@@ -33,7 +33,7 @@ using ::dtrans::GenericClipboard;
GenericClipboard::GenericClipboard() :
WeakComponentImplHelper< XClipboardEx, XClipboardNotifier, XServiceInfo, XInitialization > (m_aMutex),
m_bInitialized(sal_False)
m_bInitialized(false)
{
}
......@@ -156,7 +156,7 @@ Sequence< OUString > SAL_CALL GenericClipboard_getSupportedServiceNames()
Reference< XInterface > SAL_CALL GenericClipboard_createInstance(
const Reference< XMultiServiceFactory > & /*xMultiServiceFactory*/)
{
return Reference < XInterface >( ( OWeakObject * ) new GenericClipboard());
return Reference < XInterface >(static_cast<OWeakObject *>(new GenericClipboard()));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -46,8 +46,8 @@ namespace dtrans
css::uno::Reference< css::datatransfer::XTransferable > m_aContents;
css::uno::Reference< css::datatransfer::clipboard::XClipboardOwner > m_aOwner;
sal_Bool m_bInitialized;
virtual ~GenericClipboard();
bool m_bInitialized;
virtual ~GenericClipboard() override;
public:
......@@ -58,42 +58,42 @@ namespace dtrans
*/
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
throw(css::uno::Exception, css::uno::RuntimeException);
throw(css::uno::Exception, css::uno::RuntimeException) override;
/*
* XServiceInfo
*/
virtual OUString SAL_CALL getImplementationName( )
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( )
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
/*
* XClipboard
*/
virtual css::uno::Reference< css::datatransfer::XTransferable > SAL_CALL getContents()
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
virtual void SAL_CALL setContents(
const css::uno::Reference< css::datatransfer::XTransferable >& xTrans,
const css::uno::Reference< css::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
virtual OUString SAL_CALL getName()
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
/*
* XClipboardEx
*/
virtual sal_Int8 SAL_CALL getRenderingCapabilities()
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
/*
* XClipboardNotifier
......@@ -101,11 +101,11 @@ namespace dtrans
virtual void SAL_CALL addClipboardListener(
const css::uno::Reference< css::datatransfer::clipboard::XClipboardListener >& listener )
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
virtual void SAL_CALL removeClipboardListener(
const css::uno::Reference< css::datatransfer::clipboard::XClipboardListener >& listener )
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
};
......
......@@ -73,9 +73,9 @@ private:
// message handler functions; remember these functions are called
// from a different thread context!
LRESULT onSetClipboard( IDataObject* pIDataObject );
LRESULT onGetClipboard( LPSTREAM* ppStream );
LRESULT onFlushClipboard( );
static LRESULT onSetClipboard( IDataObject* pIDataObject );
static LRESULT onGetClipboard( LPSTREAM* ppStream );
static LRESULT onFlushClipboard( );
bool onRegisterClipViewer( LPFNC_CLIPVIEWER_CALLBACK_t pfncClipViewerCallback );
// win32 clipboard-viewer support
......
......@@ -48,15 +48,15 @@ using namespace com::sun::star::datatransfer::clipboard;
using namespace com::sun::star::datatransfer::clipboard::RenderingCapabilities;
// definition of static members
CWinClipbImpl* CWinClipbImpl::s_pCWinClipbImpl = NULL;
CWinClipbImpl* CWinClipbImpl::s_pCWinClipbImpl = nullptr;
osl::Mutex CWinClipbImpl::s_aMutex;
CWinClipbImpl::CWinClipbImpl( const OUString& aClipboardName, CWinClipboard* theWinClipboard ) :
m_itsName( aClipboardName ),
m_pWinClipboard( theWinClipboard ),
m_pCurrentClipContent( NULL )
m_pCurrentClipContent( nullptr )
{
OSL_ASSERT( NULL != m_pWinClipboard );
OSL_ASSERT( nullptr != m_pWinClipboard );
// necessary to reassociate from
// the static callback function
......@@ -67,7 +67,7 @@ CWinClipbImpl::CWinClipbImpl( const OUString& aClipboardName, CWinClipboard* the
CWinClipbImpl::~CWinClipbImpl( )
{
ClearableMutexGuard aGuard( s_aMutex );
s_pCWinClipbImpl = NULL;
s_pCWinClipbImpl = nullptr;
aGuard.clear( );
unregisterClipboardViewer( );
......@@ -79,7 +79,7 @@ Reference< XTransferable > SAL_CALL CWinClipbImpl::getContents( ) throw( Runtime
// system clipboard
ClearableMutexGuard aGuard( m_ClipContentMutex );
if ( NULL != m_pCurrentClipContent )
if ( nullptr != m_pCurrentClipContent )
{
return m_pCurrentClipContent->m_XTransferable;
}
......@@ -154,7 +154,7 @@ void SAL_CALL CWinClipbImpl::flushClipboard( ) throw( RuntimeException )
// It may be possible to move the request to the clipboard STA thread by saving the
// DataObject and call OleIsCurrentClipboard bevore flushing.
if ( NULL != m_pCurrentClipContent )
if ( nullptr != m_pCurrentClipContent )
m_MtaOleClipboard.flushClipboard( );
}
......@@ -165,7 +165,7 @@ void SAL_CALL CWinClipbImpl::registerClipboardViewer( )
void SAL_CALL CWinClipbImpl::unregisterClipboardViewer( )
{
m_MtaOleClipboard.registerClipViewer( NULL );
m_MtaOleClipboard.registerClipViewer( nullptr );
}
void SAL_CALL CWinClipbImpl::dispose() throw( RuntimeException )
......@@ -178,13 +178,13 @@ void WINAPI CWinClipbImpl::onClipboardContentChanged()
MutexGuard aGuard( s_aMutex );
// reassocition to instance through static member
if ( NULL != s_pCWinClipbImpl )
if ( nullptr != s_pCWinClipbImpl )
s_pCWinClipbImpl->m_pWinClipboard->notifyAllClipboardListener( );
}
void SAL_CALL CWinClipbImpl::onReleaseDataObject( CXNotifyingDataObject* theCaller )
{
OSL_ASSERT( NULL != theCaller );
OSL_ASSERT( nullptr != theCaller );
if ( theCaller )
theCaller->lostOwnership( );
......@@ -195,7 +195,7 @@ void SAL_CALL CWinClipbImpl::onReleaseDataObject( CXNotifyingDataObject* theCall
MutexGuard aGuard( m_ClipContentMutex );
if ( m_pCurrentClipContent == theCaller )
m_pCurrentClipContent = NULL;
m_pCurrentClipContent = nullptr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -61,7 +61,7 @@ protected:
// XClipboardEx
sal_Int8 SAL_CALL getRenderingCapabilities( ) throw( css::uno::RuntimeException );
static sal_Int8 SAL_CALL getRenderingCapabilities( ) throw( css::uno::RuntimeException );
// XFlushableClipboard
......
......@@ -69,7 +69,7 @@ Reference< XTransferable > SAL_CALL CWinClipboard::getContents( ) throw( Runtime
throw DisposedException("object is already disposed",
static_cast< XClipboardEx* >( this ) );
if ( NULL != m_pImpl.get( ) )
if ( nullptr != m_pImpl.get( ) )
return m_pImpl->getContents( );
return Reference< XTransferable >( );
......@@ -85,7 +85,7 @@ void SAL_CALL CWinClipboard::setContents( const Reference< XTransferable >& xTra
throw DisposedException("object is already disposed",
static_cast< XClipboardEx* >( this ) );
if ( NULL != m_pImpl.get( ) )
if ( nullptr != m_pImpl.get( ) )
m_pImpl->setContents( xTransferable, xClipboardOwner );
}
......@@ -95,7 +95,7 @@ OUString SAL_CALL CWinClipboard::getName( ) throw( RuntimeException )
throw DisposedException("object is already disposed",
static_cast< XClipboardEx* >( this ) );
if ( NULL != m_pImpl.get( ) )
if ( nullptr != m_pImpl.get( ) )
return m_pImpl->getName( );
return OUString("");
......@@ -111,7 +111,7 @@ void SAL_CALL CWinClipboard::flushClipboard( ) throw( RuntimeException )
throw DisposedException("object is already disposed",
static_cast< XClipboardEx* >( this ) );
if ( NULL != m_pImpl.get( ) )
if ( nullptr != m_pImpl.get( ) )
m_pImpl->flushClipboard( );
}
......@@ -123,8 +123,8 @@ sal_Int8 SAL_CALL CWinClipboard::getRenderingCapabilities( ) throw( RuntimeExce
throw DisposedException("object is already disposed",
static_cast< XClipboardEx* >( this ) );
if ( NULL != m_pImpl.get( ) )
return m_pImpl->getRenderingCapabilities( );
if ( nullptr != m_pImpl.get( ) )
return CWinClipbImpl::getRenderingCapabilities( );
return 0;
}
......
......@@ -72,49 +72,49 @@ public:
// XClipboard
virtual css::uno::Reference< css::datatransfer::XTransferable > SAL_CALL getContents( )
throw( css::uno::RuntimeException );
throw( css::uno::RuntimeException ) override;
virtual void SAL_CALL setContents(
const css::uno::Reference< css::datatransfer::XTransferable >& xTransferable,
const css::uno::Reference< css::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
throw( css::uno::RuntimeException );
throw( css::uno::RuntimeException ) override;
virtual OUString SAL_CALL getName( )
throw( css::uno::RuntimeException );
throw( css::uno::RuntimeException ) override;
// XFlushableClipboard
virtual void SAL_CALL flushClipboard( ) throw( css::uno::RuntimeException );
virtual void SAL_CALL flushClipboard( ) throw( css::uno::RuntimeException ) override;
// XClipboardEx
virtual sal_Int8 SAL_CALL getRenderingCapabilities( ) throw( css::uno::RuntimeException );
virtual sal_Int8 SAL_CALL getRenderingCapabilities( ) throw( css::uno::RuntimeException ) override;
// XClipboardNotifier
virtual void SAL_CALL addClipboardListener(
const css::uno::Reference< css::datatransfer::clipboard::XClipboardListener >& listener )
throw( css::uno::RuntimeException );
throw( css::uno::RuntimeException ) override;
virtual void SAL_CALL removeClipboardListener(
const css::uno::Reference< css::datatransfer::clipboard::XClipboardListener >& listener )
throw( css::uno::RuntimeException );
throw( css::uno::RuntimeException ) override;
// overwrite base class method, which is called
// by base class dispose function
virtual void SAL_CALL disposing();
virtual void SAL_CALL disposing() override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( )
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( )
throw(css::uno::RuntimeException);
throw(css::uno::RuntimeException) override;
private:
void SAL_CALL notifyAllClipboardListener( );
......
......@@ -54,7 +54,7 @@ extern "C"
SAL_DLLPUBLIC_EXPORT void* SAL_CALL sysdtrans_component_getFactory( const sal_Char* pImplName, void* pSrvManager, void* /*pRegistryKey*/ )
{
void* pRet = 0;
void* pRet = nullptr;
if ( pSrvManager && ( 0 == rtl_str_compare( pImplName, WINCLIPBOARD_IMPL_NAME ) ) )
{
......@@ -62,7 +62,7 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL sysdtrans_component_getFactory( const sal_Ch
//OUString( FPS_IMPL_NAME )
Reference< XSingleServiceFactory > xFactory ( createOneInstanceFactory(
reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ),
static_cast< XMultiServiceFactory* > ( pSrvManager ),
OUString::createFromAscii( pImplName ),
createInstance,
aSNS ) );
......
......@@ -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);
......
......@@ -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);
......
......@@ -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
......
......@@ -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();
}
......
......@@ -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;
};
......