IClassFactoryWrapper can go away now
Change-Id: I7633648dc0398d2c1b6f04e6db9b18638a7451f5 Reviewed-on: https://gerrit.libreoffice.org/54781 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
This commit is contained in:
@@ -488,12 +488,12 @@ css::uno::Sequence<OUString> OleServer::getSupportedServiceNames()
|
||||
|
||||
bool OleServer::provideInstance(const Reference<XInterface>& xInst, GUID const * guid)
|
||||
{
|
||||
IClassFactoryWrapper* pFac = new OneInstanceOleWrapper( m_smgr, xInst );
|
||||
OneInstanceOleWrapper* pWrapper = new OneInstanceOleWrapper( m_smgr, xInst );
|
||||
|
||||
pFac->AddRef();
|
||||
m_wrapperList.push_back(pFac);
|
||||
pWrapper->AddRef();
|
||||
m_wrapperList.push_back(pWrapper);
|
||||
|
||||
return pFac->registerClass(guid);
|
||||
return pWrapper->registerClass(guid);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
@@ -39,41 +39,19 @@ Reference< XInterface> ConverterProvider_CreateInstanceVar1( const Reference<X
|
||||
Reference<XInterface> OleClient_CreateInstance( const Reference<XMultiServiceFactory> & xSMgr);
|
||||
/// @throws Exception
|
||||
Reference<XInterface> OleServer_CreateInstance( const Reference<XMultiServiceFactory> & xSMgr);
|
||||
/*****************************************************************************
|
||||
|
||||
IClassFactoryWrapper
|
||||
|
||||
Specify abstract helper methods on class factories, which provide
|
||||
UNO objects. These methods are used by objects of class OleServer,
|
||||
to handle the OLE registration of different class factories.
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
class IClassFactoryWrapper : public IClassFactory
|
||||
{
|
||||
public:
|
||||
|
||||
virtual bool registerClass(GUID const * pGuid) = 0;
|
||||
virtual bool deregisterClass() = 0;
|
||||
|
||||
protected:
|
||||
~IClassFactoryWrapper() {}
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
|
||||
OneInstanceOleWrapper
|
||||
|
||||
Provides an single UNO object as OLE object. Handle the
|
||||
OLE registration by overriding the abstract methods from
|
||||
IClassFactoryWrapper.
|
||||
Provides an single UNO object as OLE object.
|
||||
|
||||
Acts as a COM class factory. When IClassFactory::CreateInstance is being called
|
||||
Acts as a COM class factory. When IClassFactory::CreateInstance is being called
|
||||
then it maps the XInstance member it to a COM object.
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
class OneInstanceOleWrapper : public IClassFactoryWrapper
|
||||
class OneInstanceOleWrapper : public IClassFactory
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -81,8 +59,8 @@ public:
|
||||
const Reference<XInterface>& xInst );
|
||||
virtual ~OneInstanceOleWrapper();
|
||||
|
||||
bool registerClass(GUID const * pGuid) override;
|
||||
bool deregisterClass() override;
|
||||
bool registerClass(GUID const * pGuid);
|
||||
bool deregisterClass();
|
||||
|
||||
/* IUnknown methods */
|
||||
STDMETHOD(QueryInterface)(REFIID riid, LPVOID FAR * ppvObj) override;
|
||||
@@ -94,7 +72,6 @@ public:
|
||||
STDMETHOD(LockServer)(int fLock) override;
|
||||
|
||||
protected:
|
||||
|
||||
oslInterlockedCount m_refCount;
|
||||
Reference<XInterface> m_xInst;
|
||||
DWORD m_factoryHandle;
|
||||
@@ -198,7 +175,7 @@ public:
|
||||
protected:
|
||||
bool provideInstance(const Reference<XInterface>& xInst, GUID const * guid);
|
||||
|
||||
list< IClassFactoryWrapper* > m_wrapperList;
|
||||
list< OneInstanceOleWrapper* > m_wrapperList;
|
||||
Reference< XBridgeSupplier2 > m_bridgeSupplier;
|
||||
|
||||
Reference<XMultiServiceFactory> m_smgr;
|
||||
|
Reference in New Issue
Block a user