Kaydet (Commit) 6ad41af7 authored tarafından Alexandre Vicenzi's avatar Alexandre Vicenzi Kaydeden (comit) Stephan Bergmann

fdo#54938 Convert dtrans, remoteb., reportd., ucbhelper to cppu::supportsSer..

Change-Id: I42cf7dc139b79b715f3c330f9bca7d333de8bafc
Reviewed-on: https://gerrit.libreoffice.org/7762Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
Tested-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst a4835f66
......@@ -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: */
......@@ -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
......
......@@ -17,21 +17,22 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <osl/diagnose.h>
#include <osl/mutex.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implementationentry.hxx>
#include "cppuhelper/unourl.hxx"
#include "rtl/malformeduriexception.hxx"
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/connection/XConnector.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/bridge/BridgeFactory.hpp>
#include <com/sun/star/bridge/XBridgeFactory.hpp>
#include <com/sun/star/bridge/XUnoUrlResolver.hpp>
#include <com/sun/star/connection/XConnector.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/supportsservice.hxx>
#include "cppuhelper/unourl.hxx"
#include <osl/diagnose.h>
#include <osl/mutex.hxx>
using namespace cppu;
using namespace osl;
......@@ -47,7 +48,7 @@ using namespace com::sun::star::registry;
namespace unourl_resolver
{
//--------------------------------------------------------------------------------------------------
Sequence< OUString > resolver_getSupportedServiceNames()
{
Sequence< OUString > seqNames(1);
......@@ -60,7 +61,6 @@ OUString resolver_getImplementationName()
return OUString(IMPLNAME);
}
//==================================================================================================
class ResolverImpl : public WeakImplHelper2< XServiceInfo, XUnoUrlResolver >
{
Reference< XMultiComponentFactory > _xSMgr;
......@@ -80,37 +80,26 @@ public:
throw (NoConnectException, ConnectionSetupException, RuntimeException);
};
//##################################################################################################
//__________________________________________________________________________________________________
ResolverImpl::ResolverImpl( const Reference< XComponentContext > & xCtx )
: _xSMgr( xCtx->getServiceManager() )
, _xCtx( xCtx )
{}
//__________________________________________________________________________________________________
ResolverImpl::~ResolverImpl() {}
// XServiceInfo
//__________________________________________________________________________________________________
OUString ResolverImpl::getImplementationName()
throw(::com::sun::star::uno::RuntimeException)
{
return resolver_getImplementationName();
}
//__________________________________________________________________________________________________
sal_Bool ResolverImpl::supportsService( const OUString & rServiceName )
throw(::com::sun::star::uno::RuntimeException)
{
const Sequence< OUString > & rSNL = getSupportedServiceNames();
const OUString * pArray = rSNL.getConstArray();
for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
{
if (pArray[nPos] == rServiceName)
return sal_True;
}
return sal_False;
return cppu::supportsService(this, rServiceName);
}
//__________________________________________________________________________________________________
Sequence< OUString > ResolverImpl::getSupportedServiceNames()
throw(::com::sun::star::uno::RuntimeException)
{
......@@ -118,7 +107,6 @@ Sequence< OUString > ResolverImpl::getSupportedServiceNames()
}
// XUnoUrlResolver
//__________________________________________________________________________________________________
Reference< XInterface > ResolverImpl::resolve( const OUString & rUnoUrl )
throw (NoConnectException, ConnectionSetupException, RuntimeException)
{
......@@ -161,13 +149,11 @@ Reference< XInterface > ResolverImpl::resolve( const OUString & rUnoUrl )
return xRet;
}
//==================================================================================================
static Reference< XInterface > SAL_CALL ResolverImpl_create( const Reference< XComponentContext > & xCtx )
{
return Reference< XInterface >( *new ResolverImpl( xCtx ) );
}
}
using namespace unourl_resolver;
......
......@@ -17,39 +17,27 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
/**************************************************************************
TODO
**************************************************************************
*************************************************************************/
#include <boost/unordered_map.hpp>
#include <com/sun/star/beans/XPropertyAccess.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/ucb/Store.hpp>
#include <com/sun/star/ucb/XPropertySetRegistryFactory.hpp>
#include <com/sun/star/ucb/XPropertySetRegistry.hpp>
#include <com/sun/star/ucb/XPropertySetRegistryFactory.hpp>
#include <cppuhelper/supportsservice.hxx>
#include <ucbhelper/contenthelper.hxx>
#include <ucbhelper/contentidentifier.hxx>
#include <ucbhelper/providerhelper.hxx>
#include "osl/diagnose.h"
#include "osl/mutex.hxx"
#include "cppuhelper/weakref.hxx"
#include <ucbhelper/contentidentifier.hxx>
#include <ucbhelper/providerhelper.hxx>
#include <ucbhelper/contenthelper.hxx>
using namespace com::sun::star;
namespace ucbhelper_impl
{
//=========================================================================
//
// Contents.
//
//=========================================================================
struct equalString
{
bool operator()(
......@@ -76,12 +64,6 @@ typedef boost::unordered_map
>
Contents;
//=========================================================================
//
// struct ContentProviderImplHelper_Impl.
//
//=========================================================================
struct ContentProviderImplHelper_Impl
{
uno::Reference< com::sun::star::ucb::XPropertySetRegistry >
......@@ -92,14 +74,6 @@ struct ContentProviderImplHelper_Impl
} // namespace ucbhelper_impl
//=========================================================================
//=========================================================================
//
// ContentProviderImplHelper Implementation.
//
//=========================================================================
//=========================================================================
namespace ucbhelper {
ContentProviderImplHelper::ContentProviderImplHelper(
......@@ -109,63 +83,30 @@ ContentProviderImplHelper::ContentProviderImplHelper(
{
}
//=========================================================================
// virtual
ContentProviderImplHelper::~ContentProviderImplHelper()
{
delete m_pImpl;
}
//=========================================================================
//
// XInterface methods.
//
//=========================================================================
XINTERFACE_IMPL_3( ContentProviderImplHelper,
lang::XTypeProvider,
lang::XServiceInfo,
com::sun::star::ucb::XContentProvider );
//=========================================================================
//
// XTypeProvider methods.
//
//=========================================================================
XTYPEPROVIDER_IMPL_3( ContentProviderImplHelper,
lang::XTypeProvider,
lang::XServiceInfo,
com::sun::star::ucb::XContentProvider );
//=========================================================================
//
// XServiceInfo methods.
//
//=========================================================================
// virtual
sal_Bool SAL_CALL ContentProviderImplHelper::supportsService(
const OUString& ServiceName )
throw( uno::RuntimeException )
{
uno::Sequence< OUString > aSNL = getSupportedServiceNames();
const OUString* pArray = aSNL.getConstArray();
for ( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
{
if ( pArray[ i ] == ServiceName )
return sal_True;
}
return sal_False;
return cppu::supportsService(this, ServiceName);
}
//=========================================================================
//
// XContentProvider methods.
//
//=========================================================================
// virtual
sal_Int32 SAL_CALL ContentProviderImplHelper::compareContentIds(
const uno::Reference< com::sun::star::ucb::XContentIdentifier >& Id1,
......@@ -180,12 +121,6 @@ sal_Int32 SAL_CALL ContentProviderImplHelper::compareContentIds(
return aURL1.compareTo( aURL2 );
}
//=========================================================================
//
// Non-interface methods
//
//=========================================================================
void ContentProviderImplHelper::cleanupRegisteredContents()
{
osl::MutexGuard aGuard( m_aMutex );
......@@ -208,8 +143,6 @@ void ContentProviderImplHelper::cleanupRegisteredContents()
}
}
//=========================================================================
void ContentProviderImplHelper::removeContent( ContentImplHelper* pContent )
{
osl::MutexGuard aGuard( m_aMutex );
......@@ -225,7 +158,6 @@ void ContentProviderImplHelper::removeContent( ContentImplHelper* pContent )
m_pImpl->m_aContents.erase( it );
}
//=========================================================================
rtl::Reference< ContentImplHelper >
ContentProviderImplHelper::queryExistingContent(
const uno::Reference< com::sun::star::ucb::XContentIdentifier >&
......@@ -234,7 +166,6 @@ ContentProviderImplHelper::queryExistingContent(
return queryExistingContent( Identifier->getContentIdentifier() );
}
//=========================================================================
rtl::Reference< ContentImplHelper >
ContentProviderImplHelper::queryExistingContent( const OUString& rURL )
{
......@@ -258,7 +189,6 @@ ContentProviderImplHelper::queryExistingContent( const OUString& rURL )
return rtl::Reference< ContentImplHelper >();
}
//=========================================================================
void ContentProviderImplHelper::queryExistingContents(
ContentRefList& rContents )
{
......@@ -284,7 +214,6 @@ void ContentProviderImplHelper::queryExistingContents(
}
}
//=========================================================================
void ContentProviderImplHelper::registerNewContent(
const uno::Reference< ucb::XContent > & xContent )
{
......@@ -303,7 +232,6 @@ void ContentProviderImplHelper::registerNewContent(
}
}
//=========================================================================
uno::Reference< com::sun::star::ucb::XPropertySetRegistry >
ContentProviderImplHelper::getAdditionalPropertySetRegistry()
{
......@@ -328,8 +256,6 @@ ContentProviderImplHelper::getAdditionalPropertySetRegistry()
return m_pImpl->m_xPropertySetRegistry;
}
//=========================================================================
uno::Reference< com::sun::star::ucb::XPersistentPropertySet >
ContentProviderImplHelper::getAdditionalPropertySet(
const OUString& rKey, sal_Bool bCreate )
......@@ -348,7 +274,6 @@ ContentProviderImplHelper::getAdditionalPropertySet(
return uno::Reference< com::sun::star::ucb::XPersistentPropertySet >();
}
//=========================================================================
sal_Bool ContentProviderImplHelper::renameAdditionalPropertySet(
const OUString& rOldKey,
const OUString& rNewKey,
......@@ -433,7 +358,6 @@ sal_Bool ContentProviderImplHelper::renameAdditionalPropertySet(
return sal_True;
}
//=========================================================================
sal_Bool ContentProviderImplHelper::copyAdditionalPropertySet(
const OUString& rSourceKey,
const OUString& rTargetKey,
......@@ -575,7 +499,6 @@ sal_Bool ContentProviderImplHelper::copyAdditionalPropertySet(
return sal_True;
}
//=========================================================================
sal_Bool ContentProviderImplHelper::removeAdditionalPropertySet(
const OUString& rKey, sal_Bool bRecursive )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment