summaryrefslogtreecommitdiff
path: root/extensions/source/ole
diff options
context:
space:
mode:
authorJoachim Lingner <jl@openoffice.org>2001-06-27 09:56:03 +0000
committerJoachim Lingner <jl@openoffice.org>2001-06-27 09:56:03 +0000
commit51e6e0ac8fb5e40cee19f423638be1059a0a9d37 (patch)
tree75b6bca01dd298c83972b2675daafa82b2435682 /extensions/source/ole
parent6da084686bb61143ade582d971c90dc877ba2841 (diff)
#67468# library unloading
Diffstat (limited to 'extensions/source/ole')
-rw-r--r--extensions/source/ole/ole2uno.hxx14
-rw-r--r--extensions/source/ole/oleobjw.cxx77
-rw-r--r--extensions/source/ole/servprov.cxx191
-rw-r--r--extensions/source/ole/servprov.hxx24
-rw-r--r--extensions/source/ole/servreg.cxx81
-rw-r--r--extensions/source/ole/unoconversionutilities.hxx93
-rw-r--r--extensions/source/ole/unoobjw.cxx69
7 files changed, 196 insertions, 353 deletions
diff --git a/extensions/source/ole/ole2uno.hxx b/extensions/source/ole/ole2uno.hxx
index a625f7b41dfd..2656278228e2 100644
--- a/extensions/source/ole/ole2uno.hxx
+++ b/extensions/source/ole/ole2uno.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ole2uno.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jl $ $Date: 2000-10-12 12:50:08 $
+ * last change: $Author: jl $ $Date: 2001-06-27 10:56:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -174,12 +174,12 @@ using namespace std;
namespace ole_adapter
{
// function shared in this component
-Reference<XSingleServiceFactory> o2u_getConverterProvider2(const Reference<XMultiServiceFactory>& xMan, const Reference<XRegistryKey>& xKey);
-Reference<XSingleServiceFactory> o2u_getConverterProviderVar1(const Reference<XMultiServiceFactory>& xMan, const Reference<XRegistryKey>& xKey);
-Reference<XSingleServiceFactory> o2u_getClientProvider(const Reference<XMultiServiceFactory>& xMan, const Reference<XRegistryKey>& xKey);
-Reference<XSingleServiceFactory> o2u_getServerProvider(const Reference<XMultiServiceFactory>& xMan, const Reference<XRegistryKey>& xKey);
+// Reference<XSingleServiceFactory> o2u_getConverterProvider2(const Reference<XMultiServiceFactory>& xMan, const Reference<XRegistryKey>& xKey);
+// Reference<XSingleServiceFactory> o2u_getConverterProviderVar1(const Reference<XMultiServiceFactory>& xMan, const Reference<XRegistryKey>& xKey);
+// Reference<XSingleServiceFactory> o2u_getClientProvider(const Reference<XMultiServiceFactory>& xMan, const Reference<XRegistryKey>& xKey);
+// Reference<XSingleServiceFactory> o2u_getServerProvider(const Reference<XMultiServiceFactory>& xMan, const Reference<XRegistryKey>& xKey);
-Reference<XMultiServiceFactory> o2u_getMultiServiceFactory();
+//Reference<XMultiServiceFactory> o2u_getMultiServiceFactory();
Reference<XRegistryKey> o2u_getRegistryKey();
const VARTYPE getVarType( const Any& val);
Type getType( BSTR type);
diff --git a/extensions/source/ole/oleobjw.cxx b/extensions/source/ole/oleobjw.cxx
index c8063a16b11d..8c76ab57d5f3 100644
--- a/extensions/source/ole/oleobjw.cxx
+++ b/extensions/source/ole/oleobjw.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: oleobjw.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: jl $ $Date: 2000-10-20 15:35:34 $
+ * last change: $Author: jl $ $Date: 2001-06-27 10:56:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -453,7 +453,6 @@ Any IUnknownWrapper_Impl::invokeWithDispIdUnoTlb(DISPID dispID,
// Then out and in/out parameters have to be treated differently than
// with common COM objects.
sal_Bool bJScriptObject= isJScriptObject();
-// CComDispatchDriver disp( m_pDispatch);
CComVariant *pVarParams= NULL;
CComVariant *pVarParamsRef= NULL;
@@ -481,7 +480,6 @@ Any IUnknownWrapper_Impl::invokeWithDispIdUnoTlb(DISPID dispID,
{
pVarParamsRef= new CComVariant[ outParameterCount];
// build up the parameters for IDispatch::Invoke
-// sal_Int32 inParamIndex=0;
sal_Int32 outParamIndex=0;
for( i= 0; i < parameterCount; i++)
@@ -634,7 +632,6 @@ Any IUnknownWrapper_Impl::invokeWithDispIdUnoTlb(DISPID dispID,
}
else // it is an JScriptObject
{
-// sal_Int32 inParamIndex= 0;
for( sal_Int32 i= 0; i< parameterCount; i++)
{
// In parameter
@@ -1050,13 +1047,13 @@ Reference< XInterface > IUnknownWrapper_Impl::createUnoWrapperInstance()
if( m_nUnoWrapperClass == INTERFACE_OLE_WRAPPER_IMPL)
{
Reference<XWeak> xWeak= static_cast<XWeak*>( new InterfaceOleWrapper_Impl(
- m_xMultiServiceFactory, m_nUnoWrapperClass, m_nComWrapperClass));
+ m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
return Reference<XInterface>( xWeak, UNO_QUERY);
}
else if( m_nUnoWrapperClass == UNO_OBJECT_WRAPPER_REMOTE_OPT)
{
Reference<XWeak> xWeak= static_cast<XWeak*>( new UnoObjectWrapperRemoteOpt(
- m_xMultiServiceFactory, m_nUnoWrapperClass, m_nComWrapperClass));
+ m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
return Reference<XInterface>( xWeak, UNO_QUERY);
}
else
@@ -1065,7 +1062,7 @@ Reference< XInterface > IUnknownWrapper_Impl::createUnoWrapperInstance()
Reference<XInterface> IUnknownWrapper_Impl::createComWrapperInstance()
{
Reference<XWeak> xWeak= static_cast<XWeak*>( new IUnknownWrapper_Impl(
- m_xMultiServiceFactory, m_nUnoWrapperClass, m_nComWrapperClass));
+ m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
return Reference<XInterface>( xWeak, UNO_QUERY);
}
@@ -1374,70 +1371,6 @@ Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(DISPID dispID,
return ret;
}
-// parameter is an array that contains the referenced parameters
-// params is an array of VARIANTs that contains values which are referenced by
-// the VARIANTS in DISPPARAMS::rgvarg
-//sal_Bool IUnknownWrapper_Impl::prepareOutParams( VARIANT* params, sal_uInt32 count )
-//{
-// sal_Bool ret= sal_True;
-// ITypeInfo* pType= getTypeInfo();
-// if(! pType )
-// return sal_False;
-// // build the map of function names and their tlb index
-// if( sal_False == isComTlbIndex())
-// buildComTlbIndex();
-//
-// typedef TLBFuncIndexMap::const_iterator cit;
-// cit itIndex= m_mapComFunc.find( m_usCurrentInvoke );
-// if( itIndex != m_mapComFunc.end())
-// {
-// FUNCDESC* funcDesc= NULL;
-// if( SUCCEEDED( pType->GetFuncDesc( itIndex->second, &funcDesc)))
-// {
-// m_seqCurrentParamTypes.realloc( funcDesc->cParams);
-// // Examine each param
-// for( sal_Int16 iparams= 0; iparams < funcDesc->cParams; iparams++)
-// {
-// sal_Int32 flags= funcDesc->lprgelemdescParam->paramdesc.wParamFlags;
-//
-// // out parameter
-// if( flags & PARAMFLAG_FOUT &&
-// ! (flags & PARAMFLAG_FIN))
-// {
-// m_seqCurrentParamTypes[ iparams]= (sal_Int32) OUT_PARAM;
-// VariantClear( &params[iparams] );
-// params[ iparams].byref=0;
-// // Get the type
-// VARTYPE paramType;
-// if( getElementTypeDesc( & funcDesc->lprgelemdescParam[iparams].tdesc, paramType))
-// {
-// // dispparams: VT_VARIANT |VT_BYREF , referenced Value: VT_EMPTY
-// if( !( paramType & VT_ARRAY) &&
-// (paramType & VT_TYPEMASK) == VT_VARIANT)
-// params[iparams].vt= VT_EMPTY;
-// else
-// params[iparams].vt= (paramType ^ VT_BYREF);
-// }
-// else
-// ret= sal_False;
-// }
-// // in/out parameter
-// else if(flags & PARAMFLAG_FIN && flags & PARAMFLAG_FOUT )
-// m_seqCurrentParamTypes[ iparams]= (sal_Int32) INOUT_PARAM;
-// // in parameter
-// else if(flags & PARAMFLAG_FIN && ! (flags & PARAMFLAG_FOUT ))
-// m_seqCurrentParamTypes[ iparams]= (sal_Int32) IN_PARAM;
-// }
-// pType->ReleaseFuncDesc( funcDesc);
-// }
-// else
-// ret= sal_False;
-// }
-// else
-// ret= sal_False;
-//
-// return ret;
-//}
sal_Bool IUnknownWrapper_Impl::getParameterInfo()
{
diff --git a/extensions/source/ole/servprov.cxx b/extensions/source/ole/servprov.cxx
index 661bb47dd54a..8af56d10ad57 100644
--- a/extensions/source/ole/servprov.cxx
+++ b/extensions/source/ole/servprov.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: servprov.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jl $ $Date: 2000-10-20 11:28:16 $
+ * last change: $Author: jl $ $Date: 2001-06-27 10:56:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,7 +65,7 @@
#include "servprov.hxx"
#include "unoobjw.hxx"
#include "oleobjw.hxx"
-
+#include <rtl/unload.h>
using namespace std;
using namespace cppu;
@@ -91,28 +91,10 @@ namespace ole_adapter
// {82154420-0FBF-11d4-8313-005004526AB4}
DEFINE_GUID(OID_ServiceManager, 0x82154420, 0xfbf, 0x11d4, 0x83, 0x13, 0x0, 0x50, 0x4, 0x52, 0x6a, 0xb4);
+extern rtl_StandardModuleCount globalModuleCount;
-static Reference<XMultiServiceFactory> xMultiServiceFactory;
-static Reference<XRegistryKey> xRegistryKey;
-
-Reference<XMultiServiceFactory> o2u_getMultiServiceFactory()
-{
- return xMultiServiceFactory;
-}
-
-Reference<XRegistryKey> o2u_getRegistryKey()
-{
- return xRegistryKey;
-}
-
extern OMutex globalWrapperMutex;
-Reference<XSingleServiceFactory> getInvocationFactory()
-{
- OGuard aGuard(globalWrapperMutex);
- static Reference<XSingleServiceFactory> factory= Reference<XSingleServiceFactory>(o2u_getMultiServiceFactory()->createInstance( INVOCATION_SERVICE), UNO_QUERY);
- return factory;
-}
/*****************************************************************************
@@ -120,12 +102,14 @@ Reference<XSingleServiceFactory> getInvocationFactory()
*****************************************************************************/
-ProviderOleWrapper_Impl::ProviderOleWrapper_Impl(const Reference<XSingleServiceFactory>& xSFact, GUID* pGuid)
- : m_xSingleServiceFactory(xSFact)
+ProviderOleWrapper_Impl::ProviderOleWrapper_Impl(const Reference<XMultiServiceFactory>& smgr,
+ const Reference<XSingleServiceFactory>& xSFact, GUID* pGuid)
+ : m_xSingleServiceFactory(xSFact),
+ m_smgr( smgr)
{
m_guid = *pGuid;
- Reference<XInterface> xInt = o2u_getMultiServiceFactory()->createInstance(L"com.sun.star.bridge.OleBridgeSupplier2");
+ Reference<XInterface> xInt = smgr->createInstance(L"com.sun.star.bridge.OleBridgeSupplier2");
if (xInt.is())
{
@@ -253,12 +237,14 @@ STDMETHODIMP ProviderOleWrapper_Impl::LockServer(int fLock)
*****************************************************************************/
-OneInstanceOleWrapper_Impl::OneInstanceOleWrapper_Impl(const Reference<XInterface>& xInst, GUID* pGuid)
- : m_xInst(xInst)
+OneInstanceOleWrapper_Impl::OneInstanceOleWrapper_Impl( const Reference<XMultiServiceFactory>& smgr,
+ const Reference<XInterface>& xInst, GUID* pGuid)
+ : m_xInst(xInst),
+ m_smgr( smgr)
{
m_guid = *pGuid;
- Reference<XInterface> xInt = o2u_getMultiServiceFactory()->createInstance(L"com.sun.star.bridge.OleBridgeSupplier2");
+ Reference<XInterface> xInt = m_smgr->createInstance(L"com.sun.star.bridge.OleBridgeSupplier2");
if (xInt.is())
{
@@ -379,20 +365,26 @@ STDMETHODIMP OneInstanceOleWrapper_Impl::LockServer(int fLock)
*****************************************************************************/
-OleConverter_Impl2::OleConverter_Impl2()
+OleConverter_Impl2::OleConverter_Impl2( const Reference<XMultiServiceFactory> &smgr):
+ UnoConversionUtilities<OleConverter_Impl2>( smgr)
{
+ // library unloading support
+ globalModuleCount.modCnt.acquire( &globalModuleCount.modCnt);
}
// The XMultiServiceFactory is later set by XInitialization
-OleConverter_Impl2::OleConverter_Impl2( sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass ):
- UnoConversionUtilities<OleConverter_Impl2>( unoWrapperClass, comWrapperClass )
+OleConverter_Impl2::OleConverter_Impl2( const Reference<XMultiServiceFactory>& smgr, sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass ):
+ UnoConversionUtilities<OleConverter_Impl2>( smgr, unoWrapperClass, comWrapperClass )
{
+ //library unloading support
+ globalModuleCount.modCnt.acquire( &globalModuleCount.modCnt);
}
OleConverter_Impl2::~OleConverter_Impl2()
{
+ globalModuleCount.modCnt.release( &globalModuleCount.modCnt);
}
// XBridgeSupplier --------------------------------------------------------------
@@ -489,7 +481,7 @@ void SAL_CALL OleConverter_Impl2::initialize( const Sequence< Any >& aArguments
Reference < XInterface > xInt;
aArguments[0] >>= xInt;
Reference <XMultiServiceFactory> xMulti( xInt, UNO_QUERY);
- m_xMultiServiceFactory= xMulti;
+ m_smgrRemote= xMulti;
}
}
@@ -499,13 +491,13 @@ Reference< XInterface > OleConverter_Impl2::createUnoWrapperInstance()
if( m_nUnoWrapperClass == INTERFACE_OLE_WRAPPER_IMPL)
{
Reference<XWeak> xWeak= static_cast<XWeak*>( new InterfaceOleWrapper_Impl(
- m_xMultiServiceFactory, m_nUnoWrapperClass, m_nComWrapperClass));
+ m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
return Reference<XInterface>( xWeak, UNO_QUERY);
}
else if( m_nUnoWrapperClass == UNO_OBJECT_WRAPPER_REMOTE_OPT)
{
Reference<XWeak> xWeak= static_cast<XWeak*>( new UnoObjectWrapperRemoteOpt(
- m_xMultiServiceFactory, m_nUnoWrapperClass, m_nComWrapperClass));
+ m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
return Reference<XInterface>( xWeak, UNO_QUERY);
}
else
@@ -515,7 +507,7 @@ Reference< XInterface > OleConverter_Impl2::createUnoWrapperInstance()
Reference< XInterface > OleConverter_Impl2::createComWrapperInstance()
{
Reference<XWeak> xWeak= static_cast<XWeak*>( new IUnknownWrapper_Impl(
- m_xMultiServiceFactory, m_nUnoWrapperClass, m_nComWrapperClass));
+ m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
return Reference<XInterface>( xWeak, UNO_QUERY);
}
@@ -527,9 +519,12 @@ Reference< XInterface > OleConverter_Impl2::createComWrapperInstance()
*****************************************************************************/
-OleClient_Impl::OleClient_Impl()
+OleClient_Impl::OleClient_Impl( const Reference<XMultiServiceFactory>& smgr):
+ UnoConversionUtilities<OleClient_Impl>( smgr)
{
- Reference<XInterface> xInt = o2u_getMultiServiceFactory()->createInstance(L"com.sun.star.bridge.OleBridgeSupplier2");
+ // library unloading support
+ globalModuleCount.modCnt.acquire( &globalModuleCount.modCnt);
+ Reference<XInterface> xInt;// = m_smgr->createInstance(L"com.sun.star.bridge.OleBridgeSupplier2");
if (xInt.is())
{
@@ -541,6 +536,8 @@ OleClient_Impl::OleClient_Impl()
OleClient_Impl::~OleClient_Impl()
{
+ // library unloading support
+ globalModuleCount.modCnt.release( &globalModuleCount.modCnt);
}
Sequence< OUString > SAL_CALL OleClient_Impl::getAvailableServiceNames() throw( RuntimeException )
@@ -618,13 +615,13 @@ Reference< XInterface > OleClient_Impl::createUnoWrapperInstance()
if( m_nUnoWrapperClass == INTERFACE_OLE_WRAPPER_IMPL)
{
Reference<XWeak> xWeak= static_cast<XWeak*>( new InterfaceOleWrapper_Impl(
- m_xMultiServiceFactory, m_nUnoWrapperClass, m_nComWrapperClass));
+ m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
return Reference<XInterface>( xWeak, UNO_QUERY);
}
else if( m_nUnoWrapperClass == UNO_OBJECT_WRAPPER_REMOTE_OPT)
{
Reference<XWeak> xWeak= static_cast<XWeak*>( new UnoObjectWrapperRemoteOpt(
- m_xMultiServiceFactory, m_nUnoWrapperClass, m_nComWrapperClass));
+ m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
return Reference<XInterface>( xWeak, UNO_QUERY);
}
else
@@ -634,7 +631,7 @@ Reference< XInterface > OleClient_Impl::createUnoWrapperInstance()
Reference< XInterface > OleClient_Impl::createComWrapperInstance( )
{
Reference<XWeak> xWeak= static_cast<XWeak*>( new IUnknownWrapper_Impl(
- m_xMultiServiceFactory, m_nUnoWrapperClass, m_nComWrapperClass));
+ m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
return Reference<XInterface>( xWeak, UNO_QUERY);
}
@@ -646,9 +643,12 @@ Reference< XInterface > OleClient_Impl::createComWrapperInstance( )
*****************************************************************************/
-OleServer_Impl::OleServer_Impl()
+OleServer_Impl::OleServer_Impl( const Reference<XMultiServiceFactory>& smgr):
+ m_smgr( smgr)
{
- Reference<XInterface> xInt = o2u_getMultiServiceFactory()->createInstance(L"com.sun.star.bridge.OleBridgeSupplier2");
+ //library unloading support
+ globalModuleCount.modCnt.acquire( &globalModuleCount.modCnt);
+ Reference<XInterface> xInt = m_smgr->createInstance(L"com.sun.star.bridge.OleBridgeSupplier2");
if (xInt.is())
{
@@ -657,7 +657,7 @@ OleServer_Impl::OleServer_Impl()
a >>= m_bridgeSupplier;
}
- sal_Bool ret = provideInstance(o2u_getMultiServiceFactory(), (GUID*)&OID_ServiceManager);
+ sal_Bool ret = provideInstance( m_smgr, (GUID*)&OID_ServiceManager);
}
OleServer_Impl::~OleServer_Impl()
@@ -668,6 +668,8 @@ OleServer_Impl::~OleServer_Impl()
(*m_wrapperList.begin())->Release();
m_wrapperList.pop_front();
}
+ //library unloading support
+ globalModuleCount.modCnt.release( &globalModuleCount.modCnt);
}
// XInterface --------------------------------------------------
Any SAL_CALL OleServer_Impl::queryInterface( const Type& aType ) throw(RuntimeException)
@@ -725,7 +727,7 @@ sal_Bool OleServer_Impl::provideService(const Reference<XSingleServiceFactory>&
{
sal_Bool ret = FALSE;
- IClassFactoryWrapper* pFac = new ProviderOleWrapper_Impl(xSFact, guid);
+ IClassFactoryWrapper* pFac = new ProviderOleWrapper_Impl( m_smgr, xSFact, guid);
pFac->AddRef();
@@ -738,7 +740,7 @@ sal_Bool OleServer_Impl::provideInstance(const Reference<XInterface>& xInst, GUI
{
sal_Bool ret = FALSE;
- IClassFactoryWrapper* pFac = new OneInstanceOleWrapper_Impl(xInst, guid);
+ IClassFactoryWrapper* pFac = new OneInstanceOleWrapper_Impl( m_smgr, xInst, guid);
pFac->AddRef();
m_wrapperList.push_back(pFac);
@@ -748,103 +750,4 @@ sal_Bool OleServer_Impl::provideInstance(const Reference<XInterface>& xInst, GUI
-/*****************************************************************************
-
- functions to create the service providers
-
-*****************************************************************************/
-
-Reference<XSingleServiceFactory> o2u_getConverterProvider2(const Reference<XMultiServiceFactory>& xMan,
- const Reference<XRegistryKey>& xKey)
-{
- static Reference<XSingleServiceFactory> ret = NULL;
-
- if (!ret.is())
- {
- if (!xMultiServiceFactory.is()) xMultiServiceFactory = xMan;
-
- Sequence<OUString> seqServiceNames;
- ret = createSingleFactory( xMan, L"com.sun.star.comp.ole.OleConverter2",
- ConverterProvider_CreateInstance2, seqServiceNames );
- }
- return ret;
-}
-
-Reference<XSingleServiceFactory> o2u_getConverterProviderVar1(const Reference<XMultiServiceFactory>& xMan,
- const Reference<XRegistryKey>& xKey)
-{
- static Reference<XSingleServiceFactory> ret = NULL;
-
- if (!ret.is())
- {
- if (!xMultiServiceFactory.is()) xMultiServiceFactory = xMan;
-
- Sequence<OUString> seqServiceNames;
- ret = createSingleFactory( xMan, L"com.sun.star.comp.ole.OleConverterVar1",
- ConverterProvider_CreateInstanceVar1, seqServiceNames );
- }
- return ret;
-}
-Reference<XSingleServiceFactory> o2u_getClientProvider(const Reference<XMultiServiceFactory>& xMan,
- const Reference<XRegistryKey>& xKey)
-{
- static Reference<XSingleServiceFactory> ret = NULL;
-
- if (!ret.is())
- {
- if (!xMultiServiceFactory.is()) xMultiServiceFactory = xMan;
- Sequence<OUString> seqServiceNames;
- ret = createSingleFactory( xMan, L"com.sun.star.comp.ole.OleClient",
- OleClient_CreateInstance, seqServiceNames);
- }
-
- return ret;
-}
-
-Reference<XSingleServiceFactory> o2u_getServerProvider(const Reference<XMultiServiceFactory>& xMan,
- const Reference<XRegistryKey>& xKey)
-{
- static Reference<XSingleServiceFactory> ret = NULL;
-
- if (!ret.is())
- {
- if (!xMultiServiceFactory.is()) xMultiServiceFactory = xMan;
- Sequence<OUString> seqServiceNames;
- ret = createOneInstanceFactory( xMan, L"com.sun.star.comp.ole.OleServer",
- OleServer_CreateInstance, seqServiceNames);
- }
-
- return ret;
-}
-// Creator functions --------------------
-
-Reference<XInterface> SAL_CALL ConverterProvider_CreateInstance2( const Reference<XMultiServiceFactory> & xSMgr)
- throw(Exception)
-{
- Reference<XInterface> xService = *new OleConverter_Impl2();
- return xService;
-}
-
-Reference<XInterface> SAL_CALL ConverterProvider_CreateInstanceVar1( const Reference<XMultiServiceFactory> & xSMgr)
- throw(Exception)
-{
- Reference<XInterface> xService = *new OleConverter_Impl2( UNO_OBJECT_WRAPPER_REMOTE_OPT, IUNKNOWN_WRAPPER_IMPL);
- return xService;
-}
-
-Reference<XInterface> SAL_CALL OleClient_CreateInstance( const Reference<XMultiServiceFactory> & xSMgr)
- throw(Exception)
-{
- Reference<XInterface> xService = *new OleClient_Impl();
- return xService;
-}
-
-Reference<XInterface> SAL_CALL OleServer_CreateInstance( const Reference<XMultiServiceFactory> & xSMgr)
- throw (Exception)
-{
- Reference<XInterface > xService = *new OleServer_Impl();
- return xService;
-}
-
-
} // end namespace
diff --git a/extensions/source/ole/servprov.hxx b/extensions/source/ole/servprov.hxx
index 2d8c537446b9..fae406431bb5 100644
--- a/extensions/source/ole/servprov.hxx
+++ b/extensions/source/ole/servprov.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: servprov.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:16:40 $
+ * last change: $Author: jl $ $Date: 2001-06-27 10:56:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -125,7 +125,8 @@ class ProviderOleWrapper_Impl : public IClassFactoryWrapper
{
public:
- ProviderOleWrapper_Impl(const Reference<XSingleServiceFactory>& xSFactory, GUID* pGuid);
+ ProviderOleWrapper_Impl( const Reference<XMultiServiceFactory>& smgr,
+ const Reference<XSingleServiceFactory>& xSFactory, GUID* pGuid);
~ProviderOleWrapper_Impl();
sal_Bool registerClass();
@@ -147,6 +148,7 @@ protected:
GUID m_guid;
DWORD m_factoryHandle;
Reference<XBridgeSupplier2> m_bridgeSupplier;
+ Reference<XMultiServiceFactory> m_smgr;
};
/*****************************************************************************
@@ -166,7 +168,7 @@ class OneInstanceOleWrapper_Impl : public IClassFactoryWrapper
{
public:
- OneInstanceOleWrapper_Impl(const Reference<XInterface>& xInst, GUID* pGuid);
+ OneInstanceOleWrapper_Impl( const Reference<XMultiServiceFactory>& smgr, const Reference<XInterface>& xInst, GUID* pGuid);
~OneInstanceOleWrapper_Impl();
sal_Bool registerClass();
@@ -189,6 +191,7 @@ protected:
GUID m_guid;
DWORD m_factoryHandle;
Reference<XBridgeSupplier2> m_bridgeSupplier;
+ Reference<XMultiServiceFactory> m_smgr;
};
/*****************************************************************************
@@ -213,8 +216,8 @@ class OleConverter_Impl2 : public WeakImplHelper2<XBridgeSupplier2, XInitializat
public UnoConversionUtilities<OleConverter_Impl2>
{
public:
- OleConverter_Impl2();
- OleConverter_Impl2( sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass );
+ OleConverter_Impl2( const Reference<XMultiServiceFactory>& smgr);
+ OleConverter_Impl2( const Reference<XMultiServiceFactory>& smgr, sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass );
virtual ~OleConverter_Impl2();
// XBridgeSupplier2 ---------------------------------------------------
@@ -231,6 +234,8 @@ public:
// Abstract struct UnoConversionUtilities
virtual Reference< XInterface > createUnoWrapperInstance();
virtual Reference< XInterface > createComWrapperInstance();
+protected:
+
};
@@ -247,7 +252,7 @@ class OleClient_Impl : public WeakImplHelper1<XMultiServiceFactory>,
public UnoConversionUtilities<OleClient_Impl>
{
public:
- OleClient_Impl();
+ OleClient_Impl( const Reference<XMultiServiceFactory>& smgr);
~OleClient_Impl();
// XMultiServiceFactory
@@ -262,7 +267,6 @@ public:
OUString getImplementationName();
protected:
-
Reference<XBridgeSupplier2> m_bridgeSupplier;
};
@@ -280,7 +284,7 @@ protected:
class OleServer_Impl : public OWeakObject, XTypeProvider
{
public:
- OleServer_Impl();
+ OleServer_Impl( const Reference<XMultiServiceFactory> &smgr);
~OleServer_Impl();
// XInterface
@@ -299,6 +303,8 @@ protected:
list< IClassFactoryWrapper* > m_wrapperList;
Reference< XBridgeSupplier2 > m_bridgeSupplier;
+
+ Reference<XMultiServiceFactory> m_smgr;
};
} // end namespace
diff --git a/extensions/source/ole/servreg.cxx b/extensions/source/ole/servreg.cxx
index 58d9c72501b9..1560fa097e6d 100644
--- a/extensions/source/ole/servreg.cxx
+++ b/extensions/source/ole/servreg.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: servreg.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:16:40 $
+ * last change: $Author: jl $ $Date: 2001-06-27 10:56:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -58,18 +58,54 @@
*
*
************************************************************************/
-
+#include <rtl/unload.h>
+#include <osl/time.h>
#include "ole2uno.hxx"
-
+#include "servprov.hxx"
#ifndef _RTL_USTRING_
#include <rtl/ustring>
#endif
+#ifndef _CPPUHELPER_FACTORY_HXX_
+#include <cppuhelper/factory.hxx>
+#endif
+using namespace rtl;
+using namespace ole_adapter;
+using namespace cppu;
+namespace ole_adapter
+{
+rtl_StandardModuleCount globalModuleCount= MODULE_COUNT_INIT;
-using namespace rtl;
-using namespace ole_adapter;
+Reference<XInterface> SAL_CALL ConverterProvider_CreateInstance2( const Reference<XMultiServiceFactory> & xSMgr)
+ throw(Exception)
+{
+ Reference<XInterface> xService = *new OleConverter_Impl2( xSMgr);
+ return xService;
+}
+
+Reference<XInterface> SAL_CALL ConverterProvider_CreateInstanceVar1( const Reference<XMultiServiceFactory> & xSMgr)
+ throw(Exception)
+{
+ Reference<XInterface> xService = *new OleConverter_Impl2( xSMgr, UNO_OBJECT_WRAPPER_REMOTE_OPT, IUNKNOWN_WRAPPER_IMPL);
+ return xService;
+}
+
+Reference<XInterface> SAL_CALL OleClient_CreateInstance( const Reference<XMultiServiceFactory> & xSMgr)
+ throw(Exception)
+{
+ Reference<XInterface> xService = *new OleClient_Impl( xSMgr);
+ return xService;
+}
+
+Reference<XInterface> SAL_CALL OleServer_CreateInstance( const Reference<XMultiServiceFactory> & xSMgr)
+ throw (Exception)
+{
+ Reference<XInterface > xService = *new OleServer_Impl(xSMgr);
+ return xService;
+}
+} // end namespace
extern "C" void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
@@ -78,29 +114,34 @@ extern "C" void * SAL_CALL component_getFactory(
OUString aImplName( OUString::createFromAscii( pImplName ) );
Reference< XSingleServiceFactory > xFactory;
+ Sequence<OUString> seqServiceNames;
if (pServiceManager && aImplName.equals( L"com.sun.star.comp.ole.OleConverter2" ))
{
- xFactory= o2u_getConverterProvider2(
- reinterpret_cast< XMultiServiceFactory*>(pServiceManager),
- reinterpret_cast< XRegistryKey*>(pRegistryKey));
+ xFactory= createSingleFactory( reinterpret_cast< XMultiServiceFactory*>(pServiceManager),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.ole.OleConverter2")),
+ ConverterProvider_CreateInstance2, seqServiceNames,
+ &globalModuleCount.modCnt );
}
else if (pServiceManager && aImplName.equals( L"com.sun.star.comp.ole.OleConverterVar1" ))
{
- xFactory= o2u_getConverterProviderVar1(
- reinterpret_cast< XMultiServiceFactory*>(pServiceManager),
- reinterpret_cast< XRegistryKey*>(pRegistryKey));
+ xFactory= createSingleFactory( reinterpret_cast<XMultiServiceFactory*>(pServiceManager),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.ole.OleConverterVar1")),
+ ConverterProvider_CreateInstanceVar1, seqServiceNames,
+ &globalModuleCount.modCnt );
}
else if(pServiceManager && aImplName.equals(L"com.sun.star.comp.ole.OleClient"))
{
- xFactory= o2u_getClientProvider(
- reinterpret_cast< XMultiServiceFactory*>(pServiceManager),
- reinterpret_cast< XRegistryKey*>(pRegistryKey));
+ xFactory= createSingleFactory( reinterpret_cast< XMultiServiceFactory*>(pServiceManager),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.ole.OleClient")),
+ OleClient_CreateInstance, seqServiceNames,
+ &globalModuleCount.modCnt);
}
else if(pServiceManager && aImplName.equals(L"com.sun.star.comp.ole.OleServer"))
{
- xFactory= o2u_getServerProvider(
- reinterpret_cast< XMultiServiceFactory*>(pServiceManager),
- reinterpret_cast< XRegistryKey*>(pRegistryKey));
+ xFactory= createOneInstanceFactory( reinterpret_cast< XMultiServiceFactory*>(pServiceManager),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.ole.OleServer")),
+ OleServer_CreateInstance, seqServiceNames,
+ &globalModuleCount.modCnt);
}
if (xFactory.is())
@@ -152,3 +193,7 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
}
+extern "C" sal_Bool component_canUnload( TimeValue* libUnused)
+{
+ return globalModuleCount.canUnload( &globalModuleCount, libUnused);
+}
diff --git a/extensions/source/ole/unoconversionutilities.hxx b/extensions/source/ole/unoconversionutilities.hxx
index 04396daa762b..ed4eb98fb491 100644
--- a/extensions/source/ole/unoconversionutilities.hxx
+++ b/extensions/source/ole/unoconversionutilities.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoconversionutilities.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: jl $ $Date: 2000-10-24 09:31:28 $
+ * last change: $Author: jl $ $Date: 2001-06-27 10:56:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -101,14 +101,14 @@ template< class >
class UnoConversionUtilities
{
public:
- UnoConversionUtilities(): m_nUnoWrapperClass( INTERFACE_OLE_WRAPPER_IMPL),
- m_nComWrapperClass( IUNKNOWN_WRAPPER_IMPL)
+ UnoConversionUtilities( const Reference<XMultiServiceFactory> & smgr):
+ m_nUnoWrapperClass( INTERFACE_OLE_WRAPPER_IMPL),
+ m_nComWrapperClass( IUNKNOWN_WRAPPER_IMPL),
+ m_smgr( smgr)
{}
- UnoConversionUtilities( sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass )
- : m_nUnoWrapperClass( unoWrapperClass), m_nComWrapperClass( comWrapperClass)
- {}
- UnoConversionUtilities( Reference<XMultiServiceFactory> xFactory, sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass )
- : m_xMultiServiceFactory( xFactory), m_nComWrapperClass( comWrapperClass), m_nUnoWrapperClass( unoWrapperClass)
+
+ UnoConversionUtilities( const Reference<XMultiServiceFactory> & xFactory, sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass )
+ : m_smgr( xFactory), m_nComWrapperClass( comWrapperClass), m_nUnoWrapperClass( unoWrapperClass)
{}
// converts only into oleautomation types, that is there is no VT_I1, VT_UI2, VT_UI4
// a sal_Unicode character is converted into a BSTR
@@ -133,8 +133,6 @@ public:
VARTYPE mapTypeClassToVartype( TypeClass type);
-
-// Reference< XSingleServiceFactory > getInvocationFactory();
Reference< XSingleServiceFactory > getInvocationFactory(const Any& anyObject);
@@ -161,33 +159,23 @@ protected:
sal_uInt8 m_nUnoWrapperClass;
sal_uInt8 m_nComWrapperClass;
- // This factory is set by calling XInitialization::initialize.
- // If this ServiceManager is supplied then it is used to create
- // a remote invocation service, whenever an UNO object is to be converted.
- // This happens when the service com.sun.star.bridge.OleBridgeSupplierVar1 is
- // being used to convert an object. The service is used in the plugin
- // where it converts remote objects ( e.g. the XFrame). Thus the object and
- // the invocation service are on the remote server.
- Reference<XMultiServiceFactory> m_xMultiServiceFactory;
+ // The servicemanager is either a local smgr or remote when the service
+ // com.sun.star.bridge.OleBridgeSupplierVar1 is used. This service can be
+ // created by createInstanceWithArguments where one can supply a service
+ // manager that is to be used.
+ // Local service manager as supplied by the loader when the creator function
+ // of the service is being called.
+ Reference<XMultiServiceFactory> m_smgr;
+ // An explicitly supplied service manager when the service
+ // com.sun.star.bridge.OleBridgeSupplierVar1 is used. That can be a remote
+ // manager.
+ Reference<XMultiServiceFactory> m_smgrRemote;
Reference<XSingleServiceFactory> m_xInvocationFactoryLocal;
Reference<XSingleServiceFactory> m_xInvocationFactoryRemote;
};
-//template<class T>
-//Reference< XSingleServiceFactory > UnoConversionUtilities<T>::getInvocationFactory()
-//{
-// if( m_xInvocationFactory.is() )
-// return Reference< XSingleServiceFactory >( m_xInvocationFactory );
-//
-// if( m_xMultiServiceFactory.is() )
-// m_xInvocationFactory= Reference<XSingleServiceFactory >( m_xMultiServiceFactory->createInstance( INVOCATION_SERVICE), UNO_QUERY);
-// else
-// m_xInvocationFactory= Reference<XSingleServiceFactory>( o2u_getMultiServiceFactory()->createInstance(INVOCATION_SERVICE ), UNO_QUERY);
-//
-// return m_xInvocationFactory;
-//}
// Gets the invocation factory depending on the Type in the Any.
// The factory can be created by a local or remote multi service factory.
@@ -200,20 +188,20 @@ template<class T>
Reference< XSingleServiceFactory > UnoConversionUtilities<T>::getInvocationFactory(const Any& anyObject)
{
Reference< XSingleServiceFactory > retVal;
-
+ OGuard guard( globalWrapperMutex);
if( anyObject.getValueTypeClass() != TypeClass_STRUCT &&
- m_xMultiServiceFactory.is() )
+ m_smgrRemote.is() )
{
if( ! m_xInvocationFactoryRemote.is() )
m_xInvocationFactoryRemote= Reference<XSingleServiceFactory>(
- m_xMultiServiceFactory->createInstance( INVOCATION_SERVICE), UNO_QUERY);
+ m_smgrRemote->createInstance( INVOCATION_SERVICE), UNO_QUERY);
retVal= m_xInvocationFactoryRemote;
}
else
{
if( ! m_xInvocationFactoryLocal.is() )
m_xInvocationFactoryLocal= Reference<XSingleServiceFactory>(
- o2u_getMultiServiceFactory()->createInstance(INVOCATION_SERVICE ), UNO_QUERY);
+ m_smgr->createInstance(INVOCATION_SERVICE ), UNO_QUERY);
retVal= m_xInvocationFactoryLocal;
}
return retVal;
@@ -271,8 +259,6 @@ sal_Bool UnoConversionUtilities<T>::variantToAny2( const VARIANTARG* pArg, Any&
}
break;
case TypeClass_INTERFACE: // could also be an IUnknown
- // if( SUCCEEDED( hr= VariantChangeType( &var, &var, 0, VT_DISPATCH)))
- // retVal= variantToAny(&var, rAny);
{
CComVariant varUnk;
if( SUCCEEDED( hr= VariantChangeType( &varUnk, &var, 0, VT_UNKNOWN)))
@@ -550,10 +536,6 @@ sal_Bool UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& r
case TypeClass_CHAR:// char
{
// Because VT_UI2 does not conform to oleautomation we convert into VT_I2 instead
-// V_VT(pVariant) = VT_BSTR;
-// sal_uInt16 _c = *(sal_uInt16*)rAny.getValue();
-// pVariant->bstrVal= SysAllocStringLen( &_c, 1);
-// ret= pVariant->bstrVal ? sal_True : sal_False;
V_VT(pVariant) = VT_I2;
V_I2(pVariant) = *(sal_Int16*)rAny.getValue();
ret = sal_True;
@@ -591,10 +573,7 @@ sal_Bool UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& r
ret = sal_True;
break;
case TypeClass_HYPER: // INT64
- // V_VT(pVariant) = VT_CY;
- // V_CY(pVariant).Lo = rAny.getINT64().p.loPart;
- // V_CY(pVariant).Lo = rAny.getINT64().p.hiPart;
- // ret = sal_True;
+
break;
//case TypeClass_UNSIGNED_OCTET: // ??? not implemented
// V_VT(pVariant) = VT_UI1;
@@ -612,9 +591,6 @@ sal_Bool UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& r
ret = sal_True;
break;
case TypeClass_UNSIGNED_HYPER: // UINT64
- // V_VT(pVariant) = VT_UI8;
- // V_UI8(pVariant) = rAny.getUINT64();
- // ret = sal_True;
break;
// case TypeClass_UNSIGNED_INT: // int not implemented
// break;
@@ -1431,15 +1407,15 @@ Any UnoConversionUtilities<T>::createOleObjectWrapper(IUnknown* pUnknown, const
else
{
Reference< XInterface> xIntAdapterFac;
- if( m_xMultiServiceFactory.is())
- {
- xIntAdapterFac= m_xMultiServiceFactory->createInstance( INTERFACE_ADAPTER_FACTORY);
+// if( m_smgr.is())
+// {
+ xIntAdapterFac= m_smgr->createInstance( INTERFACE_ADAPTER_FACTORY);
- }
- else
- {
- xIntAdapterFac= o2u_getMultiServiceFactory()->createInstance( INTERFACE_ADAPTER_FACTORY);
- }
+// }
+// else
+// {
+// xIntAdapterFac= o2u_getMultiServiceFactory()->createInstance( INTERFACE_ADAPTER_FACTORY);
+// }
// We create an adapter object that does not only implement the required type but also
// all types that the COM object pretends to implement. An COM object must therefore
@@ -1629,7 +1605,8 @@ sal_Bool UnoConversionUtilities<T>::dispatchExObject2Sequence( const VARIANTARG*
// put them into the passed in sequence
for( sal_Int32 i= 0; i< length; i++)
{
- OLECHAR* sindex = (sal_Unicode*)(const sal_Unicode*)OUString::valueOf( i);
+ OUString ousIndex=OUString::valueOf( i);
+ OLECHAR* sindex = (OLECHAR*)ousIndex.getStr();
if( FAILED( hr= pdispEx->GetIDsOfNames(IID_NULL, &sindex , 1, LOCALE_USER_DEFAULT, &dispid)))
{
diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx
index fbb73441d66a..e1fa6eea483d 100644
--- a/extensions/source/ole/unoobjw.cxx
+++ b/extensions/source/ole/unoobjw.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoobjw.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: jl $ $Date: 2000-10-26 08:57:58 $
+ * last change: $Author: jl $ $Date: 2001-06-27 10:56:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -136,10 +136,6 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::bridge::ModelDependent;
using namespace com::sun::star::reflection;
-//#define INVOCATION_SERVICE L"com.sun.star.script.Invocation"
-//#define JSCRIPT_VALUE_FUNC L"_GetValueObject"
-//#define DISPID_JSCRIPT_VALUE_FUNC -1000l
-
#if _MSC_VER < 1200
@@ -161,7 +157,6 @@ static HRESULT mapCannotConvertException( CannotConvertException e, unsigned int
*****************************************************************************/
OMutex globalWrapperMutex;
-//static WrapperMap globalWrapperMap;
/*****************************************************************************
@@ -203,19 +198,6 @@ STDMETHODIMP InterfaceOleWrapper_Impl::QueryInterface(REFIID riid, LPVOID FAR *
}
else
ret= E_NOINTERFACE;
-// else if (IsEqualIID(riid, IID_IDispatchEx))
-// {
-// AddRef();
-// *ppv = (IDispatchEx*) this;
-// return NOERROR;
-// }
-// else if (IsEqualIID(riid, IID_IConnectionPointContainer))
-// {
-// AddRef();
-// *ppv = (IConnectionPointContainer*) this;
-// return NOERROR;
-// }
-//
return ret;
}
@@ -623,7 +605,7 @@ Any SAL_CALL InterfaceOleWrapper_Impl::createBridge(const Any& modelDepObject,
Reference<XInterface> xInt;
if( modelDepObject >>= xInt )
{
- if( xInt == Reference<XInterface>( static_cast<XWeak*>( this)), UNO_QUERY)
+ if( xInt == Reference<XInterface>( static_cast<XWeak*>( this), UNO_QUERY))
{
VARIANT *pVar= (VARIANT*)CoTaskMemAlloc( sizeof( VARIANT));
if( pVar)
@@ -680,14 +662,14 @@ void SAL_CALL InterfaceOleWrapper_Impl::initialize( const Sequence< Any >& aArgu
Reference< XInterface > InterfaceOleWrapper_Impl::createUnoWrapperInstance()
{
Reference<XWeak> xWeak= static_cast<XWeak*>( new InterfaceOleWrapper_Impl(
- m_xMultiServiceFactory, m_nUnoWrapperClass, m_nComWrapperClass));
+ m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
return Reference<XInterface>( xWeak, UNO_QUERY);
}
Reference<XInterface> InterfaceOleWrapper_Impl::createComWrapperInstance()
{
Reference<XWeak> xWeak= static_cast<XWeak*>( new IUnknownWrapper_Impl(
- m_xMultiServiceFactory, m_nUnoWrapperClass, m_nComWrapperClass));
+ m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
return Reference<XInterface>( xWeak, UNO_QUERY);
}
@@ -1171,36 +1153,33 @@ HRESULT InterfaceOleWrapper_Impl::InvokeGeneral( DISPID dispidMember, unsigned s
{
bHandled= sal_True;
sal_Bool bStruct= sal_False;
- Reference<XMultiServiceFactory> fac= o2u_getMultiServiceFactory();
- if( fac.is() )
+
+
+ Reference<XInterface> xIntCore= m_smgr->createInstance( OUString::createFromAscii("com.sun.star.reflection.CoreReflection"));
+ Reference<XIdlReflection> xRefl( xIntCore, UNO_QUERY);
+ if( xRefl.is() )
{
- Reference<XInterface> xIntCore= fac->createInstance( OUString::createFromAscii("com.sun.star.reflection.CoreReflection"));
- Reference<XIdlReflection> xRefl( xIntCore, UNO_QUERY);
- if( xRefl.is() )
+ // the first parameter is in DISPPARAMS rgvargs contains the name of the struct.
+ CComVariant arg;
+ if( pdispparams->cArgs == 1 && SUCCEEDED( arg.ChangeType( VT_BSTR, &pdispparams->rgvarg[0])) )
{
- // the first parameter is in DISPPARAMS rgvargs contains the name of the struct.
- CComVariant arg;
- if( pdispparams->cArgs == 1 && SUCCEEDED( arg.ChangeType( VT_BSTR, &pdispparams->rgvarg[0])) )
+ Reference<XIdlClass> classStruct= xRefl->forName( arg.bstrVal);
+ if( classStruct.is())
{
- Reference<XIdlClass> classStruct= xRefl->forName( arg.bstrVal);
- if( classStruct.is())
+ Any anyStruct;
+ classStruct->createObject( anyStruct);
+ CComVariant var;
+ if( anyToVariant( &var, anyStruct ))
{
- Any anyStruct;
- classStruct->createObject( anyStruct);
- CComVariant var;
- if( anyToVariant( &var, anyStruct ))
+ if( var.vt == VT_DISPATCH)
{
- if( var.vt == VT_DISPATCH)
- {
- VariantCopy( pvarResult, & var);
- bStruct= sal_True;
- }
+ VariantCopy( pvarResult, & var);
+ bStruct= sal_True;
}
-
}
+
}
}
-
}
ret= bStruct == sal_True ? S_OK : DISP_E_EXCEPTION;
}
@@ -1306,7 +1285,7 @@ UnoObjectWrapperRemoteOpt::~UnoObjectWrapperRemoteOpt()
Reference< XInterface > UnoObjectWrapperRemoteOpt::createUnoWrapperInstance()
{
Reference<XWeak> xWeak= static_cast<XWeak*>( new UnoObjectWrapperRemoteOpt(
- m_xMultiServiceFactory, m_nUnoWrapperClass, m_nComWrapperClass));
+ m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
return Reference<XInterface>( xWeak, UNO_QUERY);
}