summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-07-30 15:21:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-30 17:34:39 +0200
commit0c1b49048f1127d352b43847353392f0512f19e3 (patch)
tree81bbe680c12a5a1fa5e4c98f73881ca14e4fc1e2 /include
parent64cf52d47968d512afd383ce9a7321a4bd72b2ca (diff)
loplugin:unusedmethods
and tweak the plugin a little to speed it up Change-Id: Ia59456232602184c4f1b5d1d75ad94a9a2e2d0be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99799 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/comphelper/componentmodule.hxx43
-rw-r--r--include/comphelper/servicedecl.hxx179
-rw-r--r--include/sfx2/sfxmodelfactory.hxx23
-rw-r--r--include/vbahelper/helperdecl.hxx40
4 files changed, 0 insertions, 285 deletions
diff --git a/include/comphelper/componentmodule.hxx b/include/comphelper/componentmodule.hxx
index 78d71138d519..1d52cfd067b9 100644
--- a/include/comphelper/componentmodule.hxx
+++ b/include/comphelper/componentmodule.hxx
@@ -34,45 +34,6 @@ namespace comphelper
{
- /** factory declaration
- */
- typedef css::uno::Reference< css::lang::XSingleComponentFactory > (*FactoryInstantiation)
- (
- ::cppu::ComponentFactoryFunc _pFactoryFunc,
- OUString const& _rComponentName,
- css::uno::Sequence< OUString > const & _rServiceNames,
- rtl_ModuleCount*
- );
-
-
- //= ComponentDescription
-
- struct COMPHELPER_DLLPUBLIC ComponentDescription
- {
- /// the implementation name of the component
- OUString const sImplementationName;
- /// the services supported by the component implementation
- css::uno::Sequence< OUString > const aSupportedServices;
- /// the function to create an instance of the component
- ::cppu::ComponentFactoryFunc const pComponentCreationFunc;
- /// the function to create a factory for the component (usually <code>::cppu::createSingleComponentFactory</code>)
- FactoryInstantiation const pFactoryCreationFunc;
-
- ComponentDescription(
- const OUString& _rImplementationName,
- const css::uno::Sequence< OUString >& _rSupportedServices,
- ::cppu::ComponentFactoryFunc _pComponentCreationFunc,
- FactoryInstantiation _pFactoryCreationFunc
- )
- :sImplementationName( _rImplementationName )
- ,aSupportedServices( _rSupportedServices )
- ,pComponentCreationFunc( _pComponentCreationFunc )
- ,pFactoryCreationFunc( _pFactoryCreationFunc )
- {
- }
- };
-
-
//= OModule
class OModuleImpl;
@@ -89,10 +50,6 @@ namespace comphelper
virtual ~OModule();
- /** registers a component given by ComponentDescription
- */
- void registerImplementation( const ComponentDescription& _rComp );
-
private:
OModule( const OModule& ) = delete;
OModule& operator=( const OModule& ) = delete;
diff --git a/include/comphelper/servicedecl.hxx b/include/comphelper/servicedecl.hxx
index 8a25d8e5a911..6cd24699cd2b 100644
--- a/include/comphelper/servicedecl.hxx
+++ b/include/comphelper/servicedecl.hxx
@@ -140,188 +140,9 @@ template <bool> struct with_args;
/// @internal
namespace detail {
-template <typename ImplT>
-class OwnServiceImpl
- : public ImplT
-{
- typedef ImplT BaseT;
-
-public:
- OwnServiceImpl( const OwnServiceImpl& ) = delete;
- OwnServiceImpl& operator=( const OwnServiceImpl& ) = delete;
- OwnServiceImpl(
- ServiceDecl const& rServiceDecl,
- css::uno::Sequence<css::uno::Any> const& args,
- css::uno::Reference<css::uno::XComponentContext> const& xContext )
- :BaseT(args, xContext), m_rServiceDecl(rServiceDecl) {}
- OwnServiceImpl(
- ServiceDecl const& rServiceDecl,
- css::uno::Reference<css::uno::XComponentContext> const& xContext )
- : BaseT(xContext), m_rServiceDecl(rServiceDecl) {}
-
- // XServiceInfo
- virtual OUString SAL_CALL getImplementationName() override {
- return m_rServiceDecl.getImplementationName();
- }
- virtual sal_Bool SAL_CALL supportsService( OUString const& name ) override {
- return m_rServiceDecl.supportsService(name);
- }
- virtual css::uno::Sequence< OUString>
- SAL_CALL getSupportedServiceNames() override {
- return m_rServiceDecl.getSupportedServiceNames();
- }
-
-private:
- ServiceDecl const& m_rServiceDecl;
-};
-
-template <typename ImplT>
-class ServiceImpl final : public OwnServiceImpl< ::cppu::ImplInheritanceHelper<ImplT,css::lang::XServiceInfo> >
-{
-typedef OwnServiceImpl< ::cppu::ImplInheritanceHelper<ImplT,css::lang::XServiceInfo> > ServiceImpl_BASE;
-public:
- ServiceImpl(
- ServiceDecl const& rServiceDecl,
- css::uno::Sequence<css::uno::Any> const& args,
- css::uno::Reference<css::uno::XComponentContext> const& xContext )
- : ServiceImpl_BASE(rServiceDecl, args, xContext) {}
- ServiceImpl(
- ServiceDecl const& rServiceDecl,
- css::uno::Reference<css::uno::XComponentContext> const& xContext )
- : ServiceImpl_BASE(rServiceDecl, xContext) {}
-};
-
-template <typename ImplT>
-class InheritingServiceImpl final : public OwnServiceImpl< ImplT >
-{
-typedef OwnServiceImpl< ImplT > ServiceImpl_BASE;
-public:
- InheritingServiceImpl(
- ServiceDecl const& rServiceDecl,
- css::uno::Sequence<css::uno::Any> const& args,
- css::uno::Reference<css::uno::XComponentContext> const& xContext )
- : ServiceImpl_BASE(rServiceDecl, args, xContext) {}
-};
-
-template <typename ServiceImplT>
-struct PostProcessDefault {
- css::uno::Reference<css::uno::XInterface>
- operator()( ServiceImplT * p ) const {
- return static_cast<css::lang::XServiceInfo *>(p);
- }
-};
-
-template <typename ImplT, typename PostProcessFuncT, typename WithArgsT>
-struct CreateFunc;
-
-template <typename ImplT, typename PostProcessFuncT>
-struct CreateFunc<ImplT, PostProcessFuncT, with_args<false> > {
- PostProcessFuncT const m_postProcessFunc;
- explicit CreateFunc( PostProcessFuncT const& postProcessFunc )
- : m_postProcessFunc(postProcessFunc) {}
-
- css::uno::Reference<css::uno::XInterface>
- operator()( ServiceDecl const& rServiceDecl,
- css::uno::Sequence<css::uno::Any> const&,
- css::uno::Reference<css::uno::XComponentContext>
- const& xContext ) const
- {
- return m_postProcessFunc(
- new ImplT( rServiceDecl, xContext ) );
- }
-};
-
-template <typename ImplT, typename PostProcessFuncT>
-struct CreateFunc<ImplT, PostProcessFuncT, with_args<true> > {
- PostProcessFuncT const m_postProcessFunc;
- explicit CreateFunc( PostProcessFuncT const& postProcessFunc )
- : m_postProcessFunc(postProcessFunc) {}
-
- css::uno::Reference<css::uno::XInterface>
- operator()( ServiceDecl const& rServiceDecl,
- css::uno::Sequence<css::uno::Any> const& args,
- css::uno::Reference<css::uno::XComponentContext>
- const& xContext ) const
- {
- return m_postProcessFunc(
- new ImplT( rServiceDecl, args, xContext ) );
- }
-};
} // namespace detail
-/** Defines a service implementation class.
-
- @tpl ImplT_ service implementation class
- @WithArgsT whether the implementation class ctor expects arguments
- (uno::Sequence<uno::Any>, uno::Reference<uno::XComponentContext>)
- or just (uno::Reference<uno::XComponentContext>)
-*/
-template <typename ImplT_, typename WithArgsT = with_args<false> >
-struct serviceimpl_base {
- typedef ImplT_ ImplT;
-
- detail::CreateFuncF const m_createFunc;
-
- typedef detail::PostProcessDefault<ImplT> PostProcessDefaultT;
-
- /** Default ctor. Implementation class without args, expecting
- component context as single argument.
- */
- serviceimpl_base() : m_createFunc(
- detail::CreateFunc<ImplT, PostProcessDefaultT, WithArgsT>(
- PostProcessDefaultT() ) ) {}
-
- /** Ctor to pass a post processing function/functor.
-
- @tpl PostProcessDefaultT let your compiler deduce this
- @param postProcessFunc function/functor that gets the yet unacquired
- ImplT_ pointer returning a
- uno::Reference<uno::XInterface>
- */
- template <typename PostProcessFuncT>
- explicit serviceimpl_base( PostProcessFuncT const& postProcessFunc )
- : m_createFunc( detail::CreateFunc<ImplT, PostProcessFuncT, WithArgsT>(
- postProcessFunc ) ) {}
-};
-
-template <typename ImplT_, typename WithArgsT = with_args<false> >
-struct class_ : public serviceimpl_base< detail::ServiceImpl<ImplT_>, WithArgsT >
-{
- typedef serviceimpl_base< detail::ServiceImpl<ImplT_>, WithArgsT > baseT;
- /** Default ctor. Implementation class without args, expecting
- component context as single argument.
- */
- class_() : baseT() {}
- template <typename PostProcessFuncT>
- /** Ctor to pass a post processing function/functor.
-
- @tpl PostProcessDefaultT let your compiler deduce this
- @param postProcessFunc function/functor that gets the yet unacquired
- ImplT_ pointer returning a
- uno::Reference<uno::XInterface>
- */
- explicit class_( PostProcessFuncT const& postProcessFunc ) : baseT( postProcessFunc ) {}
-};
-
-template <typename ImplT_, typename WithArgsT = with_args<false> >
-struct inheritingClass_ : public serviceimpl_base< detail::InheritingServiceImpl<ImplT_>, WithArgsT >
-{
- typedef serviceimpl_base< detail::InheritingServiceImpl<ImplT_>, WithArgsT > baseT;
- /** Default ctor. Implementation class without args, expecting
- component context as single argument.
- */
- inheritingClass_() : baseT() {}
- template <typename PostProcessFuncT>
- /** Ctor to pass a post processing function/functor.
-
- @tpl PostProcessDefaultT let your compiler deduce this
- @param postProcessFunc function/functor that gets the yet unacquired
- ImplT_ pointer returning a
- uno::Reference<uno::XInterface>
- */
- explicit inheritingClass_( PostProcessFuncT const& postProcessFunc ) : baseT( postProcessFunc ) {}
-};
COMPHELPER_DLLPUBLIC
void* component_getFactoryHelper( const char* pImplName,
diff --git a/include/sfx2/sfxmodelfactory.hxx b/include/sfx2/sfxmodelfactory.hxx
index 1096eca788b1..4d166c4d4eed 100644
--- a/include/sfx2/sfxmodelfactory.hxx
+++ b/include/sfx2/sfxmodelfactory.hxx
@@ -47,29 +47,6 @@ namespace o3tl
namespace sfx2
{
- typedef css::uno::Reference< css::uno::XInterface > ( * SfxModelFactoryFunc ) (
- const css::uno::Reference< css::lang::XMultiServiceFactory >& _rxFactory,
- SfxModelFlags _nCreationFlags
- );
-
-
- //= createSfxModelFactory
-
- /** creates a XSingleServiceFactory which can be used to created instances
- of classes derived from SfxBaseModel
-
- In opposite to the default implementations from module cppuhelper, this
- factory evaluates certain creation arguments (passed to createInstanceWithArguments)
- and passes them to the factory function of the derived class.
- */
- css::uno::Reference< css::lang::XSingleServiceFactory >
- SFX2_DLLPUBLIC createSfxModelFactory(
- const css::uno::Reference< css::lang::XMultiServiceFactory >& _rxServiceFactory,
- const OUString& _rImplementationName,
- const SfxModelFactoryFunc _pComponentFactoryFunc,
- const css::uno::Sequence< OUString >& _rServiceNames
- );
-
/**
* Intended to be called from UNO constructor functions
* This evaluates certain creation arguments (passed to createInstanceWithArguments)
diff --git a/include/vbahelper/helperdecl.hxx b/include/vbahelper/helperdecl.hxx
deleted file mode 100644
index 4d46d4ea1a4a..000000000000
--- a/include/vbahelper/helperdecl.hxx
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_VBAHELPER_HELPERDECL_HXX
-#define INCLUDED_VBAHELPER_HELPERDECL_HXX
-
-#include <comphelper/servicedecl.hxx>
-
-namespace comphelper::service_decl {
-template <typename ImplT_, typename WithArgsT = with_args<false> >
-struct vba_service_class_ : public serviceimpl_base< detail::OwnServiceImpl<ImplT_>, WithArgsT >
-{
- typedef serviceimpl_base< detail::OwnServiceImpl<ImplT_>, WithArgsT > baseT;
- /** Default ctor. Implementation class without args, expecting
- component context as single argument.
- */
- vba_service_class_() : baseT() {}
-};
-
-} // namespace comphelper::service_decl
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */