tdf#42949 Fix IWYU warnings in pyuno/
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.
Change-Id: I95575d41a822ff7b1ac5bdba03057f6d3fa61b51
Reviewed-on: https://gerrit.libreoffice.org/71141
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
diff --git a/pyuno/IwyuFilter_pyuno.yaml b/pyuno/IwyuFilter_pyuno.yaml
new file mode 100644
index 0000000..427d631
--- /dev/null
+++ b/pyuno/IwyuFilter_pyuno.yaml
@@ -0,0 +1,33 @@
---
assumeFilename: pyuno/source/module/pyuno.cxx
blacklist:
pyuno/inc/pyuno.hxx:
# Used in #ifdef
- Python.h
pyuno/source/module/pyuno_impl.hxx:
# Used in #ifdef
- Python.h
# Base class needs complete type
- com/sun/star/lang/XUnoTunnel.hpp
- com/sun/star/script/XInvocation.hpp
# Needed for typedef
- com/sun/star/container/XIndexAccess.hpp
- cppuhelper/weakref.hxx
pyuno/source/loader/pyuno_loader.cxx:
# Don't replace with URE impl. detail
- osl/file.hxx
# Needed for direct memmber access
- com/sun/star/uno/XComponentContext.hpp
pyuno/source/module/pyuno_module.cxx:
# Needed on MACOSX
- config_folders.h
# Don't replace with URE impl. detail
- rtl/bootstrap.hxx
pyuno/source/module/pyuno_runtime.cxx:
# Needed on MACOSX
- config_folders.h
# Needed for direct member access
- com/sun/star/container/XHierarchicalNameAccess.hpp
pyuno/zipcore/python.cxx:
# Needed on WIN32
- tools/pathutils.hxx
diff --git a/pyuno/inc/pyuno.hxx b/pyuno/inc/pyuno.hxx
index 04c42de..a8680b6 100644
--- a/pyuno/inc/pyuno.hxx
+++ b/pyuno/inc/pyuno.hxx
@@ -23,9 +23,11 @@
#ifndef Py_PYTHON_H
#include <Python.h>
#endif // #ifdef Py_PYTHON_H
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/script/CannotConvertException.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/uno/Any.hxx>
namespace com::sun::star::uno { class XComponentContext; }
namespace com::sun::star::uno { template <typename > class Reference; }
/**
External interface of the Python UNO bridge.
@@ -151,7 +153,7 @@ public:
};
};
struct stRuntimeImpl;
//struct stRuntimeImpl;
typedef struct stRuntimeImpl RuntimeImpl;
enum ConversionMode { ACCEPT_UNO_ANY, REJECT_UNO_ANY };
diff --git a/pyuno/source/loader/pyuno_loader.cxx b/pyuno/source/loader/pyuno_loader.cxx
index c084449..938d538 100644
--- a/pyuno/source/loader/pyuno_loader.cxx
+++ b/pyuno/source/loader/pyuno_loader.cxx
@@ -29,12 +29,13 @@
#include <osl/thread.h>
#include <rtl/ustrbuf.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/bootstrap.hxx>
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/factory.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
// apparently PATH_MAX is not standard and not defined by MSVC
#ifndef PATH_MAX
#ifdef _MAX_PATH
@@ -48,7 +49,6 @@
#endif
#endif
using pyuno::PyRef;
using pyuno::NOT_NULL;
using pyuno::Runtime;
diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx
index bb176de..f5f23bf 100644
--- a/pyuno/source/module/pyuno.cxx
+++ b/pyuno/source/module/pyuno.cxx
@@ -25,14 +25,11 @@
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/thread.h>
#include <typelib/typedescription.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XEnumeration.hpp>
#include <com/sun/star/beans/UnknownPropertyException.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
@@ -40,6 +37,10 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
#include <com/sun/star/script/CannotConvertException.hpp>
#include <com/sun/star/script/XInvocation2.hpp>
#include <com/sun/star/script/XTypeConverter.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include "pyuno_impl.hxx"
diff --git a/pyuno/source/module/pyuno_adapter.cxx b/pyuno/source/module/pyuno_adapter.cxx
index 1461d1a..7a74d98 100644
--- a/pyuno/source/module/pyuno_adapter.cxx
+++ b/pyuno/source/module/pyuno_adapter.cxx
@@ -20,11 +20,11 @@
#include <o3tl/any.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/strbuf.hxx>
#include <com/sun/star/beans/MethodConcept.hpp>
#include <com/sun/star/beans/UnknownPropertyException.hpp>
#include <com/sun/star/script/CannotConvertException.hpp>
#include <com/sun/star/script/XInvocationAdapterFactory2.hpp>
#include <com/sun/star/beans/XIntrospection.hpp>
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/typeprovider.hxx>
diff --git a/pyuno/source/module/pyuno_callable.cxx b/pyuno/source/module/pyuno_callable.cxx
index a58ac8b..6519d20 100644
--- a/pyuno/source/module/pyuno_callable.cxx
+++ b/pyuno/source/module/pyuno_callable.cxx
@@ -19,8 +19,9 @@
#include "pyuno_impl.hxx"
#include <osl/diagnose.h>
#include <osl/thread.h>
#include <rtl/ustrbuf.hxx>
#include <com/sun/star/script/CannotConvertException.hpp>
#include <com/sun/star/script/XInvocation2.hpp>
using com::sun::star::uno::Sequence;
using com::sun::star::uno::Reference;
diff --git a/pyuno/source/module/pyuno_except.cxx b/pyuno/source/module/pyuno_except.cxx
index ebe00ac..8b71240 100644
--- a/pyuno/source/module/pyuno_except.cxx
+++ b/pyuno/source/module/pyuno_except.cxx
@@ -21,6 +21,7 @@
#include <rtl/ustrbuf.hxx>
#include <typelib/typedescription.hxx>
#include <com/sun/star/script/CannotConvertException.hpp>
using com::sun::star::uno::RuntimeException;
diff --git a/pyuno/source/module/pyuno_impl.hxx b/pyuno/source/module/pyuno_impl.hxx
index 8175888..000f266 100644
--- a/pyuno/source/module/pyuno_impl.hxx
+++ b/pyuno/source/module/pyuno_impl.hxx
@@ -51,25 +51,24 @@ typedef long Py_hash_t;
#include <unordered_map>
#include <unordered_set>
#include <com/sun/star/beans/XIntrospection.hpp>
#include <com/sun/star/script/XTypeConverter.hpp>
#include <com/sun/star/script/XInvocation2.hpp>
#include <com/sun/star/script/XInvocationAdapterFactory2.hpp>
#include <com/sun/star/reflection/XIdlReflection.hpp>
#include <com/sun/star/container/XEnumeration.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/script/XInvocation.hpp>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/weakref.hxx>
#include <osl/module.hxx>
namespace com::sun::star::beans { class XIntrospection; }
namespace com::sun::star::container { class XEnumeration; }
namespace com::sun::star::container { class XHierarchicalNameAccess; }
namespace com::sun::star::lang { class XSingleServiceFactory; }
namespace com::sun::star::reflection { class XIdlReflection; }
namespace com::sun::star::script { class XInvocation2; }
namespace com::sun::star::script { class XInvocationAdapterFactory2; }
namespace com::sun::star::script { class XTypeConverter; }
// In Python 3, the PyString_* functions have been replaced by PyBytes_*
// and PyUnicode_* functions.
#if PY_MAJOR_VERSION >= 3
diff --git a/pyuno/source/module/pyuno_iterator.cxx b/pyuno/source/module/pyuno_iterator.cxx
index 4868a12..5f643c1 100644
--- a/pyuno/source/module/pyuno_iterator.cxx
+++ b/pyuno/source/module/pyuno_iterator.cxx
@@ -19,14 +19,13 @@
#include <sal/config.h>
#include <cassert>
#include "pyuno_impl.hxx"
#include <com/sun/star/container/XEnumeration.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <com/sun/star/lang/WrappedTargetException.hpp>
#include <com/sun/star/script/CannotConvertException.hpp>
using com::sun::star::container::XEnumeration;
using com::sun::star::container::XIndexAccess;
diff --git a/pyuno/source/module/pyuno_module.cxx b/pyuno/source/module/pyuno_module.cxx
index 8456abf..37345ee 100644
--- a/pyuno/source/module/pyuno_module.cxx
+++ b/pyuno/source/module/pyuno_module.cxx
@@ -17,14 +17,12 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_features.h>
#include <config_folders.h>
#include "pyuno_impl.hxx"
#include <cassert>
#include <unordered_map>
#include <utility>
#include <osl/module.hxx>
#include <osl/thread.h>
@@ -46,6 +44,11 @@
#include <com/sun/star/reflection/XConstantTypeDescription.hpp>
#include <com/sun/star/reflection/XIdlClass.hpp>
#include <com/sun/star/registry/InvalidRegistryException.hpp>
#include <com/sun/star/script/CannotConvertException.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/script/XInvocation2.hpp>
#include <com/sun/star/reflection/XIdlReflection.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
using osl::Module;
diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx
index 10f3ce9..9887c1f 100644
--- a/pyuno/source/module/pyuno_runtime.cxx
+++ b/pyuno/source/module/pyuno_runtime.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_features.h>
#include <config_folders.h>
#include "pyuno_impl.hxx"
@@ -27,7 +26,6 @@
#include <osl/thread.h>
#include <osl/module.h>
#include <osl/process.h>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/bootstrap.hxx>
@@ -36,9 +34,11 @@
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <com/sun/star/beans/XMaterialHolder.hpp>
#include <com/sun/star/beans/theIntrospection.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/script/Converter.hpp>
#include <com/sun/star/script/InvocationAdapterFactory.hpp>
#include <com/sun/star/reflection/theCoreReflection.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <comphelper/sequence.hxx>
#include <cppuhelper/exc_hlp.hxx>
diff --git a/pyuno/source/module/pyuno_struct.cxx b/pyuno/source/module/pyuno_struct.cxx
index 35eab1d..7088fc3 100644
--- a/pyuno/source/module/pyuno_struct.cxx
+++ b/pyuno/source/module/pyuno_struct.cxx
@@ -19,16 +19,13 @@
#include <sal/config.h>
#include <algorithm>
#include <cassert>
#include <rtl/strbuf.hxx>
#include <typelib/typedescription.hxx>
#include <com/sun/star/beans/UnknownPropertyException.hpp>
#include <com/sun/star/beans/XMaterialHolder.hpp>
#include <com/sun/star/script/CannotConvertException.hpp>
#include <com/sun/star/script/XInvocation2.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include "pyuno_impl.hxx"
diff --git a/pyuno/source/module/pyuno_type.cxx b/pyuno/source/module/pyuno_type.cxx
index fc6385e..8cc41e8 100644
--- a/pyuno/source/module/pyuno_type.cxx
+++ b/pyuno/source/module/pyuno_type.cxx
@@ -20,7 +20,6 @@
#include <o3tl/any.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/strbuf.hxx>
#include <typelib/typedescription.hxx>
diff --git a/pyuno/source/module/pyuno_util.cxx b/pyuno/source/module/pyuno_util.cxx
index f9714fb..3765dc7 100644
--- a/pyuno/source/module/pyuno_util.cxx
+++ b/pyuno/source/module/pyuno_util.cxx
@@ -19,13 +19,9 @@
#include "pyuno_impl.hxx"
#include <time.h>
#include <osl/thread.h>
#include <osl/thread.hxx>
#include <typelib/typedescription.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/time.h>