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.
|
// XInterface methods.
|
||||||
void SAL_CALL UcbContentProviderProxy::acquire()
|
|
||||||
noexcept
|
|
||||||
{
|
|
||||||
OWeakObject::acquire();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SAL_CALL UcbContentProviderProxy::release()
|
|
||||||
noexcept
|
|
||||||
{
|
|
||||||
OWeakObject::release();
|
|
||||||
}
|
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
Any SAL_CALL
|
Any SAL_CALL
|
||||||
UcbContentProviderProxy::queryInterface( const Type & rType )
|
UcbContentProviderProxy::queryInterface( const Type & rType )
|
||||||
{
|
{
|
||||||
Any aRet = cppu::queryInterface( rType,
|
Any aRet = UcbContentProviderProxy_BASE::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 );
|
|
||||||
|
|
||||||
if ( !aRet.hasValue() )
|
if ( !aRet.hasValue() )
|
||||||
{
|
{
|
||||||
|
@ -148,28 +129,13 @@ UcbContentProviderProxy::queryInterface( const Type & rType )
|
||||||
|
|
||||||
// XTypeProvider methods.
|
// XTypeProvider methods.
|
||||||
|
|
||||||
|
|
||||||
XTYPEPROVIDER_COMMON_IMPL( UcbContentProviderProxy );
|
|
||||||
|
|
||||||
|
|
||||||
Sequence< Type > SAL_CALL UcbContentProviderProxy::getTypes()
|
Sequence< Type > SAL_CALL UcbContentProviderProxy::getTypes()
|
||||||
{
|
{
|
||||||
// Get original provider and forward the call...
|
// Get original provider and forward the call...
|
||||||
Reference< XTypeProvider > xProvider( getContentProvider(), UNO_QUERY );
|
if (Reference<XTypeProvider> xProvider{ getContentProvider(), UNO_QUERY })
|
||||||
if ( xProvider.is() )
|
|
||||||
{
|
|
||||||
return xProvider->getTypes();
|
return xProvider->getTypes();
|
||||||
}
|
|
||||||
else
|
return UcbContentProviderProxy_BASE::getTypes();
|
||||||
{
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -55,16 +55,12 @@ public:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
using UcbContentProviderProxy_BASE = comphelper::WeakImplHelper<css::lang::XServiceInfo,
|
||||||
class UcbContentProviderProxy :
|
css::ucb::XContentProviderSupplier,
|
||||||
public cppu::OWeakObject,
|
css::ucb::XContentProvider,
|
||||||
public css::lang::XTypeProvider,
|
css::ucb::XParameterizedContentProvider>;
|
||||||
public css::lang::XServiceInfo,
|
class UcbContentProviderProxy : public UcbContentProviderProxy_BASE
|
||||||
public css::ucb::XContentProviderSupplier,
|
|
||||||
public css::ucb::XContentProvider,
|
|
||||||
public css::ucb::XParameterizedContentProvider
|
|
||||||
{
|
{
|
||||||
std::mutex m_aMutex;
|
|
||||||
OUString m_aService;
|
OUString m_aService;
|
||||||
OUString m_aTemplate;
|
OUString m_aTemplate;
|
||||||
OUString m_aArguments;
|
OUString m_aArguments;
|
||||||
|
@ -86,13 +82,8 @@ public:
|
||||||
|
|
||||||
// XInterface
|
// XInterface
|
||||||
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
|
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
|
// XTypeProvider
|
||||||
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
|
|
||||||
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
|
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
|
||||||
|
|
||||||
// XServiceInfo
|
// XServiceInfo
|
||||||
|
|
Loading…
Reference in a new issue