[Libreoffice-commits] core.git: pyuno/inc pyuno/IwyuFilter_pyuno.yaml pyuno/source

Gabor Kelemen (via logerrit) logerrit at kemper.freedesktop.org
Fri Apr 26 07:09:13 UTC 2019


 pyuno/IwyuFilter_pyuno.yaml            |   33 +++++++++++++++++++++++++++++++++
 pyuno/inc/pyuno.hxx                    |   10 ++++++----
 pyuno/source/loader/pyuno_loader.cxx   |    4 ++--
 pyuno/source/module/pyuno.cxx          |    9 +++++----
 pyuno/source/module/pyuno_adapter.cxx  |    6 +++---
 pyuno/source/module/pyuno_callable.cxx |    5 +++--
 pyuno/source/module/pyuno_except.cxx   |    1 +
 pyuno/source/module/pyuno_impl.hxx     |   21 ++++++++++-----------
 pyuno/source/module/pyuno_iterator.cxx |    3 +--
 pyuno/source/module/pyuno_module.cxx   |    7 +++++--
 pyuno/source/module/pyuno_runtime.cxx  |    4 ++--
 pyuno/source/module/pyuno_struct.cxx   |    9 +++------
 pyuno/source/module/pyuno_type.cxx     |    1 -
 pyuno/source/module/pyuno_util.cxx     |    4 ----
 14 files changed, 74 insertions(+), 43 deletions(-)

New commits:
commit 2460816491fe8593e8c7b13caf596383484b3031
Author:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
AuthorDate: Sun Mar 10 19:34:35 2019 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Apr 26 09:07:59 2019 +0200

    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 at collabora.com>

diff --git a/pyuno/IwyuFilter_pyuno.yaml b/pyuno/IwyuFilter_pyuno.yaml
new file mode 100644
index 000000000000..427d6319d5eb
--- /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 04c42de6e93f..a8680b6c4d3a 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 c0844496a4a5..938d53814545 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 bb176de4bfb5..f5f23bf058fa 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 1461d1adec48..7a74d98eaf4e 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 a58ac8b8e6eb..6519d20734c9 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 ebe00ac6811b..8b712400adf3 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 8175888e400a..000f2660469d 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 4868a12ee24f..5f643c13b67e 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 8456abfbfff2..37345ee95368 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 10f3ce953aac..9887c1fbc828 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 35eab1d0ed9e..7088fc346145 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 fc6385e2be1b..8cc41e8c0de1 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 f9714fb270f0..3765dc7df356 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>
 


More information about the Libreoffice-commits mailing list