Drop _Impl class name suffix where pointless
I.e. where there is no other LibreOffice, or system, or 3rd-party library thing with just the un-suffixed name that they would be a pimpl of, etc. Why bother calling something InterfaceOleWrapper_Impl when there is nothing that would be called InterfaceOleWrapper? It just makes the code seem more complicated and harder to read. An "implementation" of something is what everything that is not fully abstract *is*. We don't suffix the name of every non-abstract class with _Impl elsewhere either. Also drop two unused structs. Change-Id: I2755e6da78d8e4ded5291688dc90510b5f8b498b Reviewed-on: https://gerrit.libreoffice.org/54411 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
This commit is contained in:
@@ -77,16 +77,16 @@ std::unordered_map<sal_uIntPtr,sal_uIntPtr> WrapperToAdapterMap;
|
|||||||
|
|
||||||
std::unordered_map<sal_uIntPtr, WeakReference<XInterface> > ComPtrToWrapperMap;
|
std::unordered_map<sal_uIntPtr, WeakReference<XInterface> > ComPtrToWrapperMap;
|
||||||
|
|
||||||
IUnknownWrapper_Impl::IUnknownWrapper_Impl( Reference<XMultiServiceFactory> const & xFactory,
|
IUnknownWrapper::IUnknownWrapper( Reference<XMultiServiceFactory> const & xFactory,
|
||||||
sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass):
|
sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass):
|
||||||
UnoConversionUtilities<IUnknownWrapper_Impl>( xFactory, unoWrapperClass, comWrapperClass),
|
UnoConversionUtilities<IUnknownWrapper>( xFactory, unoWrapperClass, comWrapperClass),
|
||||||
m_pxIdlClass( nullptr), m_eJScript( JScriptUndefined),
|
m_pxIdlClass( nullptr), m_eJScript( JScriptUndefined),
|
||||||
m_bComTlbIndexInit(false), m_bHasDfltMethod(false), m_bHasDfltProperty(false)
|
m_bComTlbIndexInit(false), m_bHasDfltMethod(false), m_bHasDfltProperty(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
IUnknownWrapper_Impl::~IUnknownWrapper_Impl()
|
IUnknownWrapper::~IUnknownWrapper()
|
||||||
{
|
{
|
||||||
o2u_attachCurrentThread();
|
o2u_attachCurrentThread();
|
||||||
MutexGuard guard(getBridgeMutex());
|
MutexGuard guard(getBridgeMutex());
|
||||||
@@ -112,7 +112,7 @@ IUnknownWrapper_Impl::~IUnknownWrapper_Impl()
|
|||||||
ComPtrToWrapperMap.erase(it_c);
|
ComPtrToWrapperMap.erase(it_c);
|
||||||
}
|
}
|
||||||
|
|
||||||
Any IUnknownWrapper_Impl::queryInterface(const Type& t)
|
Any IUnknownWrapper::queryInterface(const Type& t)
|
||||||
{
|
{
|
||||||
if (t == cppu::UnoType<XDefaultMethod>::get() && !m_bHasDfltMethod )
|
if (t == cppu::UnoType<XDefaultMethod>::get() && !m_bHasDfltMethod )
|
||||||
return Any();
|
return Any();
|
||||||
@@ -130,14 +130,14 @@ Any IUnknownWrapper_Impl::queryInterface(const Type& t)
|
|||||||
XInitialization, XAutomationObject, XDefaultProperty, XDefaultMethod, XDirectInvocation, XAutomationInvocation >::queryInterface(t);
|
XInitialization, XAutomationObject, XDefaultProperty, XDefaultMethod, XDirectInvocation, XAutomationInvocation >::queryInterface(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference<XIntrospectionAccess> SAL_CALL IUnknownWrapper_Impl::getIntrospection()
|
Reference<XIntrospectionAccess> SAL_CALL IUnknownWrapper::getIntrospection()
|
||||||
{
|
{
|
||||||
Reference<XIntrospectionAccess> ret;
|
Reference<XIntrospectionAccess> ret;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Any SAL_CALL IUnknownWrapper_Impl::invokeGetProperty( const OUString& aPropertyName, const Sequence< Any >& aParams, Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam )
|
Any SAL_CALL IUnknownWrapper::invokeGetProperty( const OUString& aPropertyName, const Sequence< Any >& aParams, Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam )
|
||||||
{
|
{
|
||||||
Any aResult;
|
Any aResult;
|
||||||
try
|
try
|
||||||
@@ -159,13 +159,13 @@ Any SAL_CALL IUnknownWrapper_Impl::invokeGetProperty( const OUString& aPropertyN
|
|||||||
catch ( const Exception& e )
|
catch ( const Exception& e )
|
||||||
{
|
{
|
||||||
throw RuntimeException("[automation bridge] unexpected exception in "
|
throw RuntimeException("[automation bridge] unexpected exception in "
|
||||||
"IUnknownWrapper_Impl::invokeGetProperty ! Message : \n" +
|
"IUnknownWrapper::invokeGetProperty ! Message : \n" +
|
||||||
e.Message);
|
e.Message);
|
||||||
}
|
}
|
||||||
return aResult;
|
return aResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
Any SAL_CALL IUnknownWrapper_Impl::invokePutProperty( const OUString& aPropertyName, const Sequence< Any >& aParams, Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam )
|
Any SAL_CALL IUnknownWrapper::invokePutProperty( const OUString& aPropertyName, const Sequence< Any >& aParams, Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam )
|
||||||
{
|
{
|
||||||
Any aResult;
|
Any aResult;
|
||||||
try
|
try
|
||||||
@@ -187,14 +187,14 @@ Any SAL_CALL IUnknownWrapper_Impl::invokePutProperty( const OUString& aPropertyN
|
|||||||
catch ( const Exception& e )
|
catch ( const Exception& e )
|
||||||
{
|
{
|
||||||
throw RuntimeException("[automation bridge] unexpected exception in "
|
throw RuntimeException("[automation bridge] unexpected exception in "
|
||||||
"IUnknownWrapper_Impl::invokePutProperty ! Message : \n" +
|
"IUnknownWrapper::invokePutProperty ! Message : \n" +
|
||||||
e.Message);
|
e.Message);
|
||||||
}
|
}
|
||||||
return aResult;
|
return aResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Any SAL_CALL IUnknownWrapper_Impl::invoke( const OUString& aFunctionName,
|
Any SAL_CALL IUnknownWrapper::invoke( const OUString& aFunctionName,
|
||||||
const Sequence< Any >& aParams, Sequence< sal_Int16 >& aOutParamIndex,
|
const Sequence< Any >& aParams, Sequence< sal_Int16 >& aOutParamIndex,
|
||||||
Sequence< Any >& aOutParam )
|
Sequence< Any >& aOutParam )
|
||||||
{
|
{
|
||||||
@@ -242,19 +242,19 @@ Any SAL_CALL IUnknownWrapper_Impl::invoke( const OUString& aFunctionName,
|
|||||||
catch (const Exception & e)
|
catch (const Exception & e)
|
||||||
{
|
{
|
||||||
throw RuntimeException("[automation bridge] unexpected exception in "
|
throw RuntimeException("[automation bridge] unexpected exception in "
|
||||||
"IUnknownWrapper_Impl::invoke ! Message : \n" +
|
"IUnknownWrapper::invoke ! Message : \n" +
|
||||||
e.Message);
|
e.Message);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
throw RuntimeException("[automation bridge] unexpected exception in "
|
throw RuntimeException("[automation bridge] unexpected exception in "
|
||||||
"IUnknownWrapper_Impl::Invoke !");
|
"IUnknownWrapper::Invoke !");
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SAL_CALL IUnknownWrapper_Impl::setValue( const OUString& aPropertyName,
|
void SAL_CALL IUnknownWrapper::setValue( const OUString& aPropertyName,
|
||||||
const Any& aValue )
|
const Any& aValue )
|
||||||
{
|
{
|
||||||
if ( ! m_spDispatch )
|
if ( ! m_spDispatch )
|
||||||
@@ -409,7 +409,7 @@ void SAL_CALL IUnknownWrapper_Impl::setValue( const OUString& aPropertyName,
|
|||||||
catch (const Exception & e)
|
catch (const Exception & e)
|
||||||
{
|
{
|
||||||
throw RuntimeException("[automation bridge] unexpected exception in "
|
throw RuntimeException("[automation bridge] unexpected exception in "
|
||||||
"IUnknownWrapper_Impl::setValue ! Message : \n" +
|
"IUnknownWrapper::setValue ! Message : \n" +
|
||||||
e.Message);
|
e.Message);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -417,11 +417,11 @@ void SAL_CALL IUnknownWrapper_Impl::setValue( const OUString& aPropertyName,
|
|||||||
{
|
{
|
||||||
throw RuntimeException(
|
throw RuntimeException(
|
||||||
"[automation bridge] unexpected exception in "
|
"[automation bridge] unexpected exception in "
|
||||||
"IUnknownWrapper_Impl::setValue !");
|
"IUnknownWrapper::setValue !");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Any SAL_CALL IUnknownWrapper_Impl::getValue( const OUString& aPropertyName )
|
Any SAL_CALL IUnknownWrapper::getValue( const OUString& aPropertyName )
|
||||||
{
|
{
|
||||||
if ( ! m_spDispatch )
|
if ( ! m_spDispatch )
|
||||||
{
|
{
|
||||||
@@ -551,19 +551,19 @@ Any SAL_CALL IUnknownWrapper_Impl::getValue( const OUString& aPropertyName )
|
|||||||
catch (const Exception & e)
|
catch (const Exception & e)
|
||||||
{
|
{
|
||||||
throw RuntimeException("[automation bridge] unexpected exception in "
|
throw RuntimeException("[automation bridge] unexpected exception in "
|
||||||
"IUnknownWrapper_Impl::getValue ! Message : \n" +
|
"IUnknownWrapper::getValue ! Message : \n" +
|
||||||
e.Message);
|
e.Message);
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
throw RuntimeException(
|
throw RuntimeException(
|
||||||
"[automation bridge] unexpected exception in "
|
"[automation bridge] unexpected exception in "
|
||||||
"IUnknownWrapper_Impl::getValue !");
|
"IUnknownWrapper::getValue !");
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool SAL_CALL IUnknownWrapper_Impl::hasMethod( const OUString& aName )
|
sal_Bool SAL_CALL IUnknownWrapper::hasMethod( const OUString& aName )
|
||||||
{
|
{
|
||||||
if ( ! m_spDispatch )
|
if ( ! m_spDispatch )
|
||||||
{
|
{
|
||||||
@@ -600,18 +600,18 @@ sal_Bool SAL_CALL IUnknownWrapper_Impl::hasMethod( const OUString& aName )
|
|||||||
catch (const Exception & e)
|
catch (const Exception & e)
|
||||||
{
|
{
|
||||||
throw RuntimeException("[automation bridge] unexpected exception in "
|
throw RuntimeException("[automation bridge] unexpected exception in "
|
||||||
"IUnknownWrapper_Impl::hasMethod ! Message : \n" +
|
"IUnknownWrapper::hasMethod ! Message : \n" +
|
||||||
e.Message);
|
e.Message);
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
throw RuntimeException("[automation bridge] unexpected exception in "
|
throw RuntimeException("[automation bridge] unexpected exception in "
|
||||||
"IUnknownWrapper_Impl::hasMethod !");
|
"IUnknownWrapper::hasMethod !");
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool SAL_CALL IUnknownWrapper_Impl::hasProperty( const OUString& aName )
|
sal_Bool SAL_CALL IUnknownWrapper::hasProperty( const OUString& aName )
|
||||||
{
|
{
|
||||||
if ( ! m_spDispatch )
|
if ( ! m_spDispatch )
|
||||||
{
|
{
|
||||||
@@ -649,19 +649,19 @@ sal_Bool SAL_CALL IUnknownWrapper_Impl::hasProperty( const OUString& aName )
|
|||||||
catch (const Exception & e)
|
catch (const Exception & e)
|
||||||
{
|
{
|
||||||
throw RuntimeException("[automation bridge] unexpected exception in "
|
throw RuntimeException("[automation bridge] unexpected exception in "
|
||||||
"IUnknownWrapper_Impl::hasProperty ! Message : \n" +
|
"IUnknownWrapper::hasProperty ! Message : \n" +
|
||||||
e.Message);
|
e.Message);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
throw RuntimeException("[automation bridge] unexpected exception in "
|
throw RuntimeException("[automation bridge] unexpected exception in "
|
||||||
"IUnknownWrapper_Impl::hasProperty !");
|
"IUnknownWrapper::hasProperty !");
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Any SAL_CALL IUnknownWrapper_Impl::createBridge( const Any& modelDepObject,
|
Any SAL_CALL IUnknownWrapper::createBridge( const Any& modelDepObject,
|
||||||
const Sequence< sal_Int8 >& /*aProcessId*/, sal_Int16 sourceModelType,
|
const Sequence< sal_Int8 >& /*aProcessId*/, sal_Int16 sourceModelType,
|
||||||
sal_Int16 destModelType )
|
sal_Int16 destModelType )
|
||||||
{
|
{
|
||||||
@@ -707,10 +707,10 @@ Any SAL_CALL IUnknownWrapper_Impl::createBridge( const Any& modelDepObject,
|
|||||||
@exception InvocationTargetException
|
@exception InvocationTargetException
|
||||||
@RuntimeException
|
@RuntimeException
|
||||||
*/
|
*/
|
||||||
Any IUnknownWrapper_Impl::invokeWithDispIdUnoTlb(const OUString& sFunctionName,
|
Any IUnknownWrapper::invokeWithDispIdUnoTlb(const OUString& sFunctionName,
|
||||||
const Sequence< Any >& Params,
|
const Sequence< Any >& Params,
|
||||||
Sequence< sal_Int16 >& OutParamIndex,
|
Sequence< sal_Int16 >& OutParamIndex,
|
||||||
Sequence< Any >& OutParam)
|
Sequence< Any >& OutParam)
|
||||||
{
|
{
|
||||||
Any ret;
|
Any ret;
|
||||||
HRESULT hr= S_OK;
|
HRESULT hr= S_OK;
|
||||||
@@ -928,7 +928,7 @@ Any IUnknownWrapper_Impl::invokeWithDispIdUnoTlb(const OUString& sFunctionName,
|
|||||||
if( !SUCCEEDED( CComObject<JScriptOutParam>::CreateInstance( &pParamObject)))
|
if( !SUCCEEDED( CComObject<JScriptOutParam>::CreateInstance( &pParamObject)))
|
||||||
{
|
{
|
||||||
throw BridgeRuntimeError(
|
throw BridgeRuntimeError(
|
||||||
"[automation bridge]IUnknownWrapper_Impl::"
|
"[automation bridge]IUnknownWrapper::"
|
||||||
"invokeWithDispIdUnoTlb\n"
|
"invokeWithDispIdUnoTlb\n"
|
||||||
"Could not create out parameter at index: " +
|
"Could not create out parameter at index: " +
|
||||||
OUString::number(static_cast<sal_Int32>(i)));
|
OUString::number(static_cast<sal_Int32>(i)));
|
||||||
@@ -948,7 +948,7 @@ Any IUnknownWrapper_Impl::invokeWithDispIdUnoTlb(const OUString& sFunctionName,
|
|||||||
CComDispatchDriver dispDriver( pDisp);
|
CComDispatchDriver dispDriver( pDisp);
|
||||||
if(FAILED( dispDriver.PutPropertyByName( L"0", &varParam)))
|
if(FAILED( dispDriver.PutPropertyByName( L"0", &varParam)))
|
||||||
throw BridgeRuntimeError(
|
throw BridgeRuntimeError(
|
||||||
"[automation bridge]IUnknownWrapper_Impl::"
|
"[automation bridge]IUnknownWrapper::"
|
||||||
"invokeWithDispIdUnoTlb\n"
|
"invokeWithDispIdUnoTlb\n"
|
||||||
"Could not set property \"0\" for the in/out "
|
"Could not set property \"0\" for the in/out "
|
||||||
"param!");
|
"param!");
|
||||||
@@ -1071,14 +1071,14 @@ Any IUnknownWrapper_Impl::invokeWithDispIdUnoTlb(const OUString& sFunctionName,
|
|||||||
catch (IllegalArgumentException & e)
|
catch (IllegalArgumentException & e)
|
||||||
{
|
{
|
||||||
e.Message =
|
e.Message =
|
||||||
"[automation bridge]IUnknownWrapper_Impl::invokeWithDispIdUnoTlb\n"
|
"[automation bridge]IUnknownWrapper::invokeWithDispIdUnoTlb\n"
|
||||||
"Could not convert return value! \n Message: \n" + e.Message;
|
"Could not convert return value! \n Message: \n" + e.Message;
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
catch (CannotConvertException & e)
|
catch (CannotConvertException & e)
|
||||||
{
|
{
|
||||||
e.Message =
|
e.Message =
|
||||||
"[automation bridge]IUnknownWrapper_Impl::invokeWithDispIdUnoTlb\n"
|
"[automation bridge]IUnknownWrapper::invokeWithDispIdUnoTlb\n"
|
||||||
"Could not convert return value! \n Message: \n" + e.Message;
|
"Could not convert return value! \n Message: \n" + e.Message;
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
@@ -1141,7 +1141,7 @@ Any IUnknownWrapper_Impl::invokeWithDispIdUnoTlb(const OUString& sFunctionName,
|
|||||||
|
|
||||||
|
|
||||||
// XInitialization
|
// XInitialization
|
||||||
void SAL_CALL IUnknownWrapper_Impl::initialize( const Sequence< Any >& aArguments )
|
void SAL_CALL IUnknownWrapper::initialize( const Sequence< Any >& aArguments )
|
||||||
{
|
{
|
||||||
// 1.parameter is IUnknown
|
// 1.parameter is IUnknown
|
||||||
// 2.parameter is a boolean which indicates if the COM pointer was a IUnknown or IDispatch
|
// 2.parameter is a boolean which indicates if the COM pointer was a IUnknown or IDispatch
|
||||||
@@ -1187,7 +1187,7 @@ void SAL_CALL IUnknownWrapper_Impl::initialize( const Sequence< Any >& aArgument
|
|||||||
{
|
{
|
||||||
getFuncDesc( usName, &aDescGet );
|
getFuncDesc( usName, &aDescGet );
|
||||||
if ( !aDescGet )
|
if ( !aDescGet )
|
||||||
throw BridgeRuntimeError( "[automation bridge]IUnknownWrapper_Impl::initialize() Failed to get Function or Property desc. for " + usName );
|
throw BridgeRuntimeError( "[automation bridge]IUnknownWrapper::initialize() Failed to get Function or Property desc. for " + usName );
|
||||||
}
|
}
|
||||||
// now for some funny heuristics to make basic understand what to do
|
// now for some funny heuristics to make basic understand what to do
|
||||||
// a single aDescGet ( that doesn't take any params ) would be
|
// a single aDescGet ( that doesn't take any params ) would be
|
||||||
@@ -1212,14 +1212,14 @@ void SAL_CALL IUnknownWrapper_Impl::initialize( const Sequence< Any >& aArgument
|
|||||||
catch( const Exception& e )
|
catch( const Exception& e )
|
||||||
{
|
{
|
||||||
throw RuntimeException(
|
throw RuntimeException(
|
||||||
"[automation bridge] unexpected exception in IUnknownWrapper_Impl::initialize() error message: \n" + e.Message );
|
"[automation bridge] unexpected exception in IUnknownWrapper::initialize() error message: \n" + e.Message );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// XDirectInvocation
|
// XDirectInvocation
|
||||||
uno::Any SAL_CALL IUnknownWrapper_Impl::directInvoke( const OUString& aName, const uno::Sequence< uno::Any >& aParams )
|
uno::Any SAL_CALL IUnknownWrapper::directInvoke( const OUString& aName, const uno::Sequence< uno::Any >& aParams )
|
||||||
{
|
{
|
||||||
Any aResult;
|
Any aResult;
|
||||||
|
|
||||||
@@ -1464,7 +1464,7 @@ uno::Any SAL_CALL IUnknownWrapper_Impl::directInvoke( const OUString& aName, con
|
|||||||
return aResult;
|
return aResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool SAL_CALL IUnknownWrapper_Impl::hasMember( const OUString& aName )
|
sal_Bool SAL_CALL IUnknownWrapper::hasMember( const OUString& aName )
|
||||||
{
|
{
|
||||||
if ( ! m_spDispatch )
|
if ( ! m_spDispatch )
|
||||||
{
|
{
|
||||||
@@ -1479,11 +1479,11 @@ sal_Bool SAL_CALL IUnknownWrapper_Impl::hasMember( const OUString& aName )
|
|||||||
|
|
||||||
|
|
||||||
// UnoConversionUtilities --------------------------------------------------------------------------------
|
// UnoConversionUtilities --------------------------------------------------------------------------------
|
||||||
Reference< XInterface > IUnknownWrapper_Impl::createUnoWrapperInstance()
|
Reference< XInterface > IUnknownWrapper::createUnoWrapperInstance()
|
||||||
{
|
{
|
||||||
if( m_nUnoWrapperClass == INTERFACE_OLE_WRAPPER_IMPL)
|
if( m_nUnoWrapperClass == INTERFACE_OLE_WRAPPER_IMPL)
|
||||||
{
|
{
|
||||||
Reference<XWeak> xWeak= static_cast<XWeak*>( new InterfaceOleWrapper_Impl(
|
Reference<XWeak> xWeak= static_cast<XWeak*>( new InterfaceOleWrapper(
|
||||||
m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
|
m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
|
||||||
return Reference<XInterface>( xWeak, UNO_QUERY);
|
return Reference<XInterface>( xWeak, UNO_QUERY);
|
||||||
}
|
}
|
||||||
@@ -1496,15 +1496,15 @@ Reference< XInterface > IUnknownWrapper_Impl::createUnoWrapperInstance()
|
|||||||
else
|
else
|
||||||
return Reference<XInterface>();
|
return Reference<XInterface>();
|
||||||
}
|
}
|
||||||
Reference<XInterface> IUnknownWrapper_Impl::createComWrapperInstance()
|
Reference<XInterface> IUnknownWrapper::createComWrapperInstance()
|
||||||
{
|
{
|
||||||
Reference<XWeak> xWeak= static_cast<XWeak*>( new IUnknownWrapper_Impl(
|
Reference<XWeak> xWeak= static_cast<XWeak*>( new IUnknownWrapper(
|
||||||
m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
|
m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
|
||||||
return Reference<XInterface>( xWeak, UNO_QUERY);
|
return Reference<XInterface>( xWeak, UNO_QUERY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void IUnknownWrapper_Impl::getMethodInfo(const OUString& sName, TypeDescription& methodInfo)
|
void IUnknownWrapper::getMethodInfo(const OUString& sName, TypeDescription& methodInfo)
|
||||||
{
|
{
|
||||||
TypeDescription desc= getInterfaceMemberDescOfCurrentCall(sName);
|
TypeDescription desc= getInterfaceMemberDescOfCurrentCall(sName);
|
||||||
if( desc.is())
|
if( desc.is())
|
||||||
@@ -1515,7 +1515,7 @@ void IUnknownWrapper_Impl::getMethodInfo(const OUString& sName, TypeDescription&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IUnknownWrapper_Impl::getAttributeInfo(const OUString& sName, TypeDescription& attributeInfo)
|
void IUnknownWrapper::getAttributeInfo(const OUString& sName, TypeDescription& attributeInfo)
|
||||||
{
|
{
|
||||||
TypeDescription desc= getInterfaceMemberDescOfCurrentCall(sName);
|
TypeDescription desc= getInterfaceMemberDescOfCurrentCall(sName);
|
||||||
if( desc.is())
|
if( desc.is())
|
||||||
@@ -1527,7 +1527,7 @@ void IUnknownWrapper_Impl::getAttributeInfo(const OUString& sName, TypeDescripti
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TypeDescription IUnknownWrapper_Impl::getInterfaceMemberDescOfCurrentCall(const OUString& sName)
|
TypeDescription IUnknownWrapper::getInterfaceMemberDescOfCurrentCall(const OUString& sName)
|
||||||
{
|
{
|
||||||
TypeDescription ret;
|
TypeDescription ret;
|
||||||
|
|
||||||
@@ -1568,7 +1568,7 @@ TypeDescription IUnknownWrapper_Impl::getInterfaceMemberDescOfCurrentCall(const
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IUnknownWrapper_Impl::isJScriptObject()
|
bool IUnknownWrapper::isJScriptObject()
|
||||||
{
|
{
|
||||||
if( m_eJScript == JScriptUndefined)
|
if( m_eJScript == JScriptUndefined)
|
||||||
{
|
{
|
||||||
@@ -1606,10 +1606,10 @@ bool IUnknownWrapper_Impl::isJScriptObject()
|
|||||||
@RuntimeException
|
@RuntimeException
|
||||||
@BridgeRuntimeError
|
@BridgeRuntimeError
|
||||||
*/
|
*/
|
||||||
Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(const OUString& sFuncName,
|
Any IUnknownWrapper::invokeWithDispIdComTlb(const OUString& sFuncName,
|
||||||
const Sequence< Any >& Params,
|
const Sequence< Any >& Params,
|
||||||
Sequence< sal_Int16 >& OutParamIndex,
|
Sequence< sal_Int16 >& OutParamIndex,
|
||||||
Sequence< Any >& OutParam)
|
Sequence< Any >& OutParam)
|
||||||
{
|
{
|
||||||
// Get type info for the call. It can be a method call or property put or
|
// Get type info for the call. It can be a method call or property put or
|
||||||
// property get operation.
|
// property get operation.
|
||||||
@@ -1618,11 +1618,11 @@ Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(const OUString& sFuncName,
|
|||||||
return invokeWithDispIdComTlb( aFuncDesc, sFuncName, Params, OutParamIndex, OutParam );
|
return invokeWithDispIdComTlb( aFuncDesc, sFuncName, Params, OutParamIndex, OutParam );
|
||||||
}
|
}
|
||||||
|
|
||||||
Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(FuncDesc& aFuncDesc,
|
Any IUnknownWrapper::invokeWithDispIdComTlb(FuncDesc& aFuncDesc,
|
||||||
const OUString& sFuncName,
|
const OUString& sFuncName,
|
||||||
const Sequence< Any >& Params,
|
const Sequence< Any >& Params,
|
||||||
Sequence< sal_Int16 >& OutParamIndex,
|
Sequence< sal_Int16 >& OutParamIndex,
|
||||||
Sequence< Any >& OutParam)
|
Sequence< Any >& OutParam)
|
||||||
{
|
{
|
||||||
Any ret;
|
Any ret;
|
||||||
HRESULT result;
|
HRESULT result;
|
||||||
@@ -2090,9 +2090,9 @@ Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(FuncDesc& aFuncDesc,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IUnknownWrapper_Impl::getFuncDescForInvoke(const OUString & sFuncName,
|
void IUnknownWrapper::getFuncDescForInvoke(const OUString & sFuncName,
|
||||||
const Sequence<Any> & seqArgs,
|
const Sequence<Any> & seqArgs,
|
||||||
FUNCDESC** pFuncDesc)
|
FUNCDESC** pFuncDesc)
|
||||||
{
|
{
|
||||||
int nUnoArgs = seqArgs.getLength();
|
int nUnoArgs = seqArgs.getLength();
|
||||||
const Any * arArgs = seqArgs.getConstArray();
|
const Any * arArgs = seqArgs.getConstArray();
|
||||||
@@ -2143,14 +2143,14 @@ void IUnknownWrapper_Impl::getFuncDescForInvoke(const OUString & sFuncName,
|
|||||||
*pFuncDesc = aFuncDesc.Detach();
|
*pFuncDesc = aFuncDesc.Detach();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool IUnknownWrapper_Impl::getDispid(const OUString& sFuncName, DISPID * id)
|
bool IUnknownWrapper::getDispid(const OUString& sFuncName, DISPID * id)
|
||||||
{
|
{
|
||||||
OSL_ASSERT(m_spDispatch);
|
OSL_ASSERT(m_spDispatch);
|
||||||
LPOLESTR lpsz = const_cast<LPOLESTR> (o3tl::toW(sFuncName.getStr()));
|
LPOLESTR lpsz = const_cast<LPOLESTR> (o3tl::toW(sFuncName.getStr()));
|
||||||
HRESULT hr = m_spDispatch->GetIDsOfNames(IID_NULL, &lpsz, 1, LOCALE_USER_DEFAULT, id);
|
HRESULT hr = m_spDispatch->GetIDsOfNames(IID_NULL, &lpsz, 1, LOCALE_USER_DEFAULT, id);
|
||||||
return hr == S_OK;
|
return hr == S_OK;
|
||||||
}
|
}
|
||||||
void IUnknownWrapper_Impl::getFuncDesc(const OUString & sFuncName, FUNCDESC ** pFuncDesc)
|
void IUnknownWrapper::getFuncDesc(const OUString & sFuncName, FUNCDESC ** pFuncDesc)
|
||||||
|
|
||||||
{
|
{
|
||||||
OSL_ASSERT( * pFuncDesc == nullptr);
|
OSL_ASSERT( * pFuncDesc == nullptr);
|
||||||
@@ -2217,8 +2217,8 @@ void IUnknownWrapper_Impl::getFuncDesc(const OUString & sFuncName, FUNCDESC ** p
|
|||||||
//else no entry found for sFuncName, pFuncDesc will not be filled in
|
//else no entry found for sFuncName, pFuncDesc will not be filled in
|
||||||
}
|
}
|
||||||
|
|
||||||
void IUnknownWrapper_Impl::getPropDesc(const OUString & sFuncName, FUNCDESC ** pFuncDescGet,
|
void IUnknownWrapper::getPropDesc(const OUString & sFuncName, FUNCDESC ** pFuncDescGet,
|
||||||
FUNCDESC** pFuncDescPut, VARDESC** pVarDesc)
|
FUNCDESC** pFuncDescPut, VARDESC** pVarDesc)
|
||||||
{
|
{
|
||||||
OSL_ASSERT( * pFuncDescGet == nullptr && * pFuncDescPut == nullptr);
|
OSL_ASSERT( * pFuncDescGet == nullptr && * pFuncDescPut == nullptr);
|
||||||
buildComTlbIndex();
|
buildComTlbIndex();
|
||||||
@@ -2287,7 +2287,7 @@ void IUnknownWrapper_Impl::getPropDesc(const OUString & sFuncName, FUNCDESC ** p
|
|||||||
//else no entry for sFuncName, pFuncDesc will not be filled in
|
//else no entry for sFuncName, pFuncDesc will not be filled in
|
||||||
}
|
}
|
||||||
|
|
||||||
VARTYPE IUnknownWrapper_Impl::getUserDefinedElementType( ITypeInfo* pTypeInfo, const DWORD nHrefType )
|
VARTYPE IUnknownWrapper::getUserDefinedElementType( ITypeInfo* pTypeInfo, const DWORD nHrefType )
|
||||||
{
|
{
|
||||||
VARTYPE _type( VT_NULL );
|
VARTYPE _type( VT_NULL );
|
||||||
if ( pTypeInfo )
|
if ( pTypeInfo )
|
||||||
@@ -2331,7 +2331,7 @@ VARTYPE IUnknownWrapper_Impl::getUserDefinedElementType( ITypeInfo* pTypeInfo, c
|
|||||||
return _type;
|
return _type;
|
||||||
}
|
}
|
||||||
|
|
||||||
VARTYPE IUnknownWrapper_Impl::getElementTypeDesc(const TYPEDESC *desc)
|
VARTYPE IUnknownWrapper::getElementTypeDesc(const TYPEDESC *desc)
|
||||||
{
|
{
|
||||||
VARTYPE _type( VT_NULL );
|
VARTYPE _type( VT_NULL );
|
||||||
|
|
||||||
@@ -2357,7 +2357,7 @@ VARTYPE IUnknownWrapper_Impl::getElementTypeDesc(const TYPEDESC *desc)
|
|||||||
return _type;
|
return _type;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IUnknownWrapper_Impl::buildComTlbIndex()
|
void IUnknownWrapper::buildComTlbIndex()
|
||||||
{
|
{
|
||||||
if ( ! m_bComTlbIndexInit)
|
if ( ! m_bComTlbIndexInit)
|
||||||
{
|
{
|
||||||
@@ -2384,12 +2384,12 @@ void IUnknownWrapper_Impl::buildComTlbIndex()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sError = "[automation bridge] IUnknownWrapper_Impl::buildComTlbIndex, "
|
sError = "[automation bridge] IUnknownWrapper::buildComTlbIndex, "
|
||||||
"ITypeInfo::GetNames failed.";
|
"ITypeInfo::GetNames failed.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sError = "[automation bridge] IUnknownWrapper_Impl::buildComTlbIndex, "
|
sError = "[automation bridge] IUnknownWrapper::buildComTlbIndex, "
|
||||||
"ITypeInfo::GetFuncDesc failed.";
|
"ITypeInfo::GetFuncDesc failed.";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2412,18 +2412,18 @@ void IUnknownWrapper_Impl::buildComTlbIndex()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sError = "[automation bridge] IUnknownWrapper_Impl::buildComTlbIndex, "
|
sError = "[automation bridge] IUnknownWrapper::buildComTlbIndex, "
|
||||||
"ITypeInfo::GetNames failed.";
|
"ITypeInfo::GetNames failed.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sError = "[automation bridge] IUnknownWrapper_Impl::buildComTlbIndex, "
|
sError = "[automation bridge] IUnknownWrapper::buildComTlbIndex, "
|
||||||
"ITypeInfo::GetVarDesc failed.";
|
"ITypeInfo::GetVarDesc failed.";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sError = "[automation bridge] IUnknownWrapper_Impl::buildComTlbIndex, "
|
sError = "[automation bridge] IUnknownWrapper::buildComTlbIndex, "
|
||||||
"ITypeInfo::GetTypeAttr failed.";
|
"ITypeInfo::GetTypeAttr failed.";
|
||||||
|
|
||||||
if (sError.getLength())
|
if (sError.getLength())
|
||||||
@@ -2437,7 +2437,7 @@ void IUnknownWrapper_Impl::buildComTlbIndex()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ITypeInfo* IUnknownWrapper_Impl::getTypeInfo()
|
ITypeInfo* IUnknownWrapper::getTypeInfo()
|
||||||
{
|
{
|
||||||
if( !m_spDispatch)
|
if( !m_spDispatch)
|
||||||
{
|
{
|
||||||
|
@@ -53,16 +53,16 @@ typedef std::unordered_multimap<OUString, unsigned int> TLBFuncIndexMap;
|
|||||||
// This class wraps an IDispatch and maps XInvocation calls to IDispatch calls on the wrapped object.
|
// This class wraps an IDispatch and maps XInvocation calls to IDispatch calls on the wrapped object.
|
||||||
// If m_TypeDescription is set then this class represents an UNO interface implemented in a COM component.
|
// If m_TypeDescription is set then this class represents an UNO interface implemented in a COM component.
|
||||||
// The interface is not a real interface in terms of an abstract class but is realized through IDispatch.
|
// The interface is not a real interface in terms of an abstract class but is realized through IDispatch.
|
||||||
class IUnknownWrapper_Impl : public WeakImplHelper< XBridgeSupplier2, XInitialization, XAutomationObject, XDefaultProperty, XDefaultMethod, XDirectInvocation, XAutomationInvocation >,
|
class IUnknownWrapper : public WeakImplHelper< XBridgeSupplier2, XInitialization, XAutomationObject, XDefaultProperty, XDefaultMethod, XDirectInvocation, XAutomationInvocation >,
|
||||||
|
|
||||||
public UnoConversionUtilities<IUnknownWrapper_Impl>
|
public UnoConversionUtilities<IUnknownWrapper>
|
||||||
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IUnknownWrapper_Impl(Reference<XMultiServiceFactory> const &xFactory,
|
IUnknownWrapper(Reference<XMultiServiceFactory> const &xFactory,
|
||||||
sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass);
|
sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass);
|
||||||
|
|
||||||
~IUnknownWrapper_Impl() override;
|
~IUnknownWrapper() override;
|
||||||
|
|
||||||
//XInterface
|
//XInterface
|
||||||
Any SAL_CALL queryInterface(const Type& t) override;
|
Any SAL_CALL queryInterface(const Type& t) override;
|
||||||
|
@@ -43,8 +43,8 @@ using namespace com::sun::star::bridge::ModelDependent;
|
|||||||
// {82154420-0FBF-11d4-8313-005004526AB4}
|
// {82154420-0FBF-11d4-8313-005004526AB4}
|
||||||
DEFINE_GUID(OID_ServiceManager, 0x82154420, 0xfbf, 0x11d4, 0x83, 0x13, 0x0, 0x50, 0x4, 0x52, 0x6a, 0xb4);
|
DEFINE_GUID(OID_ServiceManager, 0x82154420, 0xfbf, 0x11d4, 0x83, 0x13, 0x0, 0x50, 0x4, 0x52, 0x6a, 0xb4);
|
||||||
|
|
||||||
ProviderOleWrapper_Impl::ProviderOleWrapper_Impl(const Reference<XMultiServiceFactory>& smgr,
|
ProviderOleWrapper::ProviderOleWrapper(const Reference<XMultiServiceFactory>& smgr,
|
||||||
const Reference<XSingleServiceFactory>& xSFact, GUID const * pGuid)
|
const Reference<XSingleServiceFactory>& xSFact, GUID const * pGuid)
|
||||||
: m_xSingleServiceFactory(xSFact),
|
: m_xSingleServiceFactory(xSFact),
|
||||||
m_guid(*pGuid),
|
m_guid(*pGuid),
|
||||||
m_smgr( smgr)
|
m_smgr( smgr)
|
||||||
@@ -59,11 +59,11 @@ ProviderOleWrapper_Impl::ProviderOleWrapper_Impl(const Reference<XMultiServiceFa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ProviderOleWrapper_Impl::~ProviderOleWrapper_Impl()
|
ProviderOleWrapper::~ProviderOleWrapper()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProviderOleWrapper_Impl::registerClass()
|
bool ProviderOleWrapper::registerClass()
|
||||||
{
|
{
|
||||||
HRESULT hresult;
|
HRESULT hresult;
|
||||||
|
|
||||||
@@ -79,14 +79,14 @@ bool ProviderOleWrapper_Impl::registerClass()
|
|||||||
return (hresult == NOERROR);
|
return (hresult == NOERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProviderOleWrapper_Impl::deregisterClass()
|
bool ProviderOleWrapper::deregisterClass()
|
||||||
{
|
{
|
||||||
HRESULT hresult = CoRevokeClassObject(m_factoryHandle);
|
HRESULT hresult = CoRevokeClassObject(m_factoryHandle);
|
||||||
|
|
||||||
return (hresult == NOERROR);
|
return (hresult == NOERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP ProviderOleWrapper_Impl::QueryInterface(REFIID riid, void FAR* FAR* ppv)
|
STDMETHODIMP ProviderOleWrapper::QueryInterface(REFIID riid, void FAR* FAR* ppv)
|
||||||
{
|
{
|
||||||
if(IsEqualIID(riid, IID_IUnknown))
|
if(IsEqualIID(riid, IID_IUnknown))
|
||||||
{
|
{
|
||||||
@@ -105,12 +105,12 @@ STDMETHODIMP ProviderOleWrapper_Impl::QueryInterface(REFIID riid, void FAR* FAR*
|
|||||||
return ResultFromScode(E_NOINTERFACE);
|
return ResultFromScode(E_NOINTERFACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP_(ULONG) ProviderOleWrapper_Impl::AddRef()
|
STDMETHODIMP_(ULONG) ProviderOleWrapper::AddRef()
|
||||||
{
|
{
|
||||||
return osl_atomic_increment( &m_refCount);
|
return osl_atomic_increment( &m_refCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP_(ULONG) ProviderOleWrapper_Impl::Release()
|
STDMETHODIMP_(ULONG) ProviderOleWrapper::Release()
|
||||||
{
|
{
|
||||||
MutexGuard aGuard( Mutex::getGlobalMutex());
|
MutexGuard aGuard( Mutex::getGlobalMutex());
|
||||||
ULONG refCount = --m_refCount;
|
ULONG refCount = --m_refCount;
|
||||||
@@ -122,9 +122,9 @@ STDMETHODIMP_(ULONG) ProviderOleWrapper_Impl::Release()
|
|||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP ProviderOleWrapper_Impl::CreateInstance(IUnknown FAR* punkOuter,
|
STDMETHODIMP ProviderOleWrapper::CreateInstance(IUnknown FAR* punkOuter,
|
||||||
REFIID riid,
|
REFIID riid,
|
||||||
void FAR* FAR* ppv)
|
void FAR* FAR* ppv)
|
||||||
{
|
{
|
||||||
HRESULT ret = ResultFromScode(E_UNEXPECTED);
|
HRESULT ret = ResultFromScode(E_UNEXPECTED);
|
||||||
punkOuter = nullptr;
|
punkOuter = nullptr;
|
||||||
@@ -165,14 +165,14 @@ STDMETHODIMP ProviderOleWrapper_Impl::CreateInstance(IUnknown FAR* punkOuter,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP ProviderOleWrapper_Impl::LockServer(int /*fLock*/)
|
STDMETHODIMP ProviderOleWrapper::LockServer(int /*fLock*/)
|
||||||
{
|
{
|
||||||
return NOERROR;
|
return NOERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
OneInstanceOleWrapper_Impl::OneInstanceOleWrapper_Impl( const Reference<XMultiServiceFactory>& smgr,
|
OneInstanceOleWrapper::OneInstanceOleWrapper( const Reference<XMultiServiceFactory>& smgr,
|
||||||
const Reference<XInterface>& xInst,
|
const Reference<XInterface>& xInst,
|
||||||
GUID const * pGuid )
|
GUID const * pGuid )
|
||||||
: m_refCount(0)
|
: m_refCount(0)
|
||||||
, m_xInst(xInst)
|
, m_xInst(xInst)
|
||||||
, m_guid(*pGuid)
|
, m_guid(*pGuid)
|
||||||
@@ -188,11 +188,11 @@ OneInstanceOleWrapper_Impl::OneInstanceOleWrapper_Impl( const Reference<XMultiS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OneInstanceOleWrapper_Impl::~OneInstanceOleWrapper_Impl()
|
OneInstanceOleWrapper::~OneInstanceOleWrapper()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OneInstanceOleWrapper_Impl::registerClass()
|
bool OneInstanceOleWrapper::registerClass()
|
||||||
{
|
{
|
||||||
HRESULT hresult;
|
HRESULT hresult;
|
||||||
|
|
||||||
@@ -208,12 +208,12 @@ bool OneInstanceOleWrapper_Impl::registerClass()
|
|||||||
return (hresult == NOERROR);
|
return (hresult == NOERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OneInstanceOleWrapper_Impl::deregisterClass()
|
bool OneInstanceOleWrapper::deregisterClass()
|
||||||
{
|
{
|
||||||
return CoRevokeClassObject(m_factoryHandle) == NOERROR;
|
return CoRevokeClassObject(m_factoryHandle) == NOERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP OneInstanceOleWrapper_Impl::QueryInterface(REFIID riid, void FAR* FAR* ppv)
|
STDMETHODIMP OneInstanceOleWrapper::QueryInterface(REFIID riid, void FAR* FAR* ppv)
|
||||||
{
|
{
|
||||||
if(IsEqualIID(riid, IID_IUnknown))
|
if(IsEqualIID(riid, IID_IUnknown))
|
||||||
{
|
{
|
||||||
@@ -232,12 +232,12 @@ STDMETHODIMP OneInstanceOleWrapper_Impl::QueryInterface(REFIID riid, void FAR* F
|
|||||||
return ResultFromScode(E_NOINTERFACE);
|
return ResultFromScode(E_NOINTERFACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP_(ULONG) OneInstanceOleWrapper_Impl::AddRef()
|
STDMETHODIMP_(ULONG) OneInstanceOleWrapper::AddRef()
|
||||||
{
|
{
|
||||||
return osl_atomic_increment( &m_refCount);
|
return osl_atomic_increment( &m_refCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP_(ULONG) OneInstanceOleWrapper_Impl::Release()
|
STDMETHODIMP_(ULONG) OneInstanceOleWrapper::Release()
|
||||||
{
|
{
|
||||||
MutexGuard oGuard( Mutex::getGlobalMutex());
|
MutexGuard oGuard( Mutex::getGlobalMutex());
|
||||||
ULONG refCount = --m_refCount;
|
ULONG refCount = --m_refCount;
|
||||||
@@ -249,9 +249,9 @@ STDMETHODIMP_(ULONG) OneInstanceOleWrapper_Impl::Release()
|
|||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP OneInstanceOleWrapper_Impl::CreateInstance(IUnknown FAR* punkOuter,
|
STDMETHODIMP OneInstanceOleWrapper::CreateInstance(IUnknown FAR* punkOuter,
|
||||||
REFIID riid,
|
REFIID riid,
|
||||||
void FAR* FAR* ppv)
|
void FAR* FAR* ppv)
|
||||||
{
|
{
|
||||||
HRESULT ret = ResultFromScode(E_UNEXPECTED);
|
HRESULT ret = ResultFromScode(E_UNEXPECTED);
|
||||||
punkOuter = nullptr;
|
punkOuter = nullptr;
|
||||||
@@ -284,33 +284,33 @@ STDMETHODIMP OneInstanceOleWrapper_Impl::CreateInstance(IUnknown FAR* punkOuter,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP OneInstanceOleWrapper_Impl::LockServer(int /*fLock*/)
|
STDMETHODIMP OneInstanceOleWrapper::LockServer(int /*fLock*/)
|
||||||
{
|
{
|
||||||
return NOERROR;
|
return NOERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
OleConverter_Impl2::OleConverter_Impl2( const Reference<XMultiServiceFactory> &smgr):
|
OleConverter::OleConverter( const Reference<XMultiServiceFactory> &smgr):
|
||||||
UnoConversionUtilities<OleConverter_Impl2>( smgr)
|
UnoConversionUtilities<OleConverter>( smgr)
|
||||||
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// The XMultiServiceFactory is later set by XInitialization
|
// The XMultiServiceFactory is later set by XInitialization
|
||||||
OleConverter_Impl2::OleConverter_Impl2( const Reference<XMultiServiceFactory>& smgr, sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass ):
|
OleConverter::OleConverter( const Reference<XMultiServiceFactory>& smgr, sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass ):
|
||||||
UnoConversionUtilities<OleConverter_Impl2>( smgr, unoWrapperClass, comWrapperClass )
|
UnoConversionUtilities<OleConverter>( smgr, unoWrapperClass, comWrapperClass )
|
||||||
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
OleConverter_Impl2::~OleConverter_Impl2()
|
OleConverter::~OleConverter()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// XBridgeSupplier --------------------------------------------------------------
|
// XBridgeSupplier --------------------------------------------------------------
|
||||||
Any SAL_CALL OleConverter_Impl2::createBridge(const Any& modelDepObject,
|
Any SAL_CALL OleConverter::createBridge(const Any& modelDepObject,
|
||||||
const Sequence< sal_Int8 >& ProcessId,
|
const Sequence< sal_Int8 >& ProcessId,
|
||||||
sal_Int16 sourceModelType,
|
sal_Int16 sourceModelType,
|
||||||
sal_Int16 destModelType)
|
sal_Int16 destModelType)
|
||||||
{
|
{
|
||||||
Any ret;
|
Any ret;
|
||||||
sal_uInt8 arId[16];
|
sal_uInt8 arId[16];
|
||||||
@@ -393,19 +393,19 @@ Any SAL_CALL OleConverter_Impl2::createBridge(const Any& modelDepObject,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString OleConverter_Impl2::getImplementationName()
|
OUString OleConverter::getImplementationName()
|
||||||
{
|
{
|
||||||
return m_nUnoWrapperClass == INTERFACE_OLE_WRAPPER_IMPL
|
return m_nUnoWrapperClass == INTERFACE_OLE_WRAPPER_IMPL
|
||||||
? OUString("com.sun.star.comp.ole.OleConverter2")
|
? OUString("com.sun.star.comp.ole.OleConverter2")
|
||||||
: OUString("com.sun.star.comp.ole.OleConverterVar1");
|
: OUString("com.sun.star.comp.ole.OleConverterVar1");
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool OleConverter_Impl2::supportsService(OUString const & ServiceName)
|
sal_Bool OleConverter::supportsService(OUString const & ServiceName)
|
||||||
{
|
{
|
||||||
return cppu::supportsService(this, ServiceName);
|
return cppu::supportsService(this, ServiceName);
|
||||||
}
|
}
|
||||||
|
|
||||||
css::uno::Sequence<OUString> OleConverter_Impl2::getSupportedServiceNames()
|
css::uno::Sequence<OUString> OleConverter::getSupportedServiceNames()
|
||||||
{
|
{
|
||||||
if (m_nUnoWrapperClass == INTERFACE_OLE_WRAPPER_IMPL)
|
if (m_nUnoWrapperClass == INTERFACE_OLE_WRAPPER_IMPL)
|
||||||
{
|
{
|
||||||
@@ -419,7 +419,7 @@ css::uno::Sequence<OUString> OleConverter_Impl2::getSupportedServiceNames()
|
|||||||
|
|
||||||
// XInitialize ------------------------------------------------------------------------------
|
// XInitialize ------------------------------------------------------------------------------
|
||||||
// the first argument is an XMultiServiceFactory if at all
|
// the first argument is an XMultiServiceFactory if at all
|
||||||
void SAL_CALL OleConverter_Impl2::initialize( const Sequence< Any >& aArguments )
|
void SAL_CALL OleConverter::initialize( const Sequence< Any >& aArguments )
|
||||||
{
|
{
|
||||||
if( aArguments.getLength() == 1 && aArguments[0].getValueTypeClass() == TypeClass_INTERFACE)
|
if( aArguments.getLength() == 1 && aArguments[0].getValueTypeClass() == TypeClass_INTERFACE)
|
||||||
{
|
{
|
||||||
@@ -431,11 +431,11 @@ void SAL_CALL OleConverter_Impl2::initialize( const Sequence< Any >& aArguments
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UnoConversionUtilities -------------------------------------------------------------------
|
// UnoConversionUtilities -------------------------------------------------------------------
|
||||||
Reference< XInterface > OleConverter_Impl2::createUnoWrapperInstance()
|
Reference< XInterface > OleConverter::createUnoWrapperInstance()
|
||||||
{
|
{
|
||||||
if( m_nUnoWrapperClass == INTERFACE_OLE_WRAPPER_IMPL)
|
if( m_nUnoWrapperClass == INTERFACE_OLE_WRAPPER_IMPL)
|
||||||
{
|
{
|
||||||
Reference<XWeak> xWeak= static_cast<XWeak*>( new InterfaceOleWrapper_Impl(
|
Reference<XWeak> xWeak= static_cast<XWeak*>( new InterfaceOleWrapper(
|
||||||
m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
|
m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
|
||||||
return Reference<XInterface>( xWeak, UNO_QUERY);
|
return Reference<XInterface>( xWeak, UNO_QUERY);
|
||||||
}
|
}
|
||||||
@@ -449,15 +449,15 @@ Reference< XInterface > OleConverter_Impl2::createUnoWrapperInstance()
|
|||||||
return Reference<XInterface>();
|
return Reference<XInterface>();
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference< XInterface > OleConverter_Impl2::createComWrapperInstance()
|
Reference< XInterface > OleConverter::createComWrapperInstance()
|
||||||
{
|
{
|
||||||
Reference<XWeak> xWeak= static_cast<XWeak*>( new IUnknownWrapper_Impl(
|
Reference<XWeak> xWeak= static_cast<XWeak*>( new IUnknownWrapper(
|
||||||
m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
|
m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
|
||||||
return Reference<XInterface>( xWeak, UNO_QUERY);
|
return Reference<XInterface>( xWeak, UNO_QUERY);
|
||||||
}
|
}
|
||||||
|
|
||||||
OleClient_Impl::OleClient_Impl( const Reference<XMultiServiceFactory>& smgr):
|
OleClient::OleClient( const Reference<XMultiServiceFactory>& smgr):
|
||||||
UnoConversionUtilities<OleClient_Impl>( smgr)
|
UnoConversionUtilities<OleClient>( smgr)
|
||||||
{
|
{
|
||||||
Reference<XInterface> xInt;// = m_smgr->createInstance(L"com.sun.star.bridge.OleBridgeSupplier2");
|
Reference<XInterface> xInt;// = m_smgr->createInstance(L"com.sun.star.bridge.OleBridgeSupplier2");
|
||||||
|
|
||||||
@@ -468,35 +468,35 @@ OleClient_Impl::OleClient_Impl( const Reference<XMultiServiceFactory>& smgr):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OleClient_Impl::~OleClient_Impl()
|
OleClient::~OleClient()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Sequence< OUString > SAL_CALL OleClient_Impl::getAvailableServiceNames()
|
Sequence< OUString > SAL_CALL OleClient::getAvailableServiceNames()
|
||||||
{
|
{
|
||||||
Sequence< OUString > ret;
|
Sequence< OUString > ret;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString OleClient_Impl::getImplementationName()
|
OUString OleClient::getImplementationName()
|
||||||
{
|
{
|
||||||
return OUString("com.sun.star.comp.ole.OleClient");
|
return OUString("com.sun.star.comp.ole.OleClient");
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool OleClient_Impl::supportsService(OUString const & ServiceName)
|
sal_Bool OleClient::supportsService(OUString const & ServiceName)
|
||||||
{
|
{
|
||||||
return cppu::supportsService(this, ServiceName);
|
return cppu::supportsService(this, ServiceName);
|
||||||
}
|
}
|
||||||
|
|
||||||
css::uno::Sequence<OUString> OleClient_Impl::getSupportedServiceNames()
|
css::uno::Sequence<OUString> OleClient::getSupportedServiceNames()
|
||||||
{
|
{
|
||||||
return css::uno::Sequence<OUString>{
|
return css::uno::Sequence<OUString>{
|
||||||
"com.sun.star.bridge.OleObjectFactory",
|
"com.sun.star.bridge.OleObjectFactory",
|
||||||
"com.sun.star.bridge.oleautomation.Factory"};
|
"com.sun.star.bridge.oleautomation.Factory"};
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference<XInterface> SAL_CALL OleClient_Impl::createInstance(const OUString& ServiceSpecifier)
|
Reference<XInterface> SAL_CALL OleClient::createInstance(const OUString& ServiceSpecifier)
|
||||||
{
|
{
|
||||||
Reference<XInterface> ret;
|
Reference<XInterface> ret;
|
||||||
HRESULT result;
|
HRESULT result;
|
||||||
@@ -543,17 +543,17 @@ Reference<XInterface> SAL_CALL OleClient_Impl::createInstance(const OUString& Se
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference<XInterface> SAL_CALL OleClient_Impl::createInstanceWithArguments(const OUString& ServiceSpecifier, const Sequence< Any >& /*Arguments*/)
|
Reference<XInterface> SAL_CALL OleClient::createInstanceWithArguments(const OUString& ServiceSpecifier, const Sequence< Any >& /*Arguments*/)
|
||||||
{
|
{
|
||||||
return createInstance( ServiceSpecifier);
|
return createInstance( ServiceSpecifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnoConversionUtilities -----------------------------------------------------------------------------
|
// UnoConversionUtilities -----------------------------------------------------------------------------
|
||||||
Reference< XInterface > OleClient_Impl::createUnoWrapperInstance()
|
Reference< XInterface > OleClient::createUnoWrapperInstance()
|
||||||
{
|
{
|
||||||
if( m_nUnoWrapperClass == INTERFACE_OLE_WRAPPER_IMPL)
|
if( m_nUnoWrapperClass == INTERFACE_OLE_WRAPPER_IMPL)
|
||||||
{
|
{
|
||||||
Reference<XWeak> xWeak= static_cast<XWeak*>( new InterfaceOleWrapper_Impl(
|
Reference<XWeak> xWeak= static_cast<XWeak*>( new InterfaceOleWrapper(
|
||||||
m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
|
m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
|
||||||
return Reference<XInterface>( xWeak, UNO_QUERY);
|
return Reference<XInterface>( xWeak, UNO_QUERY);
|
||||||
}
|
}
|
||||||
@@ -567,14 +567,14 @@ Reference< XInterface > OleClient_Impl::createUnoWrapperInstance()
|
|||||||
return Reference< XInterface>();
|
return Reference< XInterface>();
|
||||||
}
|
}
|
||||||
// UnoConversionUtilities -----------------------------------------------------------------------------
|
// UnoConversionUtilities -----------------------------------------------------------------------------
|
||||||
Reference< XInterface > OleClient_Impl::createComWrapperInstance( )
|
Reference< XInterface > OleClient::createComWrapperInstance( )
|
||||||
{
|
{
|
||||||
Reference<XWeak> xWeak= static_cast<XWeak*>( new IUnknownWrapper_Impl(
|
Reference<XWeak> xWeak= static_cast<XWeak*>( new IUnknownWrapper(
|
||||||
m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
|
m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
|
||||||
return Reference<XInterface>( xWeak, UNO_QUERY);
|
return Reference<XInterface>( xWeak, UNO_QUERY);
|
||||||
}
|
}
|
||||||
|
|
||||||
OleServer_Impl::OleServer_Impl( const Reference<XMultiServiceFactory>& smgr):
|
OleServer::OleServer( const Reference<XMultiServiceFactory>& smgr):
|
||||||
m_smgr( smgr)
|
m_smgr( smgr)
|
||||||
{
|
{
|
||||||
Reference<XInterface> xInt = m_smgr->createInstance("com.sun.star.bridge.oleautomation.BridgeSupplier");
|
Reference<XInterface> xInt = m_smgr->createInstance("com.sun.star.bridge.oleautomation.BridgeSupplier");
|
||||||
@@ -588,7 +588,7 @@ OleServer_Impl::OleServer_Impl( const Reference<XMultiServiceFactory>& smgr):
|
|||||||
(void) provideInstance( m_smgr, &OID_ServiceManager );
|
(void) provideInstance( m_smgr, &OID_ServiceManager );
|
||||||
}
|
}
|
||||||
|
|
||||||
OleServer_Impl::~OleServer_Impl()
|
OleServer::~OleServer()
|
||||||
{
|
{
|
||||||
for (auto const& elem : m_wrapperList)
|
for (auto const& elem : m_wrapperList)
|
||||||
{
|
{
|
||||||
@@ -598,26 +598,26 @@ OleServer_Impl::~OleServer_Impl()
|
|||||||
m_wrapperList.clear();
|
m_wrapperList.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString OleServer_Impl::getImplementationName()
|
OUString OleServer::getImplementationName()
|
||||||
{
|
{
|
||||||
return OUString("com.sun.star.comp.ole.OleServer");
|
return OUString("com.sun.star.comp.ole.OleServer");
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool OleServer_Impl::supportsService(OUString const & ServiceName)
|
sal_Bool OleServer::supportsService(OUString const & ServiceName)
|
||||||
{
|
{
|
||||||
return cppu::supportsService(this, ServiceName);
|
return cppu::supportsService(this, ServiceName);
|
||||||
}
|
}
|
||||||
|
|
||||||
css::uno::Sequence<OUString> OleServer_Impl::getSupportedServiceNames()
|
css::uno::Sequence<OUString> OleServer::getSupportedServiceNames()
|
||||||
{
|
{
|
||||||
return css::uno::Sequence<OUString>{
|
return css::uno::Sequence<OUString>{
|
||||||
"com.sun.star.bridge.OleApplicationRegistration",
|
"com.sun.star.bridge.OleApplicationRegistration",
|
||||||
"com.sun.star.bridge.oleautomation.ApplicationRegistration"};
|
"com.sun.star.bridge.oleautomation.ApplicationRegistration"};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OleServer_Impl::provideService(const Reference<XSingleServiceFactory>& xSFact, GUID const * guid)
|
bool OleServer::provideService(const Reference<XSingleServiceFactory>& xSFact, GUID const * guid)
|
||||||
{
|
{
|
||||||
IClassFactoryWrapper* pFac = new ProviderOleWrapper_Impl( m_smgr, xSFact, guid);
|
IClassFactoryWrapper* pFac = new ProviderOleWrapper( m_smgr, xSFact, guid);
|
||||||
|
|
||||||
pFac->AddRef();
|
pFac->AddRef();
|
||||||
|
|
||||||
@@ -626,10 +626,10 @@ bool OleServer_Impl::provideService(const Reference<XSingleServiceFactory>& xSFa
|
|||||||
return pFac->registerClass();
|
return pFac->registerClass();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OleServer_Impl::provideInstance(const Reference<XInterface>& xInst, GUID const * guid)
|
bool OleServer::provideInstance(const Reference<XInterface>& xInst, GUID const * guid)
|
||||||
{
|
{
|
||||||
IClassFactoryWrapper* pFac =
|
IClassFactoryWrapper* pFac =
|
||||||
new OneInstanceOleWrapper_Impl( m_smgr, xInst, guid );
|
new OneInstanceOleWrapper( m_smgr, xInst, guid );
|
||||||
|
|
||||||
pFac->AddRef();
|
pFac->AddRef();
|
||||||
m_wrapperList.push_back(pFac);
|
m_wrapperList.push_back(pFac);
|
||||||
|
@@ -44,7 +44,7 @@ Reference<XInterface> OleServer_CreateInstance( const Reference<XMultiServiceFac
|
|||||||
IClassFactoryWrapper
|
IClassFactoryWrapper
|
||||||
|
|
||||||
Specify abstract helper methods on class factories, which provide
|
Specify abstract helper methods on class factories, which provide
|
||||||
UNO objects. These methods are used by objects of class OleServer_Impl,
|
UNO objects. These methods are used by objects of class OleServer,
|
||||||
to handle the OLE registration of different class factories.
|
to handle the OLE registration of different class factories.
|
||||||
|
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
@@ -62,7 +62,7 @@ protected:
|
|||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
ProviderOleWrapper_Impl
|
ProviderOleWrapper
|
||||||
|
|
||||||
Provides an UNO service provider as OLE class factory. Handle the
|
Provides an UNO service provider as OLE class factory. Handle the
|
||||||
OLE registration by overriding the abstract methods from
|
OLE registration by overriding the abstract methods from
|
||||||
@@ -74,13 +74,13 @@ protected:
|
|||||||
|
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
class ProviderOleWrapper_Impl : public IClassFactoryWrapper
|
class ProviderOleWrapper : public IClassFactoryWrapper
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ProviderOleWrapper_Impl( const Reference<XMultiServiceFactory>& smgr,
|
ProviderOleWrapper( const Reference<XMultiServiceFactory>& smgr,
|
||||||
const Reference<XSingleServiceFactory>& xSFactory, GUID const * pGuid);
|
const Reference<XSingleServiceFactory>& xSFactory, GUID const * pGuid);
|
||||||
virtual ~ProviderOleWrapper_Impl();
|
virtual ~ProviderOleWrapper();
|
||||||
|
|
||||||
bool registerClass() override;
|
bool registerClass() override;
|
||||||
bool deregisterClass() override;
|
bool deregisterClass() override;
|
||||||
@@ -106,7 +106,7 @@ protected:
|
|||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
OneInstanceOleWrapper_Impl
|
OneInstanceOleWrapper
|
||||||
|
|
||||||
Provides an single UNO object as OLE object. Handle the
|
Provides an single UNO object as OLE object. Handle the
|
||||||
OLE registration by overriding the abstract methods from
|
OLE registration by overriding the abstract methods from
|
||||||
@@ -117,12 +117,12 @@ protected:
|
|||||||
|
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
class OneInstanceOleWrapper_Impl : public IClassFactoryWrapper
|
class OneInstanceOleWrapper : public IClassFactoryWrapper
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
OneInstanceOleWrapper_Impl( const Reference<XMultiServiceFactory>& smgr, const Reference<XInterface>& xInst, GUID const * pGuid );
|
OneInstanceOleWrapper( const Reference<XMultiServiceFactory>& smgr, const Reference<XInterface>& xInst, GUID const * pGuid );
|
||||||
virtual ~OneInstanceOleWrapper_Impl();
|
virtual ~OneInstanceOleWrapper();
|
||||||
|
|
||||||
bool registerClass() override;
|
bool registerClass() override;
|
||||||
bool deregisterClass() override;
|
bool deregisterClass() override;
|
||||||
@@ -149,22 +149,21 @@ protected:
|
|||||||
// Implementation of the UNO service com.sun.star.bridge.OleBridgeSupplier2.
|
// Implementation of the UNO service com.sun.star.bridge.OleBridgeSupplier2.
|
||||||
|
|
||||||
// This class realizes the service com.sun.star.bridge.OleBridgeSupplier2 and
|
// This class realizes the service com.sun.star.bridge.OleBridgeSupplier2 and
|
||||||
// com.sun.star.bridge.OleBridgeSupplierVar1. The class implements XBridgeSupplier2
|
// com.sun.star.bridge.OleBridgeSupplierVar1. The class implements XBridgeSupplier2 which
|
||||||
// instead of XBridgeSuppplier as done by class OleConverter_Impl. The XBridgeSupplier2
|
|
||||||
// interface does not need a Maschine Id in its createBridge function anymore,
|
// interface does not need a Maschine Id in its createBridge function anymore,
|
||||||
// If an UNO interface is to be converted then the member m_nUnoWrapperClass determines
|
// If an UNO interface is to be converted then the member m_nUnoWrapperClass determines
|
||||||
// what wrapper class is to be used. There are currently InterfaceOleWrapper_Impl and
|
// what wrapper class is to be used. There are currently InterfaceOleWrapper and
|
||||||
// UnoObjectWrapperRemoteOpt. The first is used for the OleBridgeSupplier2 and the
|
// UnoObjectWrapperRemoteOpt. The first is used for the OleBridgeSupplier2 and the
|
||||||
// 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).
|
||||||
class OleConverter_Impl2 : public WeakImplHelper<XBridgeSupplier2, XInitialization, css::lang::XServiceInfo>,
|
class OleConverter : public WeakImplHelper<XBridgeSupplier2, XInitialization, css::lang::XServiceInfo>,
|
||||||
public UnoConversionUtilities<OleConverter_Impl2>
|
public UnoConversionUtilities<OleConverter>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit OleConverter_Impl2( const Reference<XMultiServiceFactory>& smgr);
|
explicit OleConverter( const Reference<XMultiServiceFactory>& smgr);
|
||||||
OleConverter_Impl2( const Reference<XMultiServiceFactory>& smgr, sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass );
|
OleConverter( const Reference<XMultiServiceFactory>& smgr, sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass );
|
||||||
virtual ~OleConverter_Impl2() override;
|
virtual ~OleConverter() override;
|
||||||
|
|
||||||
// XBridgeSupplier2 ---------------------------------------------------
|
// XBridgeSupplier2 ---------------------------------------------------
|
||||||
|
|
||||||
@@ -191,12 +190,12 @@ protected:
|
|||||||
|
|
||||||
// Implementation of the UNO service com.sun.star.bridge.OleObjectFactory.
|
// Implementation of the UNO service com.sun.star.bridge.OleObjectFactory.
|
||||||
|
|
||||||
class OleClient_Impl : public WeakImplHelper<XMultiServiceFactory, css::lang::XServiceInfo>,
|
class OleClient : public WeakImplHelper<XMultiServiceFactory, css::lang::XServiceInfo>,
|
||||||
public UnoConversionUtilities<OleClient_Impl>
|
public UnoConversionUtilities<OleClient>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit OleClient_Impl( const Reference<XMultiServiceFactory>& smgr);
|
explicit OleClient( const Reference<XMultiServiceFactory>& smgr);
|
||||||
~OleClient_Impl() override;
|
~OleClient() override;
|
||||||
|
|
||||||
// XMultiServiceFactory
|
// XMultiServiceFactory
|
||||||
Reference<XInterface> SAL_CALL createInstance(const OUString& ServiceSpecifier) override;
|
Reference<XInterface> SAL_CALL createInstance(const OUString& ServiceSpecifier) override;
|
||||||
@@ -219,7 +218,7 @@ protected:
|
|||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
OleServer_Impl
|
OleServer
|
||||||
|
|
||||||
Implementation of the UNO service com.sun.star.bridge.OleApplicationRegistration.
|
Implementation of the UNO service com.sun.star.bridge.OleApplicationRegistration.
|
||||||
Register the calling application as OLE automation server for
|
Register the calling application as OLE automation server for
|
||||||
@@ -228,11 +227,11 @@ protected:
|
|||||||
|
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
class OleServer_Impl : public cppu::WeakImplHelper<css::lang::XServiceInfo>
|
class OleServer : public cppu::WeakImplHelper<css::lang::XServiceInfo>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit OleServer_Impl( const Reference<XMultiServiceFactory> &smgr);
|
explicit OleServer( const Reference<XMultiServiceFactory> &smgr);
|
||||||
~OleServer_Impl() override;
|
~OleServer() override;
|
||||||
|
|
||||||
OUString SAL_CALL getImplementationName() override;
|
OUString SAL_CALL getImplementationName() override;
|
||||||
|
|
||||||
|
@@ -27,25 +27,25 @@ using namespace cppu;
|
|||||||
|
|
||||||
Reference<XInterface> ConverterProvider_CreateInstance2( const Reference<XMultiServiceFactory> & xSMgr)
|
Reference<XInterface> ConverterProvider_CreateInstance2( const Reference<XMultiServiceFactory> & xSMgr)
|
||||||
{
|
{
|
||||||
Reference<XInterface> xService = *new OleConverter_Impl2( xSMgr);
|
Reference<XInterface> xService = *new OleConverter( xSMgr);
|
||||||
return xService;
|
return xService;
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference<XInterface> ConverterProvider_CreateInstanceVar1( const Reference<XMultiServiceFactory> & xSMgr)
|
Reference<XInterface> ConverterProvider_CreateInstanceVar1( const Reference<XMultiServiceFactory> & xSMgr)
|
||||||
{
|
{
|
||||||
Reference<XInterface> xService = *new OleConverter_Impl2( xSMgr, UNO_OBJECT_WRAPPER_REMOTE_OPT, IUNKNOWN_WRAPPER_IMPL);
|
Reference<XInterface> xService = *new OleConverter( xSMgr, UNO_OBJECT_WRAPPER_REMOTE_OPT, IUNKNOWN_WRAPPER_IMPL);
|
||||||
return xService;
|
return xService;
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference<XInterface> OleClient_CreateInstance( const Reference<XMultiServiceFactory> & xSMgr)
|
Reference<XInterface> OleClient_CreateInstance( const Reference<XMultiServiceFactory> & xSMgr)
|
||||||
{
|
{
|
||||||
Reference<XInterface> xService = *new OleClient_Impl( xSMgr);
|
Reference<XInterface> xService = *new OleClient( xSMgr);
|
||||||
return xService;
|
return xService;
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference<XInterface> OleServer_CreateInstance( const Reference<XMultiServiceFactory> & xSMgr)
|
Reference<XInterface> OleServer_CreateInstance( const Reference<XMultiServiceFactory> & xSMgr)
|
||||||
{
|
{
|
||||||
Reference<XInterface > xService = *new OleServer_Impl(xSMgr);
|
Reference<XInterface > xService = *new OleServer(xSMgr);
|
||||||
return xService;
|
return xService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -70,7 +70,7 @@ extern std::unordered_map<sal_uIntPtr, sal_uIntPtr> WrapperToAdapterMap;
|
|||||||
extern std::unordered_map<sal_uIntPtr, WeakReference<XInterface> > ComPtrToWrapperMap;
|
extern std::unordered_map<sal_uIntPtr, WeakReference<XInterface> > ComPtrToWrapperMap;
|
||||||
|
|
||||||
// Maps XInterface pointers to a weak reference of its wrapper class (i.e.
|
// Maps XInterface pointers to a weak reference of its wrapper class (i.e.
|
||||||
// InterfaceOleWrapper_Impl). It is the responsibility of the wrapper to remove the entry when
|
// InterfaceOleWrapper). It is the responsibility of the wrapper to remove the entry when
|
||||||
// it is being destroyed. It is used to ensure the identity of objects. That is, an UNO interface
|
// it is being destroyed. It is used to ensure the identity of objects. That is, an UNO interface
|
||||||
// is mapped to IDispatch which is kept alive in the COM environment. If the same
|
// is mapped to IDispatch which is kept alive in the COM environment. If the same
|
||||||
// UNO interface is mapped again to COM then the IDispach of the first mapped instance
|
// UNO interface is mapped again to COM then the IDispach of the first mapped instance
|
||||||
@@ -1624,7 +1624,7 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANT* pVariant, Any& rAny
|
|||||||
// UNO interfaces in which case it has to support the SUPPORTED_INTERFACES_PROP (see
|
// UNO interfaces in which case it has to support the SUPPORTED_INTERFACES_PROP (see
|
||||||
// #define) property. That property contains all names of interfaces.
|
// #define) property. That property contains all names of interfaces.
|
||||||
// "pUnknown" is wrapped by a COM wrapper object that implements XInvocation, e.g.
|
// "pUnknown" is wrapped by a COM wrapper object that implements XInvocation, e.g.
|
||||||
// IUnknownWrapper_Impl. Additionally an object of type "aType" is created by help
|
// IUnknownWrapper. Additionally an object of type "aType" is created by help
|
||||||
// of the INTERFACE_ADAPTER_FACTORY (see #define) service. The implementation of
|
// of the INTERFACE_ADAPTER_FACTORY (see #define) service. The implementation of
|
||||||
// "aType" calls on the COM wrapper's XInvocation::invoke. If the COM object supports
|
// "aType" calls on the COM wrapper's XInvocation::invoke. If the COM object supports
|
||||||
// more than one UNO interfaces, as can be determined by the property
|
// more than one UNO interfaces, as can be determined by the property
|
||||||
|
@@ -87,14 +87,14 @@ static void writeExcepinfo(EXCEPINFO * pInfo, const OUString& message)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InterfaceOleWrapper_Impl::InterfaceOleWrapper_Impl( Reference<XMultiServiceFactory> const & xFactory,
|
InterfaceOleWrapper::InterfaceOleWrapper( Reference<XMultiServiceFactory> const & xFactory,
|
||||||
sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass):
|
sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass):
|
||||||
UnoConversionUtilities<InterfaceOleWrapper_Impl>( xFactory, unoWrapperClass, comWrapperClass),
|
UnoConversionUtilities<InterfaceOleWrapper>( xFactory, unoWrapperClass, comWrapperClass),
|
||||||
m_defaultValueType( 0)
|
m_defaultValueType( 0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
InterfaceOleWrapper_Impl::~InterfaceOleWrapper_Impl()
|
InterfaceOleWrapper::~InterfaceOleWrapper()
|
||||||
{
|
{
|
||||||
MutexGuard guard(getBridgeMutex());
|
MutexGuard guard(getBridgeMutex());
|
||||||
// remove entries in global map
|
// remove entries in global map
|
||||||
@@ -103,7 +103,7 @@ InterfaceOleWrapper_Impl::~InterfaceOleWrapper_Impl()
|
|||||||
UnoObjToWrapperMap.erase(it);
|
UnoObjToWrapperMap.erase(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP InterfaceOleWrapper_Impl::QueryInterface(REFIID riid, LPVOID FAR * ppv)
|
STDMETHODIMP InterfaceOleWrapper::QueryInterface(REFIID riid, LPVOID FAR * ppv)
|
||||||
{
|
{
|
||||||
HRESULT ret= S_OK;
|
HRESULT ret= S_OK;
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ STDMETHODIMP InterfaceOleWrapper_Impl::QueryInterface(REFIID riid, LPVOID FAR *
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP_(ULONG) InterfaceOleWrapper_Impl::AddRef()
|
STDMETHODIMP_(ULONG) InterfaceOleWrapper::AddRef()
|
||||||
{
|
{
|
||||||
acquire();
|
acquire();
|
||||||
// does not need to guard because one should not rely on the return value of
|
// does not need to guard because one should not rely on the return value of
|
||||||
@@ -138,7 +138,7 @@ STDMETHODIMP_(ULONG) InterfaceOleWrapper_Impl::AddRef()
|
|||||||
return m_refCount;
|
return m_refCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP_(ULONG) InterfaceOleWrapper_Impl::Release()
|
STDMETHODIMP_(ULONG) InterfaceOleWrapper::Release()
|
||||||
{
|
{
|
||||||
ULONG n= m_refCount;
|
ULONG n= m_refCount;
|
||||||
release();
|
release();
|
||||||
@@ -146,17 +146,17 @@ STDMETHODIMP_(ULONG) InterfaceOleWrapper_Impl::Release()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// IUnoObjectWrapper --------------------------------------------------------
|
// IUnoObjectWrapper --------------------------------------------------------
|
||||||
STDMETHODIMP InterfaceOleWrapper_Impl::getWrapperXInterface( Reference<XInterface>* pXInt)
|
STDMETHODIMP InterfaceOleWrapper::getWrapperXInterface( Reference<XInterface>* pXInt)
|
||||||
{
|
{
|
||||||
pXInt->set( static_cast<XWeak*>( this), UNO_QUERY);
|
pXInt->set( static_cast<XWeak*>( this), UNO_QUERY);
|
||||||
return pXInt->is() ? S_OK : E_FAIL;
|
return pXInt->is() ? S_OK : E_FAIL;
|
||||||
}
|
}
|
||||||
STDMETHODIMP InterfaceOleWrapper_Impl::getOriginalUnoObject( Reference<XInterface>* pXInt)
|
STDMETHODIMP InterfaceOleWrapper::getOriginalUnoObject( Reference<XInterface>* pXInt)
|
||||||
{
|
{
|
||||||
*pXInt= m_xOrigin;
|
*pXInt= m_xOrigin;
|
||||||
return m_xOrigin.is() ? S_OK : E_FAIL;
|
return m_xOrigin.is() ? S_OK : E_FAIL;
|
||||||
}
|
}
|
||||||
STDMETHODIMP InterfaceOleWrapper_Impl::getOriginalUnoStruct( Any * pStruct)
|
STDMETHODIMP InterfaceOleWrapper::getOriginalUnoStruct( Any * pStruct)
|
||||||
{
|
{
|
||||||
HRESULT ret= E_FAIL;
|
HRESULT ret= E_FAIL;
|
||||||
if( !m_xOrigin.is())
|
if( !m_xOrigin.is())
|
||||||
@@ -175,21 +175,21 @@ STDMETHODIMP InterfaceOleWrapper_Impl::getOriginalUnoStruct( Any * pStruct)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP InterfaceOleWrapper_Impl::GetTypeInfoCount( unsigned int * /*pctinfo*/ )
|
STDMETHODIMP InterfaceOleWrapper::GetTypeInfoCount( unsigned int * /*pctinfo*/ )
|
||||||
{
|
{
|
||||||
return E_NOTIMPL ;
|
return E_NOTIMPL ;
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP InterfaceOleWrapper_Impl::GetTypeInfo(unsigned int /*itinfo*/, LCID /*lcid*/, ITypeInfo ** /*pptinfo*/)
|
STDMETHODIMP InterfaceOleWrapper::GetTypeInfo(unsigned int /*itinfo*/, LCID /*lcid*/, ITypeInfo ** /*pptinfo*/)
|
||||||
{
|
{
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP InterfaceOleWrapper_Impl::GetIDsOfNames(REFIID /*riid*/,
|
STDMETHODIMP InterfaceOleWrapper::GetIDsOfNames(REFIID /*riid*/,
|
||||||
OLECHAR ** rgszNames,
|
OLECHAR ** rgszNames,
|
||||||
unsigned int cNames,
|
unsigned int cNames,
|
||||||
LCID /*lcid*/,
|
LCID /*lcid*/,
|
||||||
DISPID * rgdispid )
|
DISPID * rgdispid )
|
||||||
{
|
{
|
||||||
HRESULT ret = DISP_E_UNKNOWNNAME;
|
HRESULT ret = DISP_E_UNKNOWNNAME;
|
||||||
try
|
try
|
||||||
@@ -312,7 +312,7 @@ STDMETHODIMP InterfaceOleWrapper_Impl::GetIDsOfNames(REFIID /*riid*/,
|
|||||||
// A JScriptValue (ValueObject) object is a COM object in that it implements IDispatch and the
|
// A JScriptValue (ValueObject) object is a COM object in that it implements IDispatch and the
|
||||||
// IJScriptValue object interface. Such objects are provided by all UNO wrapper
|
// IJScriptValue object interface. Such objects are provided by all UNO wrapper
|
||||||
// objects used within a JScript script. To obtain an instance one has to call
|
// objects used within a JScript script. To obtain an instance one has to call
|
||||||
// "_GetValueObject() or Bridge_GetValueObject()" on an UNO wrapper object (class InterfaceOleWrapper_Impl).
|
// "_GetValueObject() or Bridge_GetValueObject()" on an UNO wrapper object (class InterfaceOleWrapper).
|
||||||
// A value object is appropriately initialized within the script and passed as
|
// A value object is appropriately initialized within the script and passed as
|
||||||
// parameter to an UNO object method or property. The convertDispparamsArgs function
|
// parameter to an UNO object method or property. The convertDispparamsArgs function
|
||||||
// can easily find out that a param is such an object by querying for the
|
// can easily find out that a param is such an object by querying for the
|
||||||
@@ -324,7 +324,7 @@ STDMETHODIMP InterfaceOleWrapper_Impl::GetIDsOfNames(REFIID /*riid*/,
|
|||||||
// Normal JScript object parameter can be mixed with JScriptValue object. If an
|
// Normal JScript object parameter can be mixed with JScriptValue object. If an
|
||||||
// VARIANT contains an VT_DISPATCH that is no JScriptValue than the type information
|
// VARIANT contains an VT_DISPATCH that is no JScriptValue than the type information
|
||||||
// is used to find out about the required type.
|
// is used to find out about the required type.
|
||||||
void InterfaceOleWrapper_Impl::convertDispparamsArgs(DISPID id,
|
void InterfaceOleWrapper::convertDispparamsArgs(DISPID id,
|
||||||
unsigned short /*wFlags*/, DISPPARAMS* pdispparams, Sequence<Any>& rSeq)
|
unsigned short /*wFlags*/, DISPPARAMS* pdispparams, Sequence<Any>& rSeq)
|
||||||
{
|
{
|
||||||
HRESULT hr= S_OK;
|
HRESULT hr= S_OK;
|
||||||
@@ -341,7 +341,7 @@ void InterfaceOleWrapper_Impl::convertDispparamsArgs(DISPID id,
|
|||||||
InvocationInfo info;
|
InvocationInfo info;
|
||||||
if( ! getInvocationInfoForCall( id, info))
|
if( ! getInvocationInfoForCall( id, info))
|
||||||
throw BridgeRuntimeError(
|
throw BridgeRuntimeError(
|
||||||
"[automation bridge]InterfaceOleWrapper_Impl::convertDispparamsArgs \n"
|
"[automation bridge]InterfaceOleWrapper::convertDispparamsArgs \n"
|
||||||
"Could not obtain type information for current call.");
|
"Could not obtain type information for current call.");
|
||||||
|
|
||||||
for (int i = 0; i < countArgs; i++)
|
for (int i = 0; i < countArgs; i++)
|
||||||
@@ -406,7 +406,7 @@ void InterfaceOleWrapper_Impl::convertDispparamsArgs(DISPID id,
|
|||||||
}// end for / iterating over all parameters
|
}// end for / iterating over all parameters
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InterfaceOleWrapper_Impl::getInvocationInfoForCall( DISPID id, InvocationInfo& info)
|
bool InterfaceOleWrapper::getInvocationInfoForCall( DISPID id, InvocationInfo& info)
|
||||||
{
|
{
|
||||||
bool bTypesAvailable= false;
|
bool bTypesAvailable= false;
|
||||||
|
|
||||||
@@ -463,11 +463,11 @@ bool InterfaceOleWrapper_Impl::getInvocationInfoForCall( DISPID id, InvocationI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// XBridgeSupplier2 ---------------------------------------------------
|
// XBridgeSupplier2 ---------------------------------------------------
|
||||||
// only bridges itself ( this instance of InterfaceOleWrapper_Impl)from UNO to IDispatch
|
// only bridges itself ( this instance of InterfaceOleWrapper)from UNO to IDispatch
|
||||||
// If sourceModelType is UNO than any UNO interface implemented by InterfaceOleWrapper_Impl
|
// If sourceModelType is UNO than any UNO interface implemented by InterfaceOleWrapper
|
||||||
// can bridged to IDispatch ( if destModelType == OLE). The IDispatch is
|
// can bridged to IDispatch ( if destModelType == OLE). The IDispatch is
|
||||||
// implemented by this class.
|
// implemented by this class.
|
||||||
Any SAL_CALL InterfaceOleWrapper_Impl::createBridge(const Any& modelDepObject,
|
Any SAL_CALL InterfaceOleWrapper::createBridge(const Any& modelDepObject,
|
||||||
const Sequence<sal_Int8>& /*ProcessId*/,
|
const Sequence<sal_Int8>& /*ProcessId*/,
|
||||||
sal_Int16 sourceModelType,
|
sal_Int16 sourceModelType,
|
||||||
sal_Int16 destModelType)
|
sal_Int16 destModelType)
|
||||||
@@ -499,7 +499,7 @@ Any SAL_CALL InterfaceOleWrapper_Impl::createBridge(const Any& modelDepObject,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// XInitialization --------------------------------------------------
|
// XInitialization --------------------------------------------------
|
||||||
void SAL_CALL InterfaceOleWrapper_Impl::initialize( const Sequence< Any >& aArguments )
|
void SAL_CALL InterfaceOleWrapper::initialize( const Sequence< Any >& aArguments )
|
||||||
{
|
{
|
||||||
switch( aArguments.getLength() )
|
switch( aArguments.getLength() )
|
||||||
{
|
{
|
||||||
@@ -517,16 +517,16 @@ void SAL_CALL InterfaceOleWrapper_Impl::initialize( const Sequence< Any >& aArgu
|
|||||||
m_xExactName.set( m_xInvocation, UNO_QUERY);
|
m_xExactName.set( m_xInvocation, UNO_QUERY);
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference< XInterface > InterfaceOleWrapper_Impl::createUnoWrapperInstance()
|
Reference< XInterface > InterfaceOleWrapper::createUnoWrapperInstance()
|
||||||
{
|
{
|
||||||
Reference<XWeak> xWeak= static_cast<XWeak*>( new InterfaceOleWrapper_Impl(
|
Reference<XWeak> xWeak= static_cast<XWeak*>( new InterfaceOleWrapper(
|
||||||
m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
|
m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
|
||||||
return Reference<XInterface>( xWeak, UNO_QUERY);
|
return Reference<XInterface>( xWeak, UNO_QUERY);
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference<XInterface> InterfaceOleWrapper_Impl::createComWrapperInstance()
|
Reference<XInterface> InterfaceOleWrapper::createComWrapperInstance()
|
||||||
{
|
{
|
||||||
Reference<XWeak> xWeak= static_cast<XWeak*>( new IUnknownWrapper_Impl(
|
Reference<XWeak> xWeak= static_cast<XWeak*>( new IUnknownWrapper(
|
||||||
m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
|
m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
|
||||||
return Reference<XInterface>( xWeak, UNO_QUERY);
|
return Reference<XInterface>( xWeak, UNO_QUERY);
|
||||||
}
|
}
|
||||||
@@ -776,14 +776,14 @@ static bool writeBackOutParameter(VARIANTARG* pDest, VARIANT* pSource)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP InterfaceOleWrapper_Impl::Invoke(DISPID dispidMember,
|
STDMETHODIMP InterfaceOleWrapper::Invoke(DISPID dispidMember,
|
||||||
REFIID /*riid*/,
|
REFIID /*riid*/,
|
||||||
LCID /*lcid*/,
|
LCID /*lcid*/,
|
||||||
unsigned short wFlags,
|
unsigned short wFlags,
|
||||||
DISPPARAMS * pdispparams,
|
DISPPARAMS * pdispparams,
|
||||||
VARIANT * pvarResult,
|
VARIANT * pvarResult,
|
||||||
EXCEPINFO * pexcepinfo,
|
EXCEPINFO * pexcepinfo,
|
||||||
unsigned int * puArgErr )
|
unsigned int * puArgErr )
|
||||||
{
|
{
|
||||||
comphelper::ProfileZone aZone("COM Bridge");
|
comphelper::ProfileZone aZone("COM Bridge");
|
||||||
HRESULT ret = S_OK;
|
HRESULT ret = S_OK;
|
||||||
@@ -861,14 +861,14 @@ STDMETHODIMP InterfaceOleWrapper_Impl::Invoke(DISPID dispidMember,
|
|||||||
}
|
}
|
||||||
catch(const Exception& e)
|
catch(const Exception& e)
|
||||||
{
|
{
|
||||||
OUString message= "InterfaceOleWrapper_Impl::Invoke : \n" +
|
OUString message= "InterfaceOleWrapper::Invoke : \n" +
|
||||||
e.Message;
|
e.Message;
|
||||||
writeExcepinfo(pexcepinfo, message);
|
writeExcepinfo(pexcepinfo, message);
|
||||||
ret = DISP_E_EXCEPTION;
|
ret = DISP_E_EXCEPTION;
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
OUString message= "InterfaceOleWrapper_Impl::Invoke : \n"
|
OUString message= "InterfaceOleWrapper::Invoke : \n"
|
||||||
"Unexpected exception";
|
"Unexpected exception";
|
||||||
writeExcepinfo(pexcepinfo, message);
|
writeExcepinfo(pexcepinfo, message);
|
||||||
ret = DISP_E_EXCEPTION;
|
ret = DISP_E_EXCEPTION;
|
||||||
@@ -877,7 +877,7 @@ STDMETHODIMP InterfaceOleWrapper_Impl::Invoke(DISPID dispidMember,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT InterfaceOleWrapper_Impl::doInvoke( DISPPARAMS * pdispparams, VARIANT * pvarResult,
|
HRESULT InterfaceOleWrapper::doInvoke( DISPPARAMS * pdispparams, VARIANT * pvarResult,
|
||||||
EXCEPINFO * pexcepinfo, unsigned int * puArgErr, OUString& name, Sequence<Any>& params)
|
EXCEPINFO * pexcepinfo, unsigned int * puArgErr, OUString& name, Sequence<Any>& params)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -954,14 +954,14 @@ HRESULT InterfaceOleWrapper_Impl::doInvoke( DISPPARAMS * pdispparams, VARIANT *
|
|||||||
}
|
}
|
||||||
catch(const Exception & e)
|
catch(const Exception & e)
|
||||||
{
|
{
|
||||||
OUString message= "InterfaceOleWrapper_Impl::doInvoke : \n" +
|
OUString message= "InterfaceOleWrapper::doInvoke : \n" +
|
||||||
e.Message;
|
e.Message;
|
||||||
writeExcepinfo(pexcepinfo, message);
|
writeExcepinfo(pexcepinfo, message);
|
||||||
ret = DISP_E_EXCEPTION;
|
ret = DISP_E_EXCEPTION;
|
||||||
}
|
}
|
||||||
catch( ... )
|
catch( ... )
|
||||||
{
|
{
|
||||||
OUString message= "InterfaceOleWrapper_Impl::doInvoke : \n"
|
OUString message= "InterfaceOleWrapper::doInvoke : \n"
|
||||||
"Unexpected exception";
|
"Unexpected exception";
|
||||||
writeExcepinfo(pexcepinfo, message);
|
writeExcepinfo(pexcepinfo, message);
|
||||||
ret = DISP_E_EXCEPTION;
|
ret = DISP_E_EXCEPTION;
|
||||||
@@ -969,8 +969,8 @@ HRESULT InterfaceOleWrapper_Impl::doInvoke( DISPPARAMS * pdispparams, VARIANT *
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT InterfaceOleWrapper_Impl::doGetProperty( DISPPARAMS * /*pdispparams*/, VARIANT * pvarResult,
|
HRESULT InterfaceOleWrapper::doGetProperty( DISPPARAMS * /*pdispparams*/, VARIANT * pvarResult,
|
||||||
EXCEPINFO * pexcepinfo, OUString& name)
|
EXCEPINFO * pexcepinfo, OUString& name)
|
||||||
{
|
{
|
||||||
HRESULT ret= S_OK;
|
HRESULT ret= S_OK;
|
||||||
|
|
||||||
@@ -993,13 +993,13 @@ HRESULT InterfaceOleWrapper_Impl::doGetProperty( DISPPARAMS * /*pdispparams*/, V
|
|||||||
}
|
}
|
||||||
catch(const Exception& e)
|
catch(const Exception& e)
|
||||||
{
|
{
|
||||||
OUString message= "InterfaceOleWrapper_Impl::doGetProperty : \n" +
|
OUString message= "InterfaceOleWrapper::doGetProperty : \n" +
|
||||||
e.Message;
|
e.Message;
|
||||||
writeExcepinfo(pexcepinfo, message);
|
writeExcepinfo(pexcepinfo, message);
|
||||||
}
|
}
|
||||||
catch( ... )
|
catch( ... )
|
||||||
{
|
{
|
||||||
OUString message= "InterfaceOleWrapper_Impl::doInvoke : \n"
|
OUString message= "InterfaceOleWrapper::doInvoke : \n"
|
||||||
"Unexpected exception";
|
"Unexpected exception";
|
||||||
writeExcepinfo(pexcepinfo, message);
|
writeExcepinfo(pexcepinfo, message);
|
||||||
ret = DISP_E_EXCEPTION;
|
ret = DISP_E_EXCEPTION;
|
||||||
@@ -1007,7 +1007,7 @@ HRESULT InterfaceOleWrapper_Impl::doGetProperty( DISPPARAMS * /*pdispparams*/, V
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT InterfaceOleWrapper_Impl::doSetProperty( DISPPARAMS * /*pdispparams*/, VARIANT * /*pvarResult*/,
|
HRESULT InterfaceOleWrapper::doSetProperty( DISPPARAMS * /*pdispparams*/, VARIANT * /*pvarResult*/,
|
||||||
EXCEPINFO * pexcepinfo, unsigned int * puArgErr, OUString& name, Sequence<Any> const & params)
|
EXCEPINFO * pexcepinfo, unsigned int * puArgErr, OUString& name, Sequence<Any> const & params)
|
||||||
{
|
{
|
||||||
HRESULT ret= S_OK;
|
HRESULT ret= S_OK;
|
||||||
@@ -1044,7 +1044,7 @@ HRESULT InterfaceOleWrapper_Impl::doSetProperty( DISPPARAMS * /*pdispparams*/, V
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT InterfaceOleWrapper_Impl::InvokeGeneral( DISPID dispidMember, unsigned short wFlags,
|
HRESULT InterfaceOleWrapper::InvokeGeneral( DISPID dispidMember, unsigned short wFlags,
|
||||||
DISPPARAMS * pdispparams, VARIANT * pvarResult, EXCEPINFO * pexcepinfo,
|
DISPPARAMS * pdispparams, VARIANT * pvarResult, EXCEPINFO * pexcepinfo,
|
||||||
unsigned int * /*puArgErr*/, bool& bHandled)
|
unsigned int * /*puArgErr*/, bool& bHandled)
|
||||||
{
|
{
|
||||||
@@ -1135,7 +1135,7 @@ HRESULT InterfaceOleWrapper_Impl::InvokeGeneral( DISPID dispidMember, unsigned s
|
|||||||
|
|
||||||
if (!createUnoTypeWrapper(arg.bstrVal, pvarResult))
|
if (!createUnoTypeWrapper(arg.bstrVal, pvarResult))
|
||||||
{
|
{
|
||||||
writeExcepinfo(pexcepinfo, "[automation bridge] InterfaceOleWrapper_Impl::InvokeGeneral\n"
|
writeExcepinfo(pexcepinfo, "[automation bridge] InterfaceOleWrapper::InvokeGeneral\n"
|
||||||
"Could not initialize UnoTypeWrapper object!");
|
"Could not initialize UnoTypeWrapper object!");
|
||||||
return DISP_E_EXCEPTION;
|
return DISP_E_EXCEPTION;
|
||||||
}
|
}
|
||||||
@@ -1148,14 +1148,14 @@ HRESULT InterfaceOleWrapper_Impl::InvokeGeneral( DISPID dispidMember, unsigned s
|
|||||||
}
|
}
|
||||||
catch(const Exception & e)
|
catch(const Exception & e)
|
||||||
{
|
{
|
||||||
OUString message= "InterfaceOleWrapper_Impl::InvokeGeneral : \n" +
|
OUString message= "InterfaceOleWrapper::InvokeGeneral : \n" +
|
||||||
e.Message;
|
e.Message;
|
||||||
writeExcepinfo(pexcepinfo, message);
|
writeExcepinfo(pexcepinfo, message);
|
||||||
ret = DISP_E_EXCEPTION;
|
ret = DISP_E_EXCEPTION;
|
||||||
}
|
}
|
||||||
catch( ... )
|
catch( ... )
|
||||||
{
|
{
|
||||||
OUString message= "InterfaceOleWrapper_Impl::InvokeGeneral : \n"
|
OUString message= "InterfaceOleWrapper::InvokeGeneral : \n"
|
||||||
"Unexpected exception";
|
"Unexpected exception";
|
||||||
writeExcepinfo(pexcepinfo, message);
|
writeExcepinfo(pexcepinfo, message);
|
||||||
ret = DISP_E_EXCEPTION;
|
ret = DISP_E_EXCEPTION;
|
||||||
@@ -1163,12 +1163,12 @@ HRESULT InterfaceOleWrapper_Impl::InvokeGeneral( DISPID dispidMember, unsigned s
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP InterfaceOleWrapper_Impl::GetDispID(BSTR /*bstrName*/, DWORD /*grfdex*/, DISPID __RPC_FAR* /*pid*/)
|
STDMETHODIMP InterfaceOleWrapper::GetDispID(BSTR /*bstrName*/, DWORD /*grfdex*/, DISPID __RPC_FAR* /*pid*/)
|
||||||
{
|
{
|
||||||
return ResultFromScode(E_NOTIMPL);
|
return ResultFromScode(E_NOTIMPL);
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP InterfaceOleWrapper_Impl::InvokeEx(
|
STDMETHODIMP InterfaceOleWrapper::InvokeEx(
|
||||||
/* [in] */ DISPID /*id*/,
|
/* [in] */ DISPID /*id*/,
|
||||||
/* [in] */ LCID /*lcid*/,
|
/* [in] */ LCID /*lcid*/,
|
||||||
/* [in] */ WORD /*wFlags*/,
|
/* [in] */ WORD /*wFlags*/,
|
||||||
@@ -1180,19 +1180,19 @@ STDMETHODIMP InterfaceOleWrapper_Impl::InvokeEx(
|
|||||||
return ResultFromScode(E_NOTIMPL);
|
return ResultFromScode(E_NOTIMPL);
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP InterfaceOleWrapper_Impl::DeleteMemberByName(
|
STDMETHODIMP InterfaceOleWrapper::DeleteMemberByName(
|
||||||
/* [in] */ BSTR /*bstr*/,
|
/* [in] */ BSTR /*bstr*/,
|
||||||
/* [in] */ DWORD /*grfdex*/)
|
/* [in] */ DWORD /*grfdex*/)
|
||||||
{
|
{
|
||||||
return ResultFromScode(E_NOTIMPL);
|
return ResultFromScode(E_NOTIMPL);
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP InterfaceOleWrapper_Impl::DeleteMemberByDispID(DISPID /*id*/)
|
STDMETHODIMP InterfaceOleWrapper::DeleteMemberByDispID(DISPID /*id*/)
|
||||||
{
|
{
|
||||||
return ResultFromScode(E_NOTIMPL);
|
return ResultFromScode(E_NOTIMPL);
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP InterfaceOleWrapper_Impl::GetMemberProperties(
|
STDMETHODIMP InterfaceOleWrapper::GetMemberProperties(
|
||||||
/* [in] */ DISPID /*id*/,
|
/* [in] */ DISPID /*id*/,
|
||||||
/* [in] */ DWORD /*grfdexFetch*/,
|
/* [in] */ DWORD /*grfdexFetch*/,
|
||||||
/* [out] */ DWORD __RPC_FAR* /*pgrfdex*/)
|
/* [out] */ DWORD __RPC_FAR* /*pgrfdex*/)
|
||||||
@@ -1200,14 +1200,14 @@ STDMETHODIMP InterfaceOleWrapper_Impl::GetMemberProperties(
|
|||||||
return ResultFromScode(E_NOTIMPL);
|
return ResultFromScode(E_NOTIMPL);
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP InterfaceOleWrapper_Impl::GetMemberName(
|
STDMETHODIMP InterfaceOleWrapper::GetMemberName(
|
||||||
/* [in] */ DISPID /*id*/,
|
/* [in] */ DISPID /*id*/,
|
||||||
/* [out] */ BSTR __RPC_FAR* /*pbstrName*/)
|
/* [out] */ BSTR __RPC_FAR* /*pbstrName*/)
|
||||||
{
|
{
|
||||||
return ResultFromScode(E_NOTIMPL);
|
return ResultFromScode(E_NOTIMPL);
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP InterfaceOleWrapper_Impl::GetNextDispID(
|
STDMETHODIMP InterfaceOleWrapper::GetNextDispID(
|
||||||
/* [in] */ DWORD /*grfdex*/,
|
/* [in] */ DWORD /*grfdex*/,
|
||||||
/* [in] */ DISPID /*id*/,
|
/* [in] */ DISPID /*id*/,
|
||||||
/* [out] */ DISPID __RPC_FAR* /*pid*/)
|
/* [out] */ DISPID __RPC_FAR* /*pid*/)
|
||||||
@@ -1215,7 +1215,7 @@ STDMETHODIMP InterfaceOleWrapper_Impl::GetNextDispID(
|
|||||||
return ResultFromScode(E_NOTIMPL);
|
return ResultFromScode(E_NOTIMPL);
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP InterfaceOleWrapper_Impl::GetNameSpaceParent(
|
STDMETHODIMP InterfaceOleWrapper::GetNameSpaceParent(
|
||||||
/* [out] */ IUnknown __RPC_FAR *__RPC_FAR* /*ppunk*/)
|
/* [out] */ IUnknown __RPC_FAR *__RPC_FAR* /*ppunk*/)
|
||||||
{
|
{
|
||||||
return ResultFromScode(E_NOTIMPL);
|
return ResultFromScode(E_NOTIMPL);
|
||||||
@@ -1225,7 +1225,7 @@ STDMETHODIMP InterfaceOleWrapper_Impl::GetNameSpaceParent(
|
|||||||
|
|
||||||
UnoObjectWrapperRemoteOpt::UnoObjectWrapperRemoteOpt( Reference<XMultiServiceFactory> const & aFactory,
|
UnoObjectWrapperRemoteOpt::UnoObjectWrapperRemoteOpt( Reference<XMultiServiceFactory> const & aFactory,
|
||||||
sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass):
|
sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass):
|
||||||
InterfaceOleWrapper_Impl( aFactory, unoWrapperClass, comWrapperClass),
|
InterfaceOleWrapper( aFactory, unoWrapperClass, comWrapperClass),
|
||||||
m_currentId(1)
|
m_currentId(1)
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -1600,7 +1600,7 @@ static HRESULT mapCannotConvertException(const CannotConvertException &e, unsign
|
|||||||
// object. If a client asks the object for DISPID_VALUE and this
|
// object. If a client asks the object for DISPID_VALUE and this
|
||||||
// function returned VT_DISPATCH then the IDispatch of the same
|
// function returned VT_DISPATCH then the IDispatch of the same
|
||||||
// object is being returned.
|
// object is being returned.
|
||||||
// See InterfaceOleWrapper_Impl::Invoke, InterfaceOleWrapper_Impl::m_defaultValueType
|
// See InterfaceOleWrapper::Invoke, InterfaceOleWrapper::m_defaultValueType
|
||||||
VARTYPE getVarType( const Any& value)
|
VARTYPE getVarType( const Any& value)
|
||||||
{
|
{
|
||||||
VARTYPE ret= VT_EMPTY;
|
VARTYPE ret= VT_EMPTY;
|
||||||
|
@@ -46,23 +46,6 @@ using namespace cppu;
|
|||||||
using namespace com::sun::star::bridge;
|
using namespace com::sun::star::bridge;
|
||||||
using namespace com::sun::star::script;
|
using namespace com::sun::star::script;
|
||||||
|
|
||||||
struct hash_IUnknown_Impl
|
|
||||||
{
|
|
||||||
size_t operator()(const IUnknown* p) const
|
|
||||||
{
|
|
||||||
return reinterpret_cast<size_t>(p);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct equal_to_IUnknown_Impl
|
|
||||||
{
|
|
||||||
bool operator()(const IUnknown* s1, const IUnknown* s2) const
|
|
||||||
{
|
|
||||||
return s1 == s2;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct MemberInfo
|
struct MemberInfo
|
||||||
{
|
{
|
||||||
MemberInfo() : flags(0), name() {}
|
MemberInfo() : flags(0), name() {}
|
||||||
@@ -90,16 +73,16 @@ typedef std::unordered_map
|
|||||||
MemberInfo
|
MemberInfo
|
||||||
> IdToMemberInfoMap;
|
> IdToMemberInfoMap;
|
||||||
|
|
||||||
class InterfaceOleWrapper_Impl : public WeakImplHelper<XBridgeSupplier2, XInitialization>,
|
class InterfaceOleWrapper : public WeakImplHelper<XBridgeSupplier2, XInitialization>,
|
||||||
public IDispatchEx,
|
public IDispatchEx,
|
||||||
public UnoConversionUtilities<InterfaceOleWrapper_Impl>,
|
public UnoConversionUtilities<InterfaceOleWrapper>,
|
||||||
public IUnoObjectWrapper
|
public IUnoObjectWrapper
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
InterfaceOleWrapper_Impl(Reference<XMultiServiceFactory> const & xFactory, sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass);
|
InterfaceOleWrapper(Reference<XMultiServiceFactory> const & xFactory, sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass);
|
||||||
~InterfaceOleWrapper_Impl() override;
|
~InterfaceOleWrapper() override;
|
||||||
|
|
||||||
/* IUnknown methods */
|
/* IUnknown methods */
|
||||||
STDMETHOD(QueryInterface)(REFIID riid, LPVOID FAR * ppvObj) override;
|
STDMETHOD(QueryInterface)(REFIID riid, LPVOID FAR * ppvObj) override;
|
||||||
@@ -205,7 +188,7 @@ protected:
|
|||||||
// and put a wrapped object on index null. The array object tries
|
// and put a wrapped object on index null. The array object tries
|
||||||
// to detect the default value. The wrapped object must then return
|
// to detect the default value. The wrapped object must then return
|
||||||
// its own IDispatch* otherwise we cannot access it within the script.
|
// its own IDispatch* otherwise we cannot access it within the script.
|
||||||
// see InterfaceOleWrapper_Impl::Invoke
|
// see InterfaceOleWrapper::Invoke
|
||||||
VARTYPE m_defaultValueType;
|
VARTYPE m_defaultValueType;
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -223,7 +206,7 @@ protected:
|
|||||||
in a MemberInfo structure hold by a IdToMemberInfoMap stl map.
|
in a MemberInfo structure hold by a IdToMemberInfoMap stl map.
|
||||||
|
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
class UnoObjectWrapperRemoteOpt: public InterfaceOleWrapper_Impl
|
class UnoObjectWrapperRemoteOpt: public InterfaceOleWrapper
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
UnoObjectWrapperRemoteOpt( Reference<XMultiServiceFactory> const & aFactory, sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass);
|
UnoObjectWrapperRemoteOpt( Reference<XMultiServiceFactory> const & aFactory, sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass);
|
||||||
|
Reference in New Issue
Block a user