Kaydet (Commit) 0f106de7 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

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/54411Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
(cherry picked from commit a48f22db)
üst af747df3
...@@ -53,16 +53,16 @@ typedef std::unordered_multimap<OUString, unsigned int> TLBFuncIndexMap; ...@@ -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;
......
...@@ -44,7 +44,7 @@ Reference<XInterface> SAL_CALL OleServer_CreateInstance( const Reference<XMultiS ...@@ -44,7 +44,7 @@ Reference<XInterface> SAL_CALL OleServer_CreateInstance( const Reference<XMultiS
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: ...@@ -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: ...@@ -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: ...@@ -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: ...@@ -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: ...@@ -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: ...@@ -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: ...@@ -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: ...@@ -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; ...@@ -27,25 +27,25 @@ using namespace cppu;
Reference<XInterface> SAL_CALL ConverterProvider_CreateInstance2( const Reference<XMultiServiceFactory> & xSMgr) Reference<XInterface> SAL_CALL 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> SAL_CALL ConverterProvider_CreateInstanceVar1( const Reference<XMultiServiceFactory> & xSMgr) Reference<XInterface> SAL_CALL 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> SAL_CALL OleClient_CreateInstance( const Reference<XMultiServiceFactory> & xSMgr) Reference<XInterface> SAL_CALL 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> SAL_CALL OleServer_CreateInstance( const Reference<XMultiServiceFactory> & xSMgr) Reference<XInterface> SAL_CALL 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; ...@@ -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 ...@@ -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
......
...@@ -46,23 +46,6 @@ using namespace cppu; ...@@ -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 ...@@ -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: ...@@ -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: ...@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment