summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorGabor Kelemen <kelemen.gabor2@nisz.hu>2019-05-12 02:20:12 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-05-20 10:33:01 +0200
commit62605b16b0fd6a4a9429b8b185242f91eae67581 (patch)
tree72dde847e0603d4e954eff3de35a936c896b209a /stoc
parentde91b7772d18b3584b48f47e21adc142c6289cf0 (diff)
tdf#42949 Fix IWYU warnings in stoc/
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I3c1b091d30449243faec3f875e6f0ac6d8b34259 Reviewed-on: https://gerrit.libreoffice.org/72214 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'stoc')
-rw-r--r--stoc/IwyuFilter_stoc.yaml40
-rw-r--r--stoc/source/corereflection/base.hxx14
-rw-r--r--stoc/source/corereflection/crarray.cxx1
-rw-r--r--stoc/source/corereflection/crbase.cxx1
-rw-r--r--stoc/source/corereflection/crcomp.cxx2
-rw-r--r--stoc/source/corereflection/crefl.cxx5
-rw-r--r--stoc/source/corereflection/crenum.cxx3
-rw-r--r--stoc/source/corereflection/criface.cxx6
-rw-r--r--stoc/source/corereflection/lrucache.hxx3
-rw-r--r--stoc/source/defaultregistry/defaultregistry.cxx10
-rw-r--r--stoc/source/implementationregistration/implreg.cxx12
-rw-r--r--stoc/source/implementationregistration/mergekeys.cxx1
-rw-r--r--stoc/source/implementationregistration/mergekeys.hxx4
-rw-r--r--stoc/source/inspect/introspection.cxx10
-rw-r--r--stoc/source/invocation/invocation.cxx6
-rw-r--r--stoc/source/invocation_adapterfactory/iafactory.cxx4
-rw-r--r--stoc/source/javaloader/javaloader.cxx12
-rw-r--r--stoc/source/javavm/interact.cxx5
-rw-r--r--stoc/source/javavm/interact.hxx1
-rw-r--r--stoc/source/javavm/javavm.cxx12
-rw-r--r--stoc/source/javavm/javavm.hxx2
-rw-r--r--stoc/source/loader/dllcomponentloader.cxx12
-rw-r--r--stoc/source/namingservice/namingservice.cxx5
-rw-r--r--stoc/source/proxy_factory/proxyfac.cxx2
-rw-r--r--stoc/source/security/access_controller.cxx3
-rw-r--r--stoc/source/security/file_policy.cxx3
-rw-r--r--stoc/source/security/permissions.cxx3
-rw-r--r--stoc/source/security/permissions.h5
-rw-r--r--stoc/source/servicemanager/servicemanager.cxx11
-rw-r--r--stoc/source/simpleregistry/simpleregistry.cxx3
-rw-r--r--stoc/source/typeconv/convert.cxx10
-rw-r--r--stoc/source/uriproc/ExternalUriReferenceTranslator.cxx8
-rw-r--r--stoc/source/uriproc/UriReference.cxx1
-rw-r--r--stoc/source/uriproc/UriReference.hxx1
-rw-r--r--stoc/source/uriproc/UriReferenceFactory.cxx1
-rw-r--r--stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx12
-rw-r--r--stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx9
-rw-r--r--stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx8
38 files changed, 91 insertions, 160 deletions
diff --git a/stoc/IwyuFilter_stoc.yaml b/stoc/IwyuFilter_stoc.yaml
new file mode 100644
index 000000000000..fbcc14b78052
--- /dev/null
+++ b/stoc/IwyuFilter_stoc.yaml
@@ -0,0 +1,40 @@
+---
+assumeFilename: stoc/source/javavm/javavm.cxx
+blacklist:
+ stoc/source/implementationregistration/mergekeys.hxx:
+ # Needed for css shortcut
+ - sal/types.h
+ stoc/source/javavm/interact.hxx:
+ # Base class needs complete type
+ - com/sun/star/task/XInteractionRequest.hpp
+ stoc/source/javavm/javavm.hxx:
+ # Base class needs complete type
+ - com/sun/star/container/XContainerListener.hpp
+ - com/sun/star/lang/XInitialization.hpp
+ - com/sun/star/java/XJavaThreadRegister_11.hpp
+ - com/sun/star/java/XJavaVM.hpp
+ - com/sun/star/lang/XServiceInfo.hpp
+ stoc/source/corereflection/crefl.cxx:
+ # Safer to keep for use in cppu::UnoType template
+ - com/sun/star/reflection/XTypeDescription.hpp
+ stoc/source/corereflection/criface.cxx:
+ # Keep for platform-independent alloca.h abstraction
+ - sal/alloca.h
+ # Safer to keep for use in cppu::UnoType template
+ - com/sun/star/uno/RuntimeException.hpp
+ stoc/source/invocation_adapterfactory/iafactory.cxx:
+ # Safer to keep for use in cppu::UnoType template
+ - com/sun/star/script/XInvocation.hpp
+ stoc/source/loader/dllcomponentloader.cxx:
+ # Needed for direct member access
+ - com/sun/star/lang/XMultiServiceFactory.hpp
+ stoc/source/security/permissions.cxx:
+ # Safer to keep for use in cppu::UnoType template
+ - com/sun/star/security/AllPermission.hpp
+ # Needed for __DIAGNOSE mode
+ - vector
+ - rtl/string.hxx
+ stoc/source/security/access_controller.cxx:
+ # Needed for __DIAGNOSE mode
+ - rtl/ustrbuf.hxx
+ - sal/log.hxx
diff --git a/stoc/source/corereflection/base.hxx b/stoc/source/corereflection/base.hxx
index 23c68aa83583..4f8be7282230 100644
--- a/stoc/source/corereflection/base.hxx
+++ b/stoc/source/corereflection/base.hxx
@@ -24,15 +24,11 @@
#include <sal/config.h>
#include <o3tl/any.hxx>
-#include <osl/diagnose.h>
#include <osl/mutex.hxx>
#include <uno/mapping.hxx>
#include <uno/dispatcher.h>
#include <cppuhelper/implbase.hxx>
-#include <cppuhelper/weak.hxx>
-#include <cppuhelper/factory.hxx>
#include <cppuhelper/component.hxx>
-#include <cppuhelper/typeprovider.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ref.hxx>
@@ -45,15 +41,15 @@
#include <unordered_map>
#include <memory>
-#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/reflection/XIdlClass.hpp>
#include <com/sun/star/reflection/XIdlReflection.hpp>
-#include <com/sun/star/reflection/XIdlField.hpp>
-#include <com/sun/star/reflection/XIdlField2.hpp>
-#include <com/sun/star/reflection/XIdlMethod.hpp>
+
+namespace com::sun::star::uno { class XComponentContext; }
+namespace com::sun::star::reflection { class XIdlClass; }
+namespace com::sun::star::reflection { class XIdlField; }
+namespace com::sun::star::reflection { class XIdlMethod; }
namespace stoc_corefl
{
diff --git a/stoc/source/corereflection/crarray.cxx b/stoc/source/corereflection/crarray.cxx
index 1c6b1692aab1..ad3a4663fc3a 100644
--- a/stoc/source/corereflection/crarray.cxx
+++ b/stoc/source/corereflection/crarray.cxx
@@ -20,6 +20,7 @@
#include <typelib/typedescription.h>
#include <uno/data.h>
#include <cppuhelper/queryinterface.hxx>
+#include <cppuhelper/typeprovider.hxx>
#include "base.hxx"
diff --git a/stoc/source/corereflection/crbase.cxx b/stoc/source/corereflection/crbase.cxx
index 6e84e20e20fe..c179324050c4 100644
--- a/stoc/source/corereflection/crbase.cxx
+++ b/stoc/source/corereflection/crbase.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <cppuhelper/queryinterface.hxx>
#include <uno/any2.h>
#include "base.hxx"
diff --git a/stoc/source/corereflection/crcomp.cxx b/stoc/source/corereflection/crcomp.cxx
index de73774efef8..0e05a88192fb 100644
--- a/stoc/source/corereflection/crcomp.cxx
+++ b/stoc/source/corereflection/crcomp.cxx
@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <rtl/strbuf.hxx>
#include <cppuhelper/queryinterface.hxx>
+#include <cppuhelper/typeprovider.hxx>
#include <com/sun/star/reflection/XIdlField.hpp>
#include <com/sun/star/reflection/XIdlField2.hpp>
diff --git a/stoc/source/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx
index 040080a3ba7c..e76fd1c130fb 100644
--- a/stoc/source/corereflection/crefl.cxx
+++ b/stoc/source/corereflection/crefl.cxx
@@ -18,14 +18,14 @@
*/
#include <cppuhelper/queryinterface.hxx>
-#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <cppuhelper/typeprovider.hxx>
#include <sal/log.hxx>
-#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/reflection/XConstantTypeDescription.hpp>
#include <com/sun/star/reflection/XTypeDescription.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <o3tl/any.hxx>
#include <uno/lbnames.h>
@@ -33,7 +33,6 @@ using namespace css;
using namespace css::uno;
using namespace css::lang;
using namespace css::reflection;
-using namespace css::registry;
using namespace cppu;
using namespace osl;
diff --git a/stoc/source/corereflection/crenum.cxx b/stoc/source/corereflection/crenum.cxx
index 54871195fff8..bbe3fa3e800e 100644
--- a/stoc/source/corereflection/crenum.cxx
+++ b/stoc/source/corereflection/crenum.cxx
@@ -20,6 +20,9 @@
#include "base.hxx"
#include <cppuhelper/queryinterface.hxx>
+#include <cppuhelper/typeprovider.hxx>
+
+#include <com/sun/star/reflection/XIdlField2.hpp>
using namespace css::lang;
using namespace css::reflection;
diff --git a/stoc/source/corereflection/criface.cxx b/stoc/source/corereflection/criface.cxx
index fd0979a64e63..5c4bd80af019 100644
--- a/stoc/source/corereflection/criface.cxx
+++ b/stoc/source/corereflection/criface.cxx
@@ -26,20 +26,18 @@
#ifdef SAL_UNX
#include <sal/alloca.h>
#endif
-#if !(defined(MACOSX) || defined(IOS) || defined(FREEBSD))
-#include <malloc.h>
-#endif
#include <o3tl/any.hxx>
-#include <rtl/alloc.h>
#include <typelib/typedescription.hxx>
#include <uno/data.h>
#include "base.hxx"
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
+#include <com/sun/star/reflection/XIdlField2.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/exc_hlp.hxx>
+#include <cppuhelper/typeprovider.hxx>
using namespace css::lang;
using namespace css::reflection;
diff --git a/stoc/source/corereflection/lrucache.hxx b/stoc/source/corereflection/lrucache.hxx
index f69874c62149..4ed99eaa77b0 100644
--- a/stoc/source/corereflection/lrucache.hxx
+++ b/stoc/source/corereflection/lrucache.hxx
@@ -24,11 +24,12 @@
#include <osl/mutex.hxx>
#include <rtl/ustring.hxx>
-#include <sal/log.hxx>
#include <memory>
#include <unordered_map>
+namespace com::sun::star::uno { class Any; }
+
/** Implementation of a least recently used (lru) cache.
<br>
*/
diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx
index db6327353b53..4e6aa42c6480 100644
--- a/stoc/source/defaultregistry/defaultregistry.cxx
+++ b/stoc/source/defaultregistry/defaultregistry.cxx
@@ -18,23 +18,19 @@
*/
#include <osl/mutex.hxx>
-#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/implbase4.hxx>
-#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <registry/registry.hxx>
#include <rtl/ref.hxx>
#include <com/sun/star/registry/XSimpleRegistry.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XTypeProvider.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
+namespace com::sun::star::uno { class XComponentContext; }
+
using namespace css::uno;
using namespace css::registry;
using namespace css::lang;
@@ -44,8 +40,6 @@ using namespace osl;
namespace {
-class NestedKeyImpl;
-
class NestedRegistryImpl : public WeakAggImplHelper4 < XSimpleRegistry, XInitialization, XServiceInfo, XEnumerationAccess >
{
public:
diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx
index 32c200a2385c..45c8f033f0db 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -17,25 +17,15 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <stdlib.h>
#include <string.h>
#include <vector>
#include <cppuhelper/exc_hlp.hxx>
-#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/implbase.hxx>
-#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <comphelper/sequence.hxx>
-
-#include <uno/mapping.hxx>
-#include <osl/thread.h>
-
-#include <rtl/ref.hxx>
#include <rtl/ustring.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <osl/process.h>
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -52,8 +42,6 @@
#if defined(_WIN32)
#include <io.h>
-#else
-#include <unistd.h>
#endif
diff --git a/stoc/source/implementationregistration/mergekeys.cxx b/stoc/source/implementationregistration/mergekeys.cxx
index b6768dcc7b60..0fddd887d732 100644
--- a/stoc/source/implementationregistration/mergekeys.cxx
+++ b/stoc/source/implementationregistration/mergekeys.cxx
@@ -23,7 +23,6 @@
#include <osl/diagnose.h>
#include <com/sun/star/registry/XRegistryKey.hpp>
-#include <com/sun/star/registry/MergeConflictException.hpp>
#include "mergekeys.hxx"
diff --git a/stoc/source/implementationregistration/mergekeys.hxx b/stoc/source/implementationregistration/mergekeys.hxx
index 33237bcfb0f0..f8bf8e42d65d 100644
--- a/stoc/source/implementationregistration/mergekeys.hxx
+++ b/stoc/source/implementationregistration/mergekeys.hxx
@@ -21,12 +21,12 @@
#define INCLUDED_STOC_SOURCE_IMPLEMENTATIONREGISTRATION_MERGEKEYS_HXX
#include <sal/config.h>
-
-#include <com/sun/star/uno/Reference.hxx>
+#include <sal/types.h>
namespace com { namespace sun { namespace star { namespace registry {
class XRegistryKey;
} } } }
+namespace com::sun::star::uno { template <typename > class Reference; }
namespace stoc_impreg {
diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx
index f8608db19f69..2637c7ede5dc 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -29,25 +29,18 @@
#include <o3tl/any.hxx>
#include <osl/diagnose.h>
#include <osl/mutex.hxx>
-#include <osl/thread.h>
#include <sal/log.hxx>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/weak.hxx>
-#include <cppuhelper/component.hxx>
-#include <cppuhelper/factory.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <cppuhelper/typeprovider.hxx>
#include <comphelper/sequence.hxx>
#include <salhelper/simplereferenceobject.hxx>
-#include <com/sun/star/uno/DeploymentException.hpp>
#include <com/sun/star/lang/NoSuchMethodException.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/reflection/XIdlReflection.hpp>
#include <com/sun/star/reflection/XIdlClass.hpp>
@@ -70,14 +63,12 @@
#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
-#include <rtl/strbuf.hxx>
#include <unordered_map>
using namespace css::uno;
using namespace css::lang;
using namespace css::reflection;
using namespace css::container;
-using namespace css::registry;
using namespace css::beans;
using namespace css::beans::PropertyAttribute;
using namespace css::beans::PropertyConcept;
@@ -158,7 +149,6 @@ typedef std::unordered_map
LowerToExactNameMap;
-class ImplIntrospectionAccess;
class IntrospectionAccessStatic_Impl: public salhelper::SimpleReferenceObject
{
friend class Implementation;
diff --git a/stoc/source/invocation/invocation.cxx b/stoc/source/invocation/invocation.cxx
index 81358c62cd59..8211828f90cf 100644
--- a/stoc/source/invocation/invocation.cxx
+++ b/stoc/source/invocation/invocation.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <osl/mutex.hxx>
#include <comphelper/sequence.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/exc_hlp.hxx>
@@ -25,7 +24,6 @@
#include <cppuhelper/factory.hxx>
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <cppuhelper/typeprovider.hxx>
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/script/CannotConvertException.hpp>
@@ -45,15 +43,11 @@
#include <com/sun/star/beans/MethodConcept.hpp>
#include <com/sun/star/beans/PropertyConcept.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
#include <memory>
#include <vector>
-#include <rtl/ustrbuf.hxx>
-#include <rtl/strbuf.hxx>
#define SERVICENAME "com.sun.star.script.Invocation"
#define IMPLNAME "com.sun.star.comp.stoc.Invocation"
diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx b/stoc/source/invocation_adapterfactory/iafactory.cxx
index e74d27f756a4..855063ebc9c0 100644
--- a/stoc/source/invocation_adapterfactory/iafactory.cxx
+++ b/stoc/source/invocation_adapterfactory/iafactory.cxx
@@ -34,15 +34,11 @@
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <com/sun/star/uno/XAggregation.hpp>
#include <com/sun/star/script/XTypeConverter.hpp>
#include <com/sun/star/script/XInvocationAdapterFactory.hpp>
#include <com/sun/star/script/XInvocationAdapterFactory2.hpp>
#include <com/sun/star/script/XInvocation.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/registry/XSimpleRegistry.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/reflection/InvocationTargetException.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx
index 19dc5d875049..760f6d356a3c 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -17,12 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <cstdarg>
-
-#include <osl/process.h>
-
#include <rtl/process.h>
-#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
#include <uno/environment.h>
@@ -39,8 +34,6 @@
#include <com/sun/star/java/XJavaVM.hpp>
-#include <com/sun/star/lang/XMultiComponentFactory.hpp>
-
#include <jni.h>
#include <cppuhelper/factory.hxx>
@@ -50,14 +43,15 @@
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/loader/XImplementationLoader.hpp>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <jvmaccess/unovirtualmachine.hxx>
#include <jvmaccess/virtualmachine.hxx>
+namespace com::sun::star::registry { class XRegistryKey; }
+
using namespace css::java;
using namespace css::lang;
using namespace css::loader;
diff --git a/stoc/source/javavm/interact.cxx b/stoc/source/javavm/interact.cxx
index a36a3d989b96..58be91615d2f 100644
--- a/stoc/source/javavm/interact.cxx
+++ b/stoc/source/javavm/interact.cxx
@@ -20,14 +20,13 @@
#include "interact.hxx"
-#include <com/sun/star/java/JavaDisabledException.hpp>
-#include <com/sun/star/java/JavaVMCreationFailureException.hpp>
#include <com/sun/star/task/XInteractionAbort.hpp>
#include <com/sun/star/task/XInteractionRetry.hpp>
-#include <com/sun/star/task/XInteractionContinuation.hpp>
#include <cppuhelper/implbase.hxx>
#include <osl/mutex.hxx>
+namespace com::sun::star::task { class XInteractionContinuation; }
+
using stoc_javavm::InteractionRequest;
namespace {
diff --git a/stoc/source/javavm/interact.hxx b/stoc/source/javavm/interact.hxx
index 27afa8b23309..b994c94710f6 100644
--- a/stoc/source/javavm/interact.hxx
+++ b/stoc/source/javavm/interact.hxx
@@ -22,7 +22,6 @@
#include <com/sun/star/task/XInteractionRequest.hpp>
#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <cppuhelper/implbase.hxx>
#include <rtl/ref.hxx>
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index cd6cba4b7ba6..7f253f0ea7eb 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -24,8 +24,6 @@
#include "jvmargs.hxx"
#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/beans/PropertyState.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/container/XContainer.hpp>
#include <com/sun/star/java/JavaNotFoundException.hpp>
#include <com/sun/star/java/InvalidJavaSettingsException.hpp>
@@ -36,7 +34,6 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
-#include <com/sun/star/lang/XSingleComponentFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
@@ -50,7 +47,6 @@
#include <com/sun/star/uno/XCurrentContext.hpp>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/util/theMacroExpander.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
#include <comphelper/propertysequence.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/factory.hxx>
@@ -60,19 +56,11 @@
#include <jvmaccess/classpath.hxx>
#include <jvmaccess/unovirtualmachine.hxx>
#include <jvmaccess/virtualmachine.hxx>
-#include <osl/file.hxx>
-#include <osl/thread.h>
-#include <rtl/bootstrap.hxx>
#include <rtl/process.h>
-#include <rtl/string.h>
-#include <rtl/ustrbuf.hxx>
-#include <rtl/ustring.h>
#include <rtl/ustring.hxx>
-#include <rtl/uri.hxx>
#include <sal/types.h>
#include <sal/log.hxx>
#include <uno/current_context.hxx>
-#include <uno/environment.h>
#include <jvmfwk/framework.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <jni.h>
diff --git a/stoc/source/javavm/javavm.hxx b/stoc/source/javavm/javavm.hxx
index 50c0dfbee940..63a9c55d1cf4 100644
--- a/stoc/source/javavm/javavm.hxx
+++ b/stoc/source/javavm/javavm.hxx
@@ -20,7 +20,7 @@
#ifndef INCLUDED_STOC_SOURCE_JAVAVM_JAVAVM_HXX
#define INCLUDED_STOC_SOURCE_JAVAVM_JAVAVM_HXX
-#include "jvmargs.hxx"
+#include <jni.h>
#include <com/sun/star/container/XContainerListener.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
diff --git a/stoc/source/loader/dllcomponentloader.cxx b/stoc/source/loader/dllcomponentloader.cxx
index a5c96a957452..1935271d536c 100644
--- a/stoc/source/loader/dllcomponentloader.cxx
+++ b/stoc/source/loader/dllcomponentloader.cxx
@@ -18,20 +18,11 @@
*/
-#include <stdlib.h>
-#include <osl/file.h>
-#include <vector>
#include <osl/diagnose.h>
-#include <osl/module.h>
-#include <rtl/ref.hxx>
#include <rtl/ustring.hxx>
-#include <uno/environment.h>
-#include <uno/mapping.hxx>
-#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/shlib.hxx>
#include <cppuhelper/implbase.hxx>
-#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/bootstrap.hxx>
@@ -39,9 +30,10 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+namespace com::sun::star::registry { class XRegistryKey; }
+
using namespace com::sun::star;
using namespace css::uno;
using namespace css::loader;
diff --git a/stoc/source/namingservice/namingservice.cxx b/stoc/source/namingservice/namingservice.cxx
index daf5e2570141..ddfc1af60a4f 100644
--- a/stoc/source/namingservice/namingservice.cxx
+++ b/stoc/source/namingservice/namingservice.cxx
@@ -19,12 +19,7 @@
#include <osl/mutex.hxx>
-#include <uno/dispatcher.h>
-#include <uno/mapping.hxx>
-#include <cppuhelper/queryinterface.hxx>
-#include <cppuhelper/weak.hxx>
#include <cppuhelper/factory.hxx>
-#include <cppuhelper/component.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/supportsservice.hxx>
diff --git a/stoc/source/proxy_factory/proxyfac.cxx b/stoc/source/proxy_factory/proxyfac.cxx
index d00eb20f2331..f21868b48964 100644
--- a/stoc/source/proxy_factory/proxyfac.cxx
+++ b/stoc/source/proxy_factory/proxyfac.cxx
@@ -20,7 +20,6 @@
#include <osl/diagnose.h>
#include <osl/interlck.h>
-#include <osl/doublecheckedlocking.h>
#include <osl/mutex.hxx>
#include <rtl/ref.hxx>
#include <uno/dispatcher.hxx>
@@ -36,7 +35,6 @@
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/weakagg.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/reflection/XProxyFactory.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx
index 38bf046a4032..534ac99256fe 100644
--- a/stoc/source/security/access_controller.cxx
+++ b/stoc/source/security/access_controller.cxx
@@ -24,7 +24,6 @@
#include <osl/mutex.hxx>
#include <osl/thread.hxx>
-#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
@@ -33,14 +32,12 @@
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/compbase.hxx>
-#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/uno/XCurrentContext.hpp>
#include <com/sun/star/uno/DeploymentException.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/security/XAccessController.hpp>
diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx
index 1cb12c38a45a..70fd16f404d7 100644
--- a/stoc/source/security/file_policy.cxx
+++ b/stoc/source/security/file_policy.cxx
@@ -21,16 +21,13 @@
#include <osl/diagnose.h>
#include <osl/file.h>
#include <rtl/byteseq.hxx>
-#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
#include <cppuhelper/access_control.hxx>
#include <cppuhelper/compbase.hxx>
-#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/security/XAccessController.hpp>
#include <com/sun/star/security/XPolicy.hpp>
#include <com/sun/star/security/AllPermission.hpp>
#include <com/sun/star/security/RuntimePermission.hpp>
diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx
index d871956c1817..92a957cc9a63 100644
--- a/stoc/source/security/permissions.cxx
+++ b/stoc/source/security/permissions.cxx
@@ -26,7 +26,6 @@
#include <rtl/string.hxx>
#include <rtl/ustrbuf.hxx>
-#include <osl/diagnose.h>
#include <sal/log.hxx>
#include <com/sun/star/security/RuntimePermission.hpp>
@@ -34,10 +33,10 @@
#include <com/sun/star/io/FilePermission.hpp>
#include <com/sun/star/connection/SocketPermission.hpp>
#include <com/sun/star/security/AccessControlException.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
#include "permissions.h"
-
using namespace ::std;
using namespace ::osl;
using namespace ::com::sun::star;
diff --git a/stoc/source/security/permissions.h b/stoc/source/security/permissions.h
index 507c28f3dd56..49ee2a53d389 100644
--- a/stoc/source/security/permissions.h
+++ b/stoc/source/security/permissions.h
@@ -23,9 +23,8 @@
#include <rtl/ustring.hxx>
#include <salhelper/simplereferenceobject.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/RuntimeException.hpp>
+namespace com::sun::star::uno { class Any; }
+namespace com::sun::star::uno { template <class E> class Sequence; }
namespace stoc_sec
{
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index 60b637cae609..9d6f0e0d0c0a 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -22,19 +22,12 @@
#include <o3tl/any.hxx>
#include <osl/mutex.hxx>
#include <osl/diagnose.h>
-#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
-#include <uno/mapping.hxx>
-#include <uno/dispatcher.h>
-#include <cppuhelper/queryinterface.hxx>
+#include <cppuhelper/factory.hxx>
#include <cppuhelper/weakref.hxx>
-#include <cppuhelper/component.hxx>
#include <cppuhelper/implbase.hxx>
-#include <cppuhelper/implementationentry.hxx>
-#include <cppuhelper/component_context.hxx>
-#include <cppuhelper/bootstrap.hxx>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <comphelper/sequence.hxx>
@@ -55,9 +48,7 @@
#include <com/sun/star/container/XElementAccess.hpp>
#include <com/sun/star/container/XEnumeration.hpp>
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/uno/XUnloadingPreference.hpp>
#include <unordered_map>
#include <unordered_set>
diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx
index ff5e1444cdb6..ced189a84ad1 100644
--- a/stoc/source/simpleregistry/simpleregistry.cxx
+++ b/stoc/source/simpleregistry/simpleregistry.cxx
@@ -31,7 +31,6 @@
#include <com/sun/star/registry/XSimpleRegistry.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/RuntimeException.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <cppuhelper/implbase.hxx>
@@ -49,6 +48,8 @@
#include <rtl/ustring.hxx>
#include <sal/types.h>
+namespace com::sun::star::uno { class XComponentContext; }
+
namespace {
class SimpleRegistry:
diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx
index fd644c64b820..928629da4afa 100644
--- a/stoc/source/typeconv/convert.cxx
+++ b/stoc/source/typeconv/convert.cxx
@@ -21,8 +21,6 @@
#include <o3tl/any.hxx>
#include <osl/diagnose.h>
-#include <cppuhelper/factory.hxx>
-#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -36,19 +34,17 @@
#endif
#include <float.h>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/script/CannotConvertException.hpp>
#include <com/sun/star/script/XTypeConverter.hpp>
#include <com/sun/star/script/FailReason.hpp>
-#include <com/sun/star/container/XSet.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
+
+namespace com { namespace sun { namespace star { namespace uno { class XComponentContext; } } } }
using namespace css::uno;
using namespace css::lang;
using namespace css::script;
-using namespace css::registry;
using namespace cppu;
using namespace osl;
diff --git a/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx b/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx
index c945c1a92c78..5aec7c3595b2 100644
--- a/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx
+++ b/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx
@@ -22,12 +22,7 @@
#include <string_view>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/uno/Exception.hpp>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uri/XExternalUriReferenceTranslator.hpp>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -41,6 +36,9 @@
#include <rtl/ustring.hxx>
#include <sal/types.h>
+namespace com::sun::star::uno { class XInterface; }
+namespace com::sun::star::uno { class XComponentContext; }
+
namespace {
class Translator:
diff --git a/stoc/source/uriproc/UriReference.cxx b/stoc/source/uriproc/UriReference.cxx
index 18ada1d3cf0b..28202b7aeac3 100644
--- a/stoc/source/uriproc/UriReference.cxx
+++ b/stoc/source/uriproc/UriReference.cxx
@@ -22,7 +22,6 @@
#include <osl/diagnose.h>
#include <osl/mutex.hxx>
-#include <rtl/string.h>
#include <rtl/ustrbuf.hxx>
#include <rtl/ustring.hxx>
#include <sal/types.h>
diff --git a/stoc/source/uriproc/UriReference.hxx b/stoc/source/uriproc/UriReference.hxx
index 2c671133bfab..fe2f9bb38d19 100644
--- a/stoc/source/uriproc/UriReference.hxx
+++ b/stoc/source/uriproc/UriReference.hxx
@@ -20,7 +20,6 @@
#ifndef INCLUDED_STOC_SOURCE_URIPROC_URIREFERENCE_HXX
#define INCLUDED_STOC_SOURCE_URIPROC_URIREFERENCE_HXX
-#include <com/sun/star/uno/RuntimeException.hpp>
#include <osl/mutex.hxx>
#include <rtl/ustring.hxx>
#include <sal/types.h>
diff --git a/stoc/source/uriproc/UriReferenceFactory.cxx b/stoc/source/uriproc/UriReferenceFactory.cxx
index 402da59393f3..2359bc31b403 100644
--- a/stoc/source/uriproc/UriReferenceFactory.cxx
+++ b/stoc/source/uriproc/UriReferenceFactory.cxx
@@ -22,7 +22,6 @@
#include <algorithm>
#include <cassert>
#include <cstdlib>
-#include <exception>
#include <vector>
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
diff --git a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx
index e632dd98566c..828ff085510a 100644
--- a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx
+++ b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx
@@ -19,16 +19,9 @@
#include <sal/config.h>
-#include <exception>
-
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/uno/XInterface.hpp>
-#include <com/sun/star/uri/XUriReference.hpp>
#include <com/sun/star/uri/XUriSchemeParser.hpp>
#include <com/sun/star/uri/XVndSunStarExpandUrlReference.hpp>
#include <com/sun/star/util/XMacroExpander.hpp>
@@ -39,12 +32,15 @@
#include <rtl/textenc.h>
#include <rtl/uri.h>
#include <rtl/uri.hxx>
-#include <rtl/ustring.h>
#include <rtl/ustring.hxx>
#include <sal/types.h>
#include "UriReference.hxx"
+namespace com::sun::star::uno { class XComponentContext; }
+namespace com::sun::star::uno { class XInterface; }
+namespace com::sun::star::uri { class XUriReference; }
+
namespace {
bool parseSchemeSpecificPart(OUString const & part) {
diff --git a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
index 7fdc07b922e7..f12a74f3bdb8 100644
--- a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
+++ b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
@@ -22,11 +22,7 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/uno/XInterface.hpp>
-#include <com/sun/star/uri/XUriReference.hpp>
#include <com/sun/star/uri/XUriSchemeParser.hpp>
#include <com/sun/star/uri/XVndSunStarScriptUrlReference.hpp>
#include <cppuhelper/implbase.hxx>
@@ -39,9 +35,12 @@
#include <rtl/ustring.hxx>
#include <sal/types.h>
-#include <exception>
#include <string_view>
+namespace com::sun::star::uno { class XComponentContext; }
+namespace com::sun::star::uno { class XInterface; }
+namespace com::sun::star::uri { class XUriReference; }
+
namespace {
int getHexWeight(sal_Unicode c) {
diff --git a/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx b/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx
index 64580feaefba..8d1ea79b1901 100644
--- a/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx
+++ b/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx
@@ -18,19 +18,14 @@
*/
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uri/UriReferenceFactory.hpp>
#include <com/sun/star/uri/XUriReference.hpp>
#include <com/sun/star/uri/XVndSunStarPkgUrlReferenceFactory.hpp>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/weak.hxx>
-#include <rtl/string.h>
#include <rtl/textenc.h>
#include <rtl/uri.h>
#include <rtl/uri.hxx>
@@ -39,6 +34,9 @@
#include <osl/diagnose.h>
#include <sal/types.h>
+namespace com::sun::star::uno { class XComponentContext; }
+namespace com::sun::star::uno { class XInterface; }
+
namespace {
class Factory: