Simplify UcbContentProviderProxy
Change-Id: I7366e31dc167707adf2c614049cee852e44d7ac1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178097 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
This commit is contained in:
parent
2ef6b7f9db
commit
76cf7c6fc0
2 changed files with 9 additions and 52 deletions
|
@ -108,31 +108,12 @@ UcbContentProviderProxy::~UcbContentProviderProxy()
|
|||
|
||||
|
||||
// XInterface methods.
|
||||
void SAL_CALL UcbContentProviderProxy::acquire()
|
||||
noexcept
|
||||
{
|
||||
OWeakObject::acquire();
|
||||
}
|
||||
|
||||
void SAL_CALL UcbContentProviderProxy::release()
|
||||
noexcept
|
||||
{
|
||||
OWeakObject::release();
|
||||
}
|
||||
|
||||
// virtual
|
||||
Any SAL_CALL
|
||||
UcbContentProviderProxy::queryInterface( const Type & rType )
|
||||
{
|
||||
Any aRet = cppu::queryInterface( rType,
|
||||
static_cast< XTypeProvider * >( this ),
|
||||
static_cast< XServiceInfo * >( this ),
|
||||
static_cast< XContentProvider * >( this ),
|
||||
static_cast< XParameterizedContentProvider * >( this ),
|
||||
static_cast< XContentProviderSupplier * >( this ) );
|
||||
|
||||
if ( !aRet.hasValue() )
|
||||
aRet = OWeakObject::queryInterface( rType );
|
||||
Any aRet = UcbContentProviderProxy_BASE::queryInterface(rType);
|
||||
|
||||
if ( !aRet.hasValue() )
|
||||
{
|
||||
|
@ -148,28 +129,13 @@ UcbContentProviderProxy::queryInterface( const Type & rType )
|
|||
|
||||
// XTypeProvider methods.
|
||||
|
||||
|
||||
XTYPEPROVIDER_COMMON_IMPL( UcbContentProviderProxy );
|
||||
|
||||
|
||||
Sequence< Type > SAL_CALL UcbContentProviderProxy::getTypes()
|
||||
{
|
||||
// Get original provider and forward the call...
|
||||
Reference< XTypeProvider > xProvider( getContentProvider(), UNO_QUERY );
|
||||
if ( xProvider.is() )
|
||||
{
|
||||
if (Reference<XTypeProvider> xProvider{ getContentProvider(), UNO_QUERY })
|
||||
return xProvider->getTypes();
|
||||
}
|
||||
else
|
||||
{
|
||||
static cppu::OTypeCollection s_aCollection(
|
||||
CPPU_TYPE_REF( XTypeProvider ),
|
||||
CPPU_TYPE_REF( XServiceInfo ),
|
||||
CPPU_TYPE_REF( XContentProvider ),
|
||||
CPPU_TYPE_REF( XParameterizedContentProvider ),
|
||||
CPPU_TYPE_REF( XContentProviderSupplier ) );
|
||||
return s_aCollection.getTypes();
|
||||
}
|
||||
|
||||
return UcbContentProviderProxy_BASE::getTypes();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -55,16 +55,12 @@ public:
|
|||
|
||||
|
||||
|
||||
|
||||
class UcbContentProviderProxy :
|
||||
public cppu::OWeakObject,
|
||||
public css::lang::XTypeProvider,
|
||||
public css::lang::XServiceInfo,
|
||||
public css::ucb::XContentProviderSupplier,
|
||||
public css::ucb::XContentProvider,
|
||||
public css::ucb::XParameterizedContentProvider
|
||||
using UcbContentProviderProxy_BASE = comphelper::WeakImplHelper<css::lang::XServiceInfo,
|
||||
css::ucb::XContentProviderSupplier,
|
||||
css::ucb::XContentProvider,
|
||||
css::ucb::XParameterizedContentProvider>;
|
||||
class UcbContentProviderProxy : public UcbContentProviderProxy_BASE
|
||||
{
|
||||
std::mutex m_aMutex;
|
||||
OUString m_aService;
|
||||
OUString m_aTemplate;
|
||||
OUString m_aArguments;
|
||||
|
@ -86,13 +82,8 @@ public:
|
|||
|
||||
// XInterface
|
||||
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
|
||||
virtual void SAL_CALL acquire()
|
||||
noexcept override;
|
||||
virtual void SAL_CALL release()
|
||||
noexcept override;
|
||||
|
||||
// XTypeProvider
|
||||
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
|
||||
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
|
||||
|
||||
// XServiceInfo
|
||||
|
|
Loading…
Reference in a new issue