From 7bad59533d506d58fb350f883c4deb67d7c011c5 Mon Sep 17 00:00:00 2001 From: Gabor Kelemen Date: Wed, 6 Feb 2019 20:59:05 +0100 Subject: tdf#42949 Fix IWYU warnings in cppuhelper/ Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I0eebd82b96d630da0597166cf87d398072607c13 Reviewed-on: https://gerrit.libreoffice.org/67473 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- cppuhelper/IwyuFilter_cppuhelper.yaml | 48 ++++++++++++++++++++++ cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx | 4 -- cppuhelper/qa/unourl/cppu_unourl.cxx | 3 -- cppuhelper/source/bootstrap.cxx | 7 ++-- cppuhelper/source/compat.cxx | 2 - cppuhelper/source/component.cxx | 2 - cppuhelper/source/component_context.cxx | 3 -- cppuhelper/source/defaultbootstrap.cxx | 4 +- cppuhelper/source/exc_thrower.cxx | 1 - cppuhelper/source/factory.cxx | 3 -- cppuhelper/source/findsofficepath.c | 1 - cppuhelper/source/implbase.cxx | 3 -- cppuhelper/source/implbase_ex.cxx | 6 --- cppuhelper/source/interfacecontainer.cxx | 1 - .../source/loadsharedlibcomponentfactory.hxx | 1 - cppuhelper/source/macro_expander.cxx | 2 - cppuhelper/source/macro_expander.hxx | 2 - cppuhelper/source/paths.cxx | 3 -- cppuhelper/source/paths.hxx | 2 +- cppuhelper/source/propertysetmixin.cxx | 3 -- cppuhelper/source/propshlp.cxx | 1 - cppuhelper/source/servicemanager.cxx | 2 - cppuhelper/source/servicemanager.hxx | 8 ++-- cppuhelper/source/tdmgr.cxx | 4 -- cppuhelper/source/typemanager.cxx | 3 -- cppuhelper/source/typemanager.hxx | 8 ---- cppuhelper/source/unourl.cxx | 1 - cppuhelper/source/weak.cxx | 6 ++- 28 files changed, 63 insertions(+), 71 deletions(-) create mode 100644 cppuhelper/IwyuFilter_cppuhelper.yaml (limited to 'cppuhelper') diff --git a/cppuhelper/IwyuFilter_cppuhelper.yaml b/cppuhelper/IwyuFilter_cppuhelper.yaml new file mode 100644 index 000000000000..323b866061b5 --- /dev/null +++ b/cppuhelper/IwyuFilter_cppuhelper.yaml @@ -0,0 +1,48 @@ +--- +assumeFilename: cppuhelper/source/implbase.cxx +blacklist: + cppuhelper/source/typemanager.hxx: + # base class needs full type + - com/sun/star/container/XHierarchicalNameAccess.hpp + - com/sun/star/container/XSet.hpp + - com/sun/star/lang/XServiceInfo.hpp + - com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp + - cppuhelper/compbase.hxx + cppuhelper/source/access_control.cxx: + # Needed for UnoType + - com/sun/star/security/RuntimePermission.hpp + - com/sun/star/io/FilePermission.hpp + - com/sun/star/connection/SocketPermission.hpp + cppuhelper/source/bootstrap.cxx: + # Needed on win32 + - o3tl/char16_t2wchar_t.hxx + cppuhelper/source/defaultbootstrap.cxx: + # Needed for template specialization + - com/sun/star/lang/XSingleComponentFactory.hpp + cppuhelper/source/exc_thrower.cxx: + # No hpp -> hdl switch + - cppuhelper/detail/XExceptionThrower.hpp + # Needed for cppu::throwException + - cppuhelper/exc_hlp.hxx + cppuhelper/source/findsofficepath.c: + # Needed for cppuhelper_detail_findSofficePath + - cppuhelper/findsofficepath.h + cppuhelper/source/macro_expander.cxx: + # Needed for template specialization + - com/sun/star/lang/XSingleComponentFactory.hpp + cppuhelper/source/paths.cxx: + # Needed on mac OS for LIBO_LIB_FOLDER + LIBO_URE_ETC_FOLDER + - config_folders.h + cppuhelper/source/shlib.cxx: + # Needed for UnoType + - com/sun/star/registry/XRegistryKey.hpp + # Needed for loadSharedLibComponentFactory & writeSharedLibComponentInfo + - cppuhelper/shlib.hxx + # Needed for cppuhelper::detail::getEnvironment + - loadsharedlibcomponentfactory.hxx + cppuhelper/source/supportsservice.cxx: + # Needed for supportsService + - cppuhelper/supportsservice.hxx + cppuhelper/source/tdmgr.cxx: + # Needed to inherit linker visibility from function declaration + - cppuhelper/bootstrap.hxx diff --git a/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx b/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx index 5df856146063..e7727cc5f2ce 100644 --- a/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx +++ b/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx @@ -19,14 +19,12 @@ #include -#include #include #include #include #include #include -#include #include #include @@ -34,8 +32,6 @@ using namespace com::sun::star; using namespace com::sun::star::uno; using namespace com::sun::star::lang; -class ContainerListener; - struct ContainerStats { int m_nAlive; int m_nDisposed; diff --git a/cppuhelper/qa/unourl/cppu_unourl.cxx b/cppuhelper/qa/unourl/cppu_unourl.cxx index 0be49fc427cd..1a9ba70f7231 100644 --- a/cppuhelper/qa/unourl/cppu_unourl.cxx +++ b/cppuhelper/qa/unourl/cppu_unourl.cxx @@ -23,9 +23,6 @@ #include #include -#include -#include -#include #include #include diff --git a/cppuhelper/source/bootstrap.cxx b/cppuhelper/source/bootstrap.cxx index 1eb11bfb486e..34ae38823bec 100644 --- a/cppuhelper/source/bootstrap.cxx +++ b/cppuhelper/source/bootstrap.cxx @@ -22,27 +22,26 @@ #include #include -#include #include #include -#include #include #include #include #include #include #include +#include #include #include -#include - #include #include #include "macro_expander.hxx" +namespace com :: sun :: star :: uno { class XComponentContext; } + using namespace ::osl; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; diff --git a/cppuhelper/source/compat.cxx b/cppuhelper/source/compat.cxx index a019626f4a6a..600cb369c2b5 100644 --- a/cppuhelper/source/compat.cxx +++ b/cppuhelper/source/compat.cxx @@ -21,7 +21,6 @@ #include -#include #include #include #include @@ -43,7 +42,6 @@ namespace com { namespace sun { namespace star { class XInterface; } } } } -namespace rtl { class OUString; } // Stubs for removed functionality, to be killed when we bump cppuhelper SONAME diff --git a/cppuhelper/source/component.cxx b/cppuhelper/source/component.cxx index 02019d53f254..c88713287c38 100644 --- a/cppuhelper/source/component.cxx +++ b/cppuhelper/source/component.cxx @@ -17,12 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include #include #include #include #include -#include #include #include #include diff --git a/cppuhelper/source/component_context.cxx b/cppuhelper/source/component_context.cxx index b2c4cf4d5112..e278302fbfcc 100644 --- a/cppuhelper/source/component_context.cxx +++ b/cppuhelper/source/component_context.cxx @@ -22,7 +22,6 @@ #include #include -#include #include #include @@ -30,11 +29,9 @@ #include #include -#include #include #include -#include #include #include #include diff --git a/cppuhelper/source/defaultbootstrap.cxx b/cppuhelper/source/defaultbootstrap.cxx index 945268bf6444..fe971f0c139d 100644 --- a/cppuhelper/source/defaultbootstrap.cxx +++ b/cppuhelper/source/defaultbootstrap.cxx @@ -15,10 +15,10 @@ #include #include #include -#include #include #include #include +#include #include #include #include @@ -28,6 +28,8 @@ #include "servicemanager.hxx" #include "typemanager.hxx" +namespace com :: sun :: star :: uno { class XComponentContext; } + namespace { OUString getBootstrapVariable( diff --git a/cppuhelper/source/exc_thrower.cxx b/cppuhelper/source/exc_thrower.cxx index 5770bf50aa21..edf7b8948728 100644 --- a/cppuhelper/source/exc_thrower.cxx +++ b/cppuhelper/source/exc_thrower.cxx @@ -20,7 +20,6 @@ #include #include -#include #include #include #include diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx index c993de1ac0bc..43e469d57121 100644 --- a/cppuhelper/source/factory.cxx +++ b/cppuhelper/source/factory.cxx @@ -21,14 +21,11 @@ #include #include #include -#include #include #include #include #include #include -#include -#include #include #include diff --git a/cppuhelper/source/findsofficepath.c b/cppuhelper/source/findsofficepath.c index f91f753c61eb..75d370981968 100644 --- a/cppuhelper/source/findsofficepath.c +++ b/cppuhelper/source/findsofficepath.c @@ -115,7 +115,6 @@ static wchar_t* platformSpecific() #else -#include #include /* diff --git a/cppuhelper/source/implbase.cxx b/cppuhelper/source/implbase.cxx index f5242bf054f3..554520ac8196 100644 --- a/cppuhelper/source/implbase.cxx +++ b/cppuhelper/source/implbase.cxx @@ -21,10 +21,7 @@ #include #include #include -#include -#include -#include #include #include diff --git a/cppuhelper/source/implbase_ex.cxx b/cppuhelper/source/implbase_ex.cxx index 4372630a81a4..d46f40ddb9b4 100644 --- a/cppuhelper/source/implbase_ex.cxx +++ b/cppuhelper/source/implbase_ex.cxx @@ -17,13 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include - -#include #include -#include -#include -#include #include #include #include diff --git a/cppuhelper/source/interfacecontainer.cxx b/cppuhelper/source/interfacecontainer.cxx index fbf6b4066208..175526945e21 100644 --- a/cppuhelper/source/interfacecontainer.cxx +++ b/cppuhelper/source/interfacecontainer.cxx @@ -19,7 +19,6 @@ #include -#include #include #include diff --git a/cppuhelper/source/loadsharedlibcomponentfactory.hxx b/cppuhelper/source/loadsharedlibcomponentfactory.hxx index f496d61e687f..9e870f459455 100644 --- a/cppuhelper/source/loadsharedlibcomponentfactory.hxx +++ b/cppuhelper/source/loadsharedlibcomponentfactory.hxx @@ -23,7 +23,6 @@ namespace com { namespace sun { namespace star { class XInterface; } } } } -namespace rtl { class OUString; } namespace cppuhelper { namespace detail { diff --git a/cppuhelper/source/macro_expander.cxx b/cppuhelper/source/macro_expander.cxx index a147d03a3e0d..47c324fa1902 100644 --- a/cppuhelper/source/macro_expander.cxx +++ b/cppuhelper/source/macro_expander.cxx @@ -25,13 +25,11 @@ #include #include -#include #include #include #include #include -#include #include "macro_expander.hxx" #include "paths.hxx" diff --git a/cppuhelper/source/macro_expander.hxx b/cppuhelper/source/macro_expander.hxx index dc753de9663a..b0762330c325 100644 --- a/cppuhelper/source/macro_expander.hxx +++ b/cppuhelper/source/macro_expander.hxx @@ -23,12 +23,10 @@ #include #include -#include namespace com { namespace sun { namespace star { namespace lang { class XSingleComponentFactory; } } } } -namespace rtl { class OUString; } namespace cppuhelper { diff --git a/cppuhelper/source/paths.cxx b/cppuhelper/source/paths.cxx index 7ddd8b72d379..49144f715e54 100644 --- a/cppuhelper/source/paths.cxx +++ b/cppuhelper/source/paths.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include #include #include @@ -25,10 +24,8 @@ #include #include -#include #include #include -#include #include #include diff --git a/cppuhelper/source/paths.hxx b/cppuhelper/source/paths.hxx index f757d906b171..baad8c68c4ac 100644 --- a/cppuhelper/source/paths.hxx +++ b/cppuhelper/source/paths.hxx @@ -21,9 +21,9 @@ #define INCLUDED_CPPUHELPER_SOURCE_PATHS_HXX #include +#include namespace osl { class Directory; } -namespace rtl { class OUString; } namespace cppu { diff --git a/cppuhelper/source/propertysetmixin.cxx b/cppuhelper/source/propertysetmixin.cxx index d04119cafe5b..4c31beaa286d 100644 --- a/cppuhelper/source/propertysetmixin.cxx +++ b/cppuhelper/source/propertysetmixin.cxx @@ -21,7 +21,6 @@ #include #include -#include #include #include #include @@ -57,8 +56,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx index a7a0f93a396a..bd1cbe62a62a 100644 --- a/cppuhelper/source/propshlp.cxx +++ b/cppuhelper/source/propshlp.cxx @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx index f6295f3a8edb..68db3c102329 100644 --- a/cppuhelper/source/servicemanager.cxx +++ b/cppuhelper/source/servicemanager.cxx @@ -33,13 +33,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include diff --git a/cppuhelper/source/servicemanager.hxx b/cppuhelper/source/servicemanager.hxx index 3d8a265aa750..d72b46f0d0a0 100644 --- a/cppuhelper/source/servicemanager.hxx +++ b/cppuhelper/source/servicemanager.hxx @@ -26,20 +26,20 @@ #include #include #include -#include -#include #include #include #include #include -#include #include -#include namespace com { namespace sun { namespace star { namespace lang { class XSingleComponentFactory; } } } } namespace cppu { struct ContextEntry_Init; } +namespace com :: sun :: star :: lang { class XSingleServiceFactory; } +namespace com :: sun :: star :: uno { class XComponentContext; } + +class RegistryKey; namespace cppuhelper { diff --git a/cppuhelper/source/tdmgr.cxx b/cppuhelper/source/tdmgr.cxx index a6336cab7833..288ac9bb6653 100644 --- a/cppuhelper/source/tdmgr.cxx +++ b/cppuhelper/source/tdmgr.cxx @@ -23,10 +23,7 @@ #include -#include - #include -#include #include #include @@ -48,7 +45,6 @@ #include #include #include -#include #include diff --git a/cppuhelper/source/typemanager.cxx b/cppuhelper/source/typemanager.cxx index a3153b7d6606..9faf4d0b2de0 100644 --- a/cppuhelper/source/typemanager.cxx +++ b/cppuhelper/source/typemanager.cxx @@ -17,10 +17,8 @@ #include #include -#include #include #include -#include #include #include #include @@ -49,7 +47,6 @@ #include #include #include -#include #include #include #include diff --git a/cppuhelper/source/typemanager.hxx b/cppuhelper/source/typemanager.hxx index f2784aa0ea59..1547a5c0c21d 100644 --- a/cppuhelper/source/typemanager.hxx +++ b/cppuhelper/source/typemanager.hxx @@ -12,18 +12,12 @@ #include -#include -#include #include #include -#include #include -#include -#include #include #include #include -#include #include #include #include @@ -31,10 +25,8 @@ #include namespace com { namespace sun { namespace star { - namespace uno { class Any; } namespace reflection { class XTypeDescription; } } } } -namespace rtl { class OUString; } namespace unoidl { class ConstantGroupEntity; class Entity; diff --git a/cppuhelper/source/unourl.cxx b/cppuhelper/source/unourl.cxx index c01c83cfa6dd..8ee7e593ad20 100644 --- a/cppuhelper/source/unourl.cxx +++ b/cppuhelper/source/unourl.cxx @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx index d93cf4d0a7a8..57f22880adfc 100644 --- a/cppuhelper/source/weak.cxx +++ b/cppuhelper/source/weak.cxx @@ -20,14 +20,16 @@ #include #include +#include #include #include -#include #include #include +#include + #include -#include +#include using namespace osl; using namespace com::sun::star::uno; -- cgit