Kaydet (Commit) a48f22db 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>
üst 851064d1
......@@ -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.
// 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.
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:
IUnknownWrapper_Impl(Reference<XMultiServiceFactory> const &xFactory,
sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass);
IUnknownWrapper(Reference<XMultiServiceFactory> const &xFactory,
sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass);
~IUnknownWrapper_Impl() override;
~IUnknownWrapper() override;
//XInterface
Any SAL_CALL queryInterface(const Type& t) override;
......
......@@ -44,7 +44,7 @@ Reference<XInterface> OleServer_CreateInstance( const Reference<XMultiServiceFac
IClassFactoryWrapper
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.
*****************************************************************************/
......@@ -62,7 +62,7 @@ protected:
/*****************************************************************************
ProviderOleWrapper_Impl
ProviderOleWrapper
Provides an UNO service provider as OLE class factory. Handle the
OLE registration by overriding the abstract methods from
......@@ -74,13 +74,13 @@ protected:
*****************************************************************************/
class ProviderOleWrapper_Impl : public IClassFactoryWrapper
class ProviderOleWrapper : public IClassFactoryWrapper
{
public:
ProviderOleWrapper_Impl( const Reference<XMultiServiceFactory>& smgr,
const Reference<XSingleServiceFactory>& xSFactory, GUID const * pGuid);
virtual ~ProviderOleWrapper_Impl();
ProviderOleWrapper( const Reference<XMultiServiceFactory>& smgr,
const Reference<XSingleServiceFactory>& xSFactory, GUID const * pGuid);
virtual ~ProviderOleWrapper();
bool registerClass() override;
bool deregisterClass() override;
......@@ -106,7 +106,7 @@ protected:
/*****************************************************************************
OneInstanceOleWrapper_Impl
OneInstanceOleWrapper
Provides an single UNO object as OLE object. Handle the
OLE registration by overriding the abstract methods from
......@@ -117,12 +117,12 @@ protected:
*****************************************************************************/
class OneInstanceOleWrapper_Impl : public IClassFactoryWrapper
class OneInstanceOleWrapper : public IClassFactoryWrapper
{
public:
OneInstanceOleWrapper_Impl( const Reference<XMultiServiceFactory>& smgr, const Reference<XInterface>& xInst, GUID const * pGuid );
virtual ~OneInstanceOleWrapper_Impl();
OneInstanceOleWrapper( const Reference<XMultiServiceFactory>& smgr, const Reference<XInterface>& xInst, GUID const * pGuid );
virtual ~OneInstanceOleWrapper();
bool registerClass() override;
bool deregisterClass() override;
......@@ -149,22 +149,21 @@ protected:
// Implementation of the UNO service com.sun.star.bridge.OleBridgeSupplier2.
// This class realizes the service com.sun.star.bridge.OleBridgeSupplier2 and
// com.sun.star.bridge.OleBridgeSupplierVar1. The class implements XBridgeSupplier2
// instead of XBridgeSuppplier as done by class OleConverter_Impl. The XBridgeSupplier2
// com.sun.star.bridge.OleBridgeSupplierVar1. The class implements XBridgeSupplier2 which
// 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
// 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
// latter for OleBridgeSupplierVar1.
// The m_nComWrapperClass specifies the class which is used as wrapper for COM interfaces.
// Currently there is only one class available ( IUnknownWrapper_Impl).
class OleConverter_Impl2 : public WeakImplHelper<XBridgeSupplier2, XInitialization, css::lang::XServiceInfo>,
public UnoConversionUtilities<OleConverter_Impl2>
// Currently there is only one class available (IUnknownWrapper).
class OleConverter : public WeakImplHelper<XBridgeSupplier2, XInitialization, css::lang::XServiceInfo>,
public UnoConversionUtilities<OleConverter>
{
public:
explicit OleConverter_Impl2( const Reference<XMultiServiceFactory>& smgr);
OleConverter_Impl2( const Reference<XMultiServiceFactory>& smgr, sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass );
virtual ~OleConverter_Impl2() override;
explicit OleConverter( const Reference<XMultiServiceFactory>& smgr);
OleConverter( const Reference<XMultiServiceFactory>& smgr, sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass );
virtual ~OleConverter() override;
// XBridgeSupplier2 ---------------------------------------------------
......@@ -191,12 +190,12 @@ protected:
// Implementation of the UNO service com.sun.star.bridge.OleObjectFactory.
class OleClient_Impl : public WeakImplHelper<XMultiServiceFactory, css::lang::XServiceInfo>,
public UnoConversionUtilities<OleClient_Impl>
class OleClient : public WeakImplHelper<XMultiServiceFactory, css::lang::XServiceInfo>,
public UnoConversionUtilities<OleClient>
{
public:
explicit OleClient_Impl( const Reference<XMultiServiceFactory>& smgr);
~OleClient_Impl() override;
explicit OleClient( const Reference<XMultiServiceFactory>& smgr);
~OleClient() override;
// XMultiServiceFactory
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.
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:
explicit OleServer_Impl( const Reference<XMultiServiceFactory> &smgr);
~OleServer_Impl() override;
explicit OleServer( const Reference<XMultiServiceFactory> &smgr);
~OleServer() override;
OUString SAL_CALL getImplementationName() override;
......
......@@ -27,25 +27,25 @@ using namespace cppu;
Reference<XInterface> ConverterProvider_CreateInstance2( const Reference<XMultiServiceFactory> & xSMgr)
{
Reference<XInterface> xService = *new OleConverter_Impl2( xSMgr);
Reference<XInterface> xService = *new OleConverter( xSMgr);
return xService;
}
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;
}
Reference<XInterface> OleClient_CreateInstance( const Reference<XMultiServiceFactory> & xSMgr)
{
Reference<XInterface> xService = *new OleClient_Impl( xSMgr);
Reference<XInterface> xService = *new OleClient( xSMgr);
return xService;
}
Reference<XInterface> OleServer_CreateInstance( const Reference<XMultiServiceFactory> & xSMgr)
{
Reference<XInterface > xService = *new OleServer_Impl(xSMgr);
Reference<XInterface > xService = *new OleServer(xSMgr);
return xService;
}
......
......@@ -70,7 +70,7 @@ extern std::unordered_map<sal_uIntPtr, sal_uIntPtr> WrapperToAdapterMap;
extern std::unordered_map<sal_uIntPtr, WeakReference<XInterface> > ComPtrToWrapperMap;
// 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
// 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
......@@ -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
// #define) property. That property contains all names of interfaces.
// "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
// "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
......
......@@ -46,23 +46,6 @@ using namespace cppu;
using namespace com::sun::star::bridge;
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
{
MemberInfo() : flags(0), name() {}
......@@ -90,16 +73,16 @@ typedef std::unordered_map
MemberInfo
> IdToMemberInfoMap;
class InterfaceOleWrapper_Impl : public WeakImplHelper<XBridgeSupplier2, XInitialization>,
public IDispatchEx,
public UnoConversionUtilities<InterfaceOleWrapper_Impl>,
public IUnoObjectWrapper
class InterfaceOleWrapper : public WeakImplHelper<XBridgeSupplier2, XInitialization>,
public IDispatchEx,
public UnoConversionUtilities<InterfaceOleWrapper>,
public IUnoObjectWrapper
{
public:
InterfaceOleWrapper_Impl(Reference<XMultiServiceFactory> const & xFactory, sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass);
~InterfaceOleWrapper_Impl() override;
InterfaceOleWrapper(Reference<XMultiServiceFactory> const & xFactory, sal_uInt8 unoWrapperClass, sal_uInt8 comWrapperClass);
~InterfaceOleWrapper() override;
/* IUnknown methods */
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
// to detect the default value. The wrapped object must then return
// its own IDispatch* otherwise we cannot access it within the script.
// see InterfaceOleWrapper_Impl::Invoke
// see InterfaceOleWrapper::Invoke
VARTYPE m_defaultValueType;
};
......@@ -223,7 +206,7 @@ protected:
in a MemberInfo structure hold by a IdToMemberInfoMap stl map.
*****************************************************************************/
class UnoObjectWrapperRemoteOpt: public InterfaceOleWrapper_Impl
class UnoObjectWrapperRemoteOpt: public InterfaceOleWrapper
{
public:
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