[Libreoffice-commits] core.git: bin/find-unneeded-includes include/IwyuFilter_include.yaml include/svl include/unotools include/vcl sc/inc sc/IwyuFilter_sc.yaml sc/source sd/IwyuFilter_sd.yaml sw/IwyuFilter_sw.yaml

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Dec 11 08:30:04 UTC 2018


 bin/find-unneeded-includes        |    8 ++++
 include/IwyuFilter_include.yaml   |   64 --------------------------------------
 include/svl/languageoptions.hxx   |    2 -
 include/svl/zforlist.hxx          |    2 -
 include/unotools/configitem.hxx   |    3 -
 include/unotools/fontcfg.hxx      |    2 -
 include/vcl/GraphicObject.hxx     |    2 -
 include/vcl/decoview.hxx          |    3 -
 include/vcl/floatwin.hxx          |    3 -
 include/vcl/graphicfilter.hxx     |    2 -
 sc/IwyuFilter_sc.yaml             |   15 --------
 sc/inc/compiler.hxx               |    3 -
 sc/source/filter/inc/colrowst.hxx |    3 -
 sc/source/filter/inc/xelink.hxx   |    3 -
 sc/source/ui/inc/csvcontrol.hxx   |    3 -
 sd/IwyuFilter_sd.yaml             |    3 -
 sw/IwyuFilter_sw.yaml             |   24 --------------
 17 files changed, 20 insertions(+), 125 deletions(-)

New commits:
commit 28726190d52b0729339d7257b84b449fafa4c34e
Author:     Gabor Kelemen <kelemeng at ubuntu.com>
AuthorDate: Thu Dec 6 00:17:03 2018 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Dec 11 09:29:41 2018 +0100

    find-unneeded-includes: Avoid proposing o3tl fw declaration
    
    This does not really work: even when it seems to, it compiles only
    because of transitive includes
    
    - Filter o3tl/typed_flags_set.hxx in f-u-u
    - Remove already added fw declarations from hxx files and
      include full header just in case
    - Remove now unnecessary blacklist entries
    
    Change-Id: Ie0de6667af697095a623b435806449e7e28a6004
    Reviewed-on: https://gerrit.libreoffice.org/64659
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/bin/find-unneeded-includes b/bin/find-unneeded-includes
index ecc29fe32919..b7da51714bb0 100755
--- a/bin/find-unneeded-includes
+++ b/bin/find-unneeded-includes
@@ -63,6 +63,14 @@ def ignoreRemoval(include, toAdd, absFileName, moduleRules):
         if include == k and v in toAdd:
             return True
 
+    # Avoid proposing o3tl fw declaration
+    o3tl = {
+        "o3tl/typed_flags_set.hxx" : "namespace o3tl { template <typename T> struct typed_flags; }",
+    }
+    for k, v, in o3tl.items():
+        if include == k and v in toAdd:
+            return True
+
     # Follow boost documentation.
     if include == "boost/optional.hpp" and "boost/optional/optional.hpp" in toAdd:
         return True
diff --git a/include/IwyuFilter_include.yaml b/include/IwyuFilter_include.yaml
index 0615d343c09d..f2f6169f8a69 100644
--- a/include/IwyuFilter_include.yaml
+++ b/include/IwyuFilter_include.yaml
@@ -40,12 +40,6 @@ blacklist:
     include/rtl/math.hxx:
     # TODO MSVC does not compile basegfx/numeric/ftools.hxx when this is replaced
     - math.h
-    include/registry/regtype.h:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
-    include/registry/types.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
     include/sfx2/toolbarids.hxx:
     # needed for enum definition
     - sal/types.h
@@ -103,9 +97,6 @@ blacklist:
     - cppuhelper/typeprovider.hxx
     - cppuhelper/supportsservice.hxx
     - cppuhelper/factory.hxx
-    include/ucbhelper/simpleinteractionrequest.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
     include/comphelper/accessiblekeybindinghelper.hxx:
     # base class has to be a complete type
     - com/sun/star/accessibility/XAccessibleKeyBinding.hpp
@@ -138,13 +129,8 @@ blacklist:
     # base class has to be a complete type
     - com/sun/star/lang/XSingleServiceFactory.hpp
     include/comphelper/configurationhelper.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
     # Needed for implicit destructor
     - com/sun/star/uno/Any.hxx
-    include/comphelper/documentconstants.hxx:
-   # Needed for template
-    - o3tl/typed_flags_set.hxx
     include/comphelper/docpasswordrequest.hxx:
     # base class has to be a complete type
     - com/sun/star/task/XInteractionRequest.hpp
@@ -201,17 +187,12 @@ blacklist:
     include/comphelper/uno3.hxx:
     # Needed for macro
     - comphelper/sequence.hxx
-    include/basegfx/polygon/b2dpolygontools.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
     include/basegfx/utils/unopolypolygon.hxx:
     # base class has to be a complete type
     - com/sun/star/lang/XServiceInfo.hpp
     - com/sun/star/rendering/XBezierPolyPolygon2D.hpp
     - com/sun/star/rendering/XLinePolyPolygon2D.hpp
     include/sot/exchange.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
     # Used in a macro #define
     - com/sun/star/datatransfer/dnd/DNDConstants.hpp
     include/tools/debug.hxx:
@@ -222,21 +203,9 @@ blacklist:
     - com/sun/star/lang/IllegalArgumentException.hpp
     - com/sun/star/uno/RuntimeException.hpp
     - rtl/ustring.hxx
-    include/tools/fontenum.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
     include/tools/svlibrary.h:
     # Used behind #ifndef
     - osl/module.h
-    include/tools/poly.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
-    include/tools/stream.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
-    include/tools/urlobj.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
     include/unotools/accessiblestatesethelper.hxx:
     # base class has to be a complete type
     - com/sun/star/accessibility/XAccessibleStateSet.hpp
@@ -250,18 +219,6 @@ blacklist:
     include/unotools/fontcfg.hxx:
     # Needed for a sal_uLong enum
     - tools/solar.h
-    include/unotools/fontcvt.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
-    include/unotools/fontdefs.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
-    include/unotools/options.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
-    include/unotools/readwritemutexguard.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
     include/unotools/streamwrap.hxx:
     # base class has to be a complete type
     - com/sun/star/io/XOutputStream.hpp
@@ -278,25 +235,13 @@ blacklist:
     - com/sun/star/lang/XInitialization.hpp
     - com/sun/star/lang/XServiceInfo.hpp
     - com/sun/star/xml/sax/XFastParser.hpp
-    include/i18nutil/casefolding.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
-    include/i18nutil/transliteration.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
     include/svl/numuno.hxx:
     # base class has to be a complete type
     - com/sun/star/lang/XUnoTunnel.hpp
     - com/sun/star/util/XNumberFormatsSupplier.hpp
-    include/svl/srchdefs.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
     include/svl/urihelper.hxx:
     # base class has to be a complete type
     - tools/link.hxx
-    include/vcl/bitmap.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
     include/vcl/builderfactory.hxx:
     # Needed for macros
     - vcl/builder.hxx
@@ -304,21 +249,12 @@ blacklist:
     include/vcl/devicecoordinate.hxx:
     # Needed for #if configure switch
     - basegfx/point/b2ipoint.hxx
-    include/vcl/errinf.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
     include/vcl/edit.hxx:
     # Needed for template
     - o3tl/deleter.hxx
     include/vcl/event.hxx:
     # Needed for enum type 
     - vcl/window.hxx
-    include/vcl/fntstyle.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
-    include/vcl/help.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
     include/vcl/imap.hxx:
     # Needed for implicit dtor
     - vcl/imapobj.hxx
diff --git a/include/svl/languageoptions.hxx b/include/svl/languageoptions.hxx
index 16774a2bf25c..a6fb2d4c51ce 100644
--- a/include/svl/languageoptions.hxx
+++ b/include/svl/languageoptions.hxx
@@ -21,11 +21,11 @@
 
 #include <svl/svldllapi.h>
 #include <sal/types.h>
+#include <o3tl/typed_flags_set.hxx>
 #include <unotools/configitem.hxx>
 #include <unotools/options.hxx>
 #include <i18nlangtag/lang.h>
 #include <memory>
-namespace o3tl { template <typename T> struct typed_flags; }
 
 // class SvtLanguageOptions ----------------------------------------------------
 
diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx
index 143d14e03f50..5d7f0da12984 100644
--- a/include/svl/zforlist.hxx
+++ b/include/svl/zforlist.hxx
@@ -22,6 +22,7 @@
 #include <svl/svldllapi.h>
 #include <rtl/ustrbuf.hxx>
 #include <rtl/ustring.hxx>
+#include <o3tl/typed_flags_set.hxx>
 #include <i18nlangtag/lang.h>
 #include <com/sun/star/util/NumberFormat.hpp>
 #include <unotools/localedatawrapper.hxx>
@@ -36,7 +37,6 @@
 namespace com { namespace sun { namespace star { namespace i18n { class XNumberFormatCode; } } } }
 namespace com { namespace sun { namespace star { namespace i18n { struct Currency; } } } }
 namespace com { namespace sun { namespace star { namespace i18n { struct NumberFormatCode; } } } }
-namespace o3tl { template <typename T> struct typed_flags; }
 
 class Date;
 class Color;
diff --git a/include/unotools/configitem.hxx b/include/unotools/configitem.hxx
index 675e9edfab24..edeaf03af55c 100644
--- a/include/unotools/configitem.hxx
+++ b/include/unotools/configitem.hxx
@@ -26,6 +26,7 @@
 #include <com/sun/star/uno/Reference.h>
 #include <unotools/unotoolsdllapi.h>
 #include <unotools/options.hxx>
+#include <o3tl/typed_flags_set.hxx>
 
 namespace com{ namespace sun{ namespace star{
     namespace uno{
@@ -49,8 +50,6 @@ enum class ConfigItemMode
     ReleaseTree        = 0x04,
 };
 
-namespace o3tl { template <typename T> struct typed_flags; }
-
 namespace o3tl
 {
     template<> struct typed_flags<ConfigItemMode> : is_typed_flags<ConfigItemMode, 0x07> {};
diff --git a/include/unotools/fontcfg.hxx b/include/unotools/fontcfg.hxx
index 24dfbb6540f3..d98d13080040 100644
--- a/include/unotools/fontcfg.hxx
+++ b/include/unotools/fontcfg.hxx
@@ -23,12 +23,12 @@
 #include <tools/solar.h>
 #include <tools/fontenum.hxx>
 #include <com/sun/star/uno/Reference.hxx>
+#include <o3tl/typed_flags_set.hxx>
 
 #include <unordered_map>
 #include <unordered_set>
 #include <vector>
 
-namespace o3tl { template <typename T> struct typed_flags; }
 namespace com { namespace sun { namespace star { namespace container { class XNameAccess; } } } }
 namespace com { namespace sun { namespace star { namespace lang { class XMultiServiceFactory; } } } }
 
diff --git a/include/vcl/GraphicObject.hxx b/include/vcl/GraphicObject.hxx
index 9ffbd9a73ba2..bd5bcd71f1c3 100644
--- a/include/vcl/GraphicObject.hxx
+++ b/include/vcl/GraphicObject.hxx
@@ -23,9 +23,9 @@
 #include <memory>
 #include <vcl/graph.hxx>
 #include <vcl/dllapi.h>
+#include <o3tl/typed_flags_set.hxx>
 
 namespace com { namespace sun { namespace star { namespace graphic { class XGraphic; } } } }
-namespace o3tl { template <typename T> struct typed_flags; }
 
 // Adjustment defines
 enum class GraphicAdjustmentFlags
diff --git a/include/vcl/decoview.hxx b/include/vcl/decoview.hxx
index eccdb084a776..3a186b4cecf9 100644
--- a/include/vcl/decoview.hxx
+++ b/include/vcl/decoview.hxx
@@ -24,13 +24,12 @@
 #include <vcl/outdev.hxx>
 #include <vcl/vclptr.hxx>
 #include <vcl/vclenum.hxx>
+#include <o3tl/typed_flags_set.hxx>
 
 namespace tools { class Rectangle; }
 class Point;
 class Color;
 
-namespace o3tl { template <typename T> struct typed_flags; }
-
 // Flags for DrawSymbol()
 enum class DrawSymbolFlags
 {
diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx
index 10b45c8e5fb4..a9ac32958110 100644
--- a/include/vcl/floatwin.hxx
+++ b/include/vcl/floatwin.hxx
@@ -23,8 +23,7 @@
 #include <vcl/dllapi.h>
 #include <vcl/syswin.hxx>
 #include <memory>
-
-namespace o3tl { template <typename T> struct typed_flags; }
+#include <o3tl/typed_flags_set.hxx>
 
 class ToolBox;
 
diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx
index 0ce9f50ba0c4..b79cb18f9deb 100644
--- a/include/vcl/graphicfilter.hxx
+++ b/include/vcl/graphicfilter.hxx
@@ -24,12 +24,12 @@
 #include <vcl/dllapi.h>
 #include <vcl/graph.hxx>
 #include <vcl/errcode.hxx>
+#include <o3tl/typed_flags_set.hxx>
 
 #include <memory>
 
 namespace com { namespace sun { namespace star { namespace beans { struct PropertyValue; } } } }
 namespace com { namespace sun { namespace star { namespace uno { template <class E> class Sequence; } } } }
-namespace o3tl { template <typename T> struct typed_flags; }
 
 class INetURLObject;
 
diff --git a/sc/IwyuFilter_sc.yaml b/sc/IwyuFilter_sc.yaml
index 8aeb6a621378..44f20377fe97 100644
--- a/sc/IwyuFilter_sc.yaml
+++ b/sc/IwyuFilter_sc.yaml
@@ -131,9 +131,6 @@ blacklist:
     - com/sun/star/sheet/XSpreadsheets2.hpp
     - com/sun/star/table/XTableColumns.hpp
     - com/sun/star/table/XTableRows.hpp
-    sc/inc/dpglobal.hxx:
-    # base class has to be a complete type
-    - o3tl/typed_flags_set.hxx
     sc/inc/dptabsrc.hxx:
     # base class has to be a complete type
     - com/sun/star/beans/XPropertySet.hpp
@@ -168,9 +165,6 @@ blacklist:
     - com/sun/star/text/XTextField.hpp
     - com/sun/star/beans/XPropertySet.hpp
     - com/sun/star/lang/XUnoTunnel.hpp
-    sc/inc/fillinfo.hxx:
-    # base class has to be a complete type
-    - o3tl/typed_flags_set.hxx
     sc/inc/filtuno.hxx:
     # base class has to be a complete type
     - com/sun/star/beans/XPropertyAccess.hpp
@@ -363,9 +357,6 @@ blacklist:
     - com/sun/star/beans/XPropertySet.hpp
     - com/sun/star/lang/XServiceInfo.hpp
     - com/sun/star/sheet/XFormulaParser.hpp
-    sc/inc/types.hxx:
-    # base class has to be a complete type
-    - o3tl/typed_flags_set.hxx
     sc/inc/unitconv.hxx:
     # base class has to be a complete type
     - map
@@ -404,9 +395,6 @@ blacklist:
     sc/source/filter/inc/xistream.hxx:
     # Needed for implicit dtor
     - com/sun/star/beans/NamedValue.hpp
-    sc/source/filter/inc/xlstring.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
     sc/source/ui/inc/AccessibleContextBase.hxx:
     # base class has to be a complete type
     - com/sun/star/accessibility/XAccessibleComponent.hpp
@@ -487,9 +475,6 @@ blacklist:
     sc/source/ui/inc/RandomNumberGeneratorDialog.hxx:
     # base class has to be a complete type
     - viewdata.hxx
-    sc/source/ui/inc/scui_def.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
     sc/source/ui/inc/StatisticsInputOutputDialog.hxx:
     # base class has to be a complete type
     - viewdata.hxx
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 7095db44e930..3186f973152b 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -35,11 +35,10 @@
 #include <memory>
 #include <set>
 #include <com/sun/star/uno/Sequence.hxx>
+#include <o3tl/typed_flags_set.hxx>
 
 #include <formula/FormulaCompiler.hxx>
 
-namespace o3tl { template <typename T> struct typed_flags; }
-
 // constants and data types also for external modules (ScInterpreter et al)
 
 #define MAXSTRLEN    1024   /* maximum length of input string of one symbol */
diff --git a/sc/source/filter/inc/colrowst.hxx b/sc/source/filter/inc/colrowst.hxx
index a51b9a895244..d9838fb141c3 100644
--- a/sc/source/filter/inc/colrowst.hxx
+++ b/sc/source/filter/inc/colrowst.hxx
@@ -22,8 +22,7 @@
 
 #include "xiroot.hxx"
 #include <mdds/flat_segment_tree.hpp>
-
-namespace o3tl { template <typename T> struct typed_flags; }
+#include <o3tl/typed_flags_set.hxx>
 
 enum class ExcColRowFlags : sal_uInt8 {
     NONE         = 0x00,
diff --git a/sc/source/filter/inc/xelink.hxx b/sc/source/filter/inc/xelink.hxx
index e9bcbb012983..df585bc306a3 100644
--- a/sc/source/filter/inc/xelink.hxx
+++ b/sc/source/filter/inc/xelink.hxx
@@ -24,8 +24,7 @@
 #include "xeroot.hxx"
 #include <externalrefmgr.hxx>
 #include <memory>
-
-namespace o3tl { template <typename T> struct typed_flags; }
+#include <o3tl/typed_flags_set.hxx>
 
 struct ScSingleRefData;
 struct ScComplexRefData;
diff --git a/sc/source/ui/inc/csvcontrol.hxx b/sc/source/ui/inc/csvcontrol.hxx
index 4086a4626f52..8a5f77f3d299 100644
--- a/sc/source/ui/inc/csvcontrol.hxx
+++ b/sc/source/ui/inc/csvcontrol.hxx
@@ -25,14 +25,13 @@
 #include <address.hxx>
 #include "csvsplits.hxx"
 #include <com/sun/star/uno/Reference.hxx>
+#include <o3tl/typed_flags_set.hxx>
 
 class ScAccessibleCsvControl;
 namespace com { namespace sun { namespace star { namespace accessibility {
     class XAccessible;
 } } } }
 
-namespace o3tl { template <typename T> struct typed_flags; }
-
 /** Minimum character count for a column in separators mode. */
 const sal_Int32 CSV_MINCOLWIDTH         = 8;
 /** Maximum length of a cell string. */
diff --git a/sd/IwyuFilter_sd.yaml b/sd/IwyuFilter_sd.yaml
index b0d04bbbf022..c15a2221d9c4 100644
--- a/sd/IwyuFilter_sd.yaml
+++ b/sd/IwyuFilter_sd.yaml
@@ -177,9 +177,6 @@ blacklist:
     - com/sun/star/drawing/framework/XView.hpp
     - com/sun/star/lang/XUnoTunnel.hpp
     - com/sun/star/view/XSelectionSupplier.hpp
-    sd/source/ui/inc/tools/IdleDetection.hxx:
-    # Needed for template
-    - o3tl/typed_flags_set.hxx
     sd/source/ui/inc/tools/PropertySet.hxx:
     # base class has to be a complete type
     - com/sun/star/beans/XPropertySet.hpp
diff --git a/sw/IwyuFilter_sw.yaml b/sw/IwyuFilter_sw.yaml
index 093df4572bb7..287d7613ea77 100644
--- a/sw/IwyuFilter_sw.yaml
+++ b/sw/IwyuFilter_sw.yaml
@@ -22,20 +22,7 @@ blacklist:
     sw/inc/docfac.hxx:
     # Complete type is needed by rtl::Reference<SwDoc>.
     - doc.hxx
-    sw/inc/accmap.hxx:
-    - o3tl/typed_flags_set.hxx
-    sw/inc/crsrsh.hxx:
-    - o3tl/typed_flags_set.hxx
-    sw/inc/cshtyp.hxx:
-    - o3tl/typed_flags_set.hxx
-    sw/inc/fesh.hxx:
-    - o3tl/typed_flags_set.hxx
-    sw/inc/modcfg.hxx:
-    - o3tl/typed_flags_set.hxx
-    sw/inc/ndtyp.hxx:
-    - o3tl/typed_flags_set.hxx
     sw/inc/swtypes.hxx:
-    - o3tl/typed_flags_set.hxx
     # Needed for macro #define
     - com/sun/star/i18n/CollatorOptions.hpp
     sw/inc/doc.hxx:
@@ -54,16 +41,6 @@ blacklist:
     - utility
     sw/inc/shellid.hxx:
     - sfx2/shell.hxx
-    sw/inc/swurl.hxx:
-    - o3tl/typed_flags_set.hxx
-    sw/inc/tblenum.hxx:
-    - o3tl/typed_flags_set.hxx
-    sw/inc/tox.hxx:
-    - o3tl/typed_flags_set.hxx
-    sw/inc/undobj.hxx:
-    - o3tl/typed_flags_set.hxx
-    sw/inc/itabenum.hxx:
-    - o3tl/typed_flags_set.hxx
     sw/inc/unosett.hxx:
     # sw::UnoImplPtr typedef
     - unobaseclass.hxx
@@ -265,4 +242,3 @@ blacklist:
     - vector
     sw/inc/shellio.hxx:
     - o3tl/deleter.hxx
-    - o3tl/typed_flags_set.hxx


More information about the Libreoffice-commits mailing list