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

Fix various Windows-only XServiceInfo implementations

...to match what is recorded in the .component files

Change-Id: Ibc5bb0575f3869317e4d14614cf1dad0af728ddc
üst f17568f9
...@@ -24,8 +24,7 @@ ...@@ -24,8 +24,7 @@
#include "servprov.hxx" #include "servprov.hxx"
#include "embeddoc.hxx" #include "embeddoc.hxx"
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <cppuhelper/typeprovider.hxx> #include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <osl/diagnose.h> #include <osl/diagnose.h>
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <osl/thread.h> #include <osl/thread.h>
...@@ -121,62 +120,25 @@ EmbedServer_Impl::~EmbedServer_Impl() ...@@ -121,62 +120,25 @@ EmbedServer_Impl::~EmbedServer_Impl()
} }
} }
// XInterface -------------------------------------------------- OUString EmbedServer_Impl::getImplementationName()
uno::Any SAL_CALL throw (css::uno::RuntimeException, std::exception)
EmbedServer_Impl::queryInterface(
const uno::Type& aType )
throw(
uno::RuntimeException
)
{ {
uno::Any a= return OUString("com.sun.star.comp.ole.EmbedServer");
::cppu::queryInterface(
aType, static_cast<lang::XTypeProvider*>(this));
if( a == uno::Any())
return OWeakObject::queryInterface( aType);
else
return a;
} }
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<OUString> EmbedServer_Impl::getSupportedServiceNames()
throw (css::uno::RuntimeException, std::exception)
{ {
OWeakObject::release(); return css::uno::Sequence<OUString>{
"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<uno::XWeak>::get(),
cppu::UnoType<lang::XTypeProvider>::get() );
pCollection = &collection;
}
}
return (*pCollection).getTypes();
}
uno::Sequence< sal_Int8 > SAL_CALL EmbedServer_Impl::getImplementationId() throw(uno::RuntimeException)
{
return css::uno::Sequence<sal_Int8>();
}
// EmbedProviderFactory_Impl // EmbedProviderFactory_Impl
EmbedProviderFactory_Impl::EmbedProviderFactory_Impl(const uno::Reference<lang::XMultiServiceFactory>& xFactory, const GUID* pGuid) EmbedProviderFactory_Impl::EmbedProviderFactory_Impl(const uno::Reference<lang::XMultiServiceFactory>& xFactory, const GUID* pGuid)
......
...@@ -25,29 +25,26 @@ ...@@ -25,29 +25,26 @@
#include <com/sun/star/uno/Reference.h> #include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.h> #include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/uno/XInterface.hpp> #include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp> #include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/weak.hxx> #include <cppuhelper/implbase.hxx>
class EmbedProviderFactory_Impl; class EmbedProviderFactory_Impl;
class EmbedServer_Impl : public ::cppu::OWeakObject, ::com::sun::star::lang::XTypeProvider class EmbedServer_Impl: public cppu::WeakImplHelper<css::lang::XServiceInfo>
{ {
public: public:
EmbedServer_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &xFactory ); EmbedServer_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &xFactory );
virtual ~EmbedServer_Impl(); virtual ~EmbedServer_Impl();
// XInterface OUString SAL_CALL getImplementationName()
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL acquire() throw (); sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
virtual void SAL_CALL release() throw (); throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
// XTypeProvider css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
throw(::com::sun::star::uno::RuntimeException);
protected: protected:
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "unoobjw.hxx" #include "unoobjw.hxx"
#include "oleobjw.hxx" #include "oleobjw.hxx"
#include <cppuhelper/queryinterface.hxx> #include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/supportsservice.hxx>
using namespace cppu; using namespace cppu;
using namespace osl; using namespace osl;
...@@ -424,6 +425,30 @@ Any SAL_CALL OleConverter_Impl2::createBridge(const Any& modelDepObject, ...@@ -424,6 +425,30 @@ Any SAL_CALL OleConverter_Impl2::createBridge(const Any& modelDepObject,
return ret; return ret;
} }
OUString OleConverter_Impl2::getImplementationName()
throw (css::uno::RuntimeException, std::exception)
{
return m_nUnoWrapperClass == INTERFACE_OLE_WRAPPER_IMPL
? OUString("com.sun.star.comp.ole.OleConverter2")
: OUString("com.sun.star.comp.ole.OleConverterVar1");
}
sal_Bool OleConverter_Impl2::supportsService(OUString const & ServiceName)
throw (css::uno::RuntimeException, std::exception)
{
return cppu::supportsService(this, ServiceName);
}
css::uno::Sequence<OUString> OleConverter_Impl2::getSupportedServiceNames()
throw (css::uno::RuntimeException, std::exception)
{
return m_nUnoWrapperClass == INTERFACE_OLE_WRAPPER_IMPL
? css::uno::Sequence<OUString>{
"com.sun.star.bridge.OleBridgeSupplier2",
"com.sun.star.bridge.oleautomation.BridgeSupplier"}
: css::uno::Sequence<OUString>{
"com.sun.star.bridge.OleBridgeSupplierVar1"};
}
// XInitialize ------------------------------------------------------------------------------ // XInitialize ------------------------------------------------------------------------------
// the first argument is an XMultiServiceFactory if at all // the first argument is an XMultiServiceFactory if at all
...@@ -496,10 +521,24 @@ Sequence< OUString > SAL_CALL OleClient_Impl::getAvailableServiceNames() thro ...@@ -496,10 +521,24 @@ Sequence< OUString > SAL_CALL OleClient_Impl::getAvailableServiceNames() thro
return ret; return ret;
} }
OUString OleClient_Impl::getImplementationName() OUString OleClient_Impl::getImplementationName()
throw (css::uno::RuntimeException, std::exception)
{
return OUString("com.sun.star.comp.ole.OleClient");
}
sal_Bool OleClient_Impl::supportsService(OUString const & ServiceName)
throw (css::uno::RuntimeException, std::exception)
{
return cppu::supportsService(this, ServiceName);
}
css::uno::Sequence<OUString> OleClient_Impl::getSupportedServiceNames()
throw (css::uno::RuntimeException, std::exception)
{ {
return OUString(reinterpret_cast<const sal_Unicode*>(L"com.sun.star.comp.ole.OleClient")); return css::uno::Sequence<OUString>{
"com.sun.star.bridge.OleObjectFactory",
"com.sun.star.bridge.oleautomation.Factory"};
} }
Reference<XInterface> SAL_CALL OleClient_Impl::createInstance(const OUString& ServiceSpecifier) throw (Exception, RuntimeException ) Reference<XInterface> SAL_CALL OleClient_Impl::createInstance(const OUString& ServiceSpecifier) throw (Exception, RuntimeException )
...@@ -612,48 +651,27 @@ OleServer_Impl::~OleServer_Impl() ...@@ -612,48 +651,27 @@ OleServer_Impl::~OleServer_Impl()
m_wrapperList.pop_front(); m_wrapperList.pop_front();
} }
} }
// XInterface --------------------------------------------------
Any SAL_CALL OleServer_Impl::queryInterface( const Type& aType ) throw(RuntimeException) OUString OleServer_Impl::getImplementationName()
{ throw (css::uno::RuntimeException, std::exception)
Any a= ::cppu::queryInterface( aType, static_cast<XTypeProvider*>(this));
if( a == Any())
return OWeakObject::queryInterface( aType);
else
return a;
}
void SAL_CALL OleServer_Impl::acquire( ) throw()
{
OWeakObject::acquire();
}
void SAL_CALL OleServer_Impl::release( ) throw ()
{ {
OWeakObject::release(); return OUString("com.sun.star.comp.ole.OleServer");
} }
sal_Bool OleServer_Impl::supportsService(OUString const & ServiceName)
// XTypeProvider -------------------------------------------------- throw (css::uno::RuntimeException, std::exception)
Sequence< Type > SAL_CALL OleServer_Impl::getTypes( ) throw(RuntimeException)
{ {
static OTypeCollection *pCollection = 0; return cppu::supportsService(this, ServiceName);
if( ! pCollection )
{
MutexGuard guard( Mutex::getGlobalMutex() );
if( ! pCollection )
{
static OTypeCollection collection(
cppu::UnoType<XWeak>::get(),
cppu::UnoType<XTypeProvider>::get() );
pCollection = &collection;
}
}
return (*pCollection).getTypes();
} }
Sequence< sal_Int8 > SAL_CALL OleServer_Impl::getImplementationId() throw(RuntimeException)
css::uno::Sequence<OUString> OleServer_Impl::getSupportedServiceNames()
throw (css::uno::RuntimeException, std::exception)
{ {
return css::uno::Sequence<sal_Int8>(); return css::uno::Sequence<OUString>{
"com.sun.star.bridge.OleApplicationRegistration",
"com.sun.star.bridge.oleautomation.ApplicationRegistration"};
} }
sal_Bool OleServer_Impl::provideService(const Reference<XSingleServiceFactory>& xSFact, GUID* guid) sal_Bool OleServer_Impl::provideService(const Reference<XSingleServiceFactory>& xSFact, GUID* guid)
{ {
IClassFactoryWrapper* pFac = new ProviderOleWrapper_Impl( m_smgr, xSFact, guid); IClassFactoryWrapper* pFac = new ProviderOleWrapper_Impl( m_smgr, xSFact, guid);
......
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
#define INCLUDED_EXTENSIONS_SOURCE_OLE_SERVPROV_HXX #define INCLUDED_EXTENSIONS_SOURCE_OLE_SERVPROV_HXX
#include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XInitialization.hpp>
#include <cppuhelper/implbase2.hxx> #include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase.hxx>
#include "ole2uno.hxx" #include "ole2uno.hxx"
#include "unoconversionutilities.hxx" #include "unoconversionutilities.hxx"
...@@ -164,7 +165,7 @@ protected: ...@@ -164,7 +165,7 @@ protected:
// latter for OleBridgeSupplierVar1. // latter for OleBridgeSupplierVar1.
// The m_nComWrapperClass specifies the class which is used as wrapper for COM interfaces. // The m_nComWrapperClass specifies the class which is used as wrapper for COM interfaces.
// Currently there is only one class available ( IUnknownWrapper_Impl). // Currently there is only one class available ( IUnknownWrapper_Impl).
class OleConverter_Impl2 : public WeakImplHelper2<XBridgeSupplier2, XInitialization>, class OleConverter_Impl2 : public WeakImplHelper<XBridgeSupplier2, XInitialization, css::lang::XServiceInfo>,
public UnoConversionUtilities<OleConverter_Impl2> public UnoConversionUtilities<OleConverter_Impl2>
{ {
public: public:
...@@ -183,6 +184,15 @@ public: ...@@ -183,6 +184,15 @@ public:
// XInitialization // XInitialization
virtual void SAL_CALL initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException); virtual void SAL_CALL initialize( const Sequence< Any >& aArguments ) throw(Exception, 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<OUString> SAL_CALL getSupportedServiceNames()
throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
// Abstract struct UnoConversionUtilities // Abstract struct UnoConversionUtilities
virtual Reference< XInterface > createUnoWrapperInstance(); virtual Reference< XInterface > createUnoWrapperInstance();
virtual Reference< XInterface > createComWrapperInstance(); virtual Reference< XInterface > createComWrapperInstance();
...@@ -200,7 +210,7 @@ protected: ...@@ -200,7 +210,7 @@ protected:
*****************************************************************************/ *****************************************************************************/
class OleClient_Impl : public WeakImplHelper1<XMultiServiceFactory>, class OleClient_Impl : public WeakImplHelper<XMultiServiceFactory, css::lang::XServiceInfo>,
public UnoConversionUtilities<OleClient_Impl> public UnoConversionUtilities<OleClient_Impl>
{ {
public: public:
...@@ -212,12 +222,19 @@ public: ...@@ -212,12 +222,19 @@ public:
virtual Reference<XInterface> SAL_CALL createInstanceWithArguments(const OUString& ServiceSpecifier, const Sequence< Any >& Arguments) throw (Exception, RuntimeException); virtual Reference<XInterface> SAL_CALL createInstanceWithArguments(const OUString& ServiceSpecifier, const Sequence< Any >& Arguments) throw (Exception, RuntimeException);
Sequence< OUString > SAL_CALL getAvailableServiceNames() throw (RuntimeException); Sequence< OUString > SAL_CALL getAvailableServiceNames() throw (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<OUString> SAL_CALL getSupportedServiceNames()
throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
// Abstract struct UnoConversionUtilities // Abstract struct UnoConversionUtilities
virtual Reference< XInterface > createUnoWrapperInstance(); virtual Reference< XInterface > createUnoWrapperInstance();
virtual Reference< XInterface > createComWrapperInstance(); virtual Reference< XInterface > createComWrapperInstance();
OUString getImplementationName();
protected: protected:
Reference<XBridgeSupplier2> m_bridgeSupplier; Reference<XBridgeSupplier2> m_bridgeSupplier;
}; };
...@@ -233,20 +250,20 @@ protected: ...@@ -233,20 +250,20 @@ protected:
*****************************************************************************/ *****************************************************************************/
class OleServer_Impl : public OWeakObject, XTypeProvider class OleServer_Impl : public cppu::WeakImplHelper<css::lang::XServiceInfo>
{ {
public: public:
OleServer_Impl( const Reference<XMultiServiceFactory> &smgr); OleServer_Impl( const Reference<XMultiServiceFactory> &smgr);
~OleServer_Impl(); ~OleServer_Impl();
// XInterface OUString SAL_CALL getImplementationName()
virtual Any SAL_CALL queryInterface( const Type& aType ) throw(RuntimeException); throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL acquire( ) throw ();
virtual void SAL_CALL release( ) throw (); sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
// XTypeProvider css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
virtual Sequence< Type > SAL_CALL getTypes( ) throw(RuntimeException); throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(RuntimeException);
protected: protected:
......
...@@ -34,7 +34,7 @@ using namespace ::cppu ; ...@@ -34,7 +34,7 @@ using namespace ::cppu ;
using com::sun::star::system::XSystemShellExecute; using com::sun::star::system::XSystemShellExecute;
#define SYSSHEXEC_SERVICE_NAME "com.sun.star.system.SystemShellExecute" #define SYSSHEXEC_SERVICE_NAME "com.sun.star.system.SystemShellExecute"
#define SYSSHEXEC_IMPL_NAME "com.sun.star.system.SystemShellExecute" #define SYSSHEXEC_IMPL_NAME "com.sun.star.sys.shell.SystemShellExecute"
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="smplmail" xmlns="http://openoffice.org/2010/uno-components"> prefix="smplmail" xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.system.SimpleSystemMail"> <implementation name="com.sun.star.sys.shell.SimpleSystemMail">
<service name="com.sun.star.system.SimpleSystemMail"/> <service name="com.sun.star.system.SimpleSystemMail"/>
</implementation> </implementation>
</component> </component>
...@@ -34,7 +34,7 @@ using namespace ::cppu ; ...@@ -34,7 +34,7 @@ using namespace ::cppu ;
using com::sun::star::system::XSimpleMailClientSupplier; using com::sun::star::system::XSimpleMailClientSupplier;
#define COMP_SERVICE_NAME "com.sun.star.system.SimpleSystemMail" #define COMP_SERVICE_NAME "com.sun.star.system.SimpleSystemMail"
#define COMP_IMPL_NAME "com.sun.star.system.SimpleSystemMail" #define COMP_IMPL_NAME "com.sun.star.sys.shell.SimpleSystemMail"
......
...@@ -39,7 +39,7 @@ namespace // private ...@@ -39,7 +39,7 @@ namespace // private
Sequence< OUString > SAL_CALL Component_getSupportedServiceNames() Sequence< OUString > SAL_CALL Component_getSupportedServiceNames()
{ {
Sequence< OUString > aRet(1); Sequence< OUString > aRet(1);
aRet[0] = "com.sun.star.sys.shell.SimpleSystemMail"; aRet[0] = "com.sun.star.system.SimpleSystemMail";
return aRet; return aRet;
} }
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="syssh" xmlns="http://openoffice.org/2010/uno-components"> prefix="syssh" xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.system.SystemShellExecute"> <implementation name="com.sun.star.sys.shell.SystemShellExecute">
<service name="com.sun.star.system.SystemShellExecute"/> <service name="com.sun.star.system.SystemShellExecute"/>
</implementation> </implementation>
</component> </component>
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