From c6dcd7b7f392ef47b2e66445239ce867e51d5adb Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 24 Mar 2015 15:22:35 +0100 Subject: Fix various Windows-only XServiceInfo implementations ...to match what is recorded in the .component files Change-Id: Ibc5bb0575f3869317e4d14614cf1dad0af728ddc --- embedserv/source/embed/servprov.cxx | 60 +++++++------------------------------ embedserv/source/inc/servprov.hxx | 25 +++++++--------- 2 files changed, 22 insertions(+), 63 deletions(-) (limited to 'embedserv/source') diff --git a/embedserv/source/embed/servprov.cxx b/embedserv/source/embed/servprov.cxx index 006b4ed9c101..775a31f06070 100644 --- a/embedserv/source/embed/servprov.cxx +++ b/embedserv/source/embed/servprov.cxx @@ -24,8 +24,7 @@ #include "servprov.hxx" #include "embeddoc.hxx" #include -#include -#include +#include #include #include #include @@ -121,62 +120,25 @@ EmbedServer_Impl::~EmbedServer_Impl() } } -// XInterface -------------------------------------------------- -uno::Any SAL_CALL -EmbedServer_Impl::queryInterface( - const uno::Type& aType ) - throw( - uno::RuntimeException - ) +OUString EmbedServer_Impl::getImplementationName() + throw (css::uno::RuntimeException, std::exception) { - uno::Any a= - ::cppu::queryInterface( - aType, static_cast(this)); - if( a == uno::Any()) - return OWeakObject::queryInterface( aType); - else - return a; + return OUString("com.sun.star.comp.ole.EmbedServer"); } -void SAL_CALL EmbedServer_Impl::acquire( ) throw(uno::RuntimeException) +sal_Bool EmbedServer_Impl::supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException, std::exception) { - OWeakObject::acquire(); + return cppu::supportsService(this, ServiceName); } -void SAL_CALL EmbedServer_Impl::release( ) throw (uno::RuntimeException) +css::uno::Sequence EmbedServer_Impl::getSupportedServiceNames() + throw (css::uno::RuntimeException, std::exception) { - OWeakObject::release(); + return css::uno::Sequence{ + "com.sun.star.document.OleEmbeddedServerRegistration"}; } - -// XTypeProvider -------------------------------------------------- -uno::Sequence< uno::Type > SAL_CALL -EmbedServer_Impl::getTypes( ) - throw( - uno::RuntimeException - ) -{ - static ::cppu::OTypeCollection *pCollection = 0; - if( ! pCollection ) - { - ::osl::MutexGuard guard( ::osl::Mutex::getGlobalMutex() ); - if( ! pCollection ) - { - static ::cppu::OTypeCollection collection( - cppu::UnoType::get(), - cppu::UnoType::get() ); - pCollection = &collection; - } - } - return (*pCollection).getTypes(); -} - -uno::Sequence< sal_Int8 > SAL_CALL EmbedServer_Impl::getImplementationId() throw(uno::RuntimeException) -{ - return css::uno::Sequence(); -} - - // EmbedProviderFactory_Impl EmbedProviderFactory_Impl::EmbedProviderFactory_Impl(const uno::Reference& xFactory, const GUID* pGuid) diff --git a/embedserv/source/inc/servprov.hxx b/embedserv/source/inc/servprov.hxx index 1c0a012b26c8..c74458d0ec20 100644 --- a/embedserv/source/inc/servprov.hxx +++ b/embedserv/source/inc/servprov.hxx @@ -25,29 +25,26 @@ #include #include #include -#include -#include +#include +#include class EmbedProviderFactory_Impl; -class EmbedServer_Impl : public ::cppu::OWeakObject, ::com::sun::star::lang::XTypeProvider +class EmbedServer_Impl: public cppu::WeakImplHelper { public: EmbedServer_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &xFactory ); virtual ~EmbedServer_Impl(); - // XInterface - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) - throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL acquire() throw (); - virtual void SAL_CALL release() throw (); - - // XTypeProvider - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) - throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() - throw(::com::sun::star::uno::RuntimeException); + OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; + + sal_Bool SAL_CALL supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; + + css::uno::Sequence SAL_CALL getSupportedServiceNames() + throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; protected: -- cgit