[Libreoffice-commits] core.git: bin/find-unneeded-includes sw/inc sw/IwyuFilter_sw.yaml sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Oct 25 09:22:47 UTC 2018


 bin/find-unneeded-includes        |    3 +++
 sw/IwyuFilter_sw.yaml             |   12 ++++++++++++
 sw/inc/calbck.hxx                 |    5 +++--
 sw/inc/cellatr.hxx                |    1 +
 sw/inc/charfmt.hxx                |    1 +
 sw/inc/dbgoutsw.hxx               |    1 -
 sw/inc/dbmgr.hxx                  |    3 ---
 sw/inc/dcontact.hxx               |    1 -
 sw/inc/docary.hxx                 |    1 -
 sw/inc/docsh.hxx                  |    4 ++--
 sw/inc/fldbas.hxx                 |    1 +
 sw/inc/fmtcol.hxx                 |    1 +
 sw/inc/frmfmt.hxx                 |    1 +
 sw/inc/hhcwrp.hxx                 |    1 -
 sw/inc/ndgrf.hxx                  |    1 -
 sw/inc/swmodule.hxx               |    2 +-
 sw/inc/txtftn.hxx                 |    3 +--
 sw/source/uibase/app/docsh.cxx    |    1 +
 sw/source/uibase/app/docsh2.cxx   |    3 ++-
 sw/source/uibase/app/swmodule.cxx |    1 +
 20 files changed, 31 insertions(+), 16 deletions(-)

New commits:
commit 5af524251642a43747f56c1f24c41222fd9ac69f
Author:     Miklos Vajna <vmiklos at collabora.co.uk>
AuthorDate: Wed Oct 24 21:19:37 2018 +0200
Commit:     Miklos Vajna <vmiklos at collabora.co.uk>
CommitDate: Thu Oct 25 11:22:21 2018 +0200

    sw: fix some IWYU warnings
    
    Change-Id: Ic7e6aa31e5c6d210101da7223a294092ab5b7481
    Reviewed-on: https://gerrit.libreoffice.org/62334
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/bin/find-unneeded-includes b/bin/find-unneeded-includes
index 5d043f0da1a9..c949c887d905 100755
--- a/bin/find-unneeded-includes
+++ b/bin/find-unneeded-includes
@@ -169,6 +169,9 @@ def processIWYUOutput(iwyuOutput, moduleRules):
             match = re.match("- (.*;(?: })*)*  // lines (.*)-.*", line)
             if match:
                 fwdDecl = match.group(1)
+                if fwdDecl.endswith(";"):
+                    # Remove trailing semicolon.
+                    fwdDecl = fwdDecl[:-1]
                 lineno = match.group(2)
                 if not ignoreRemoval(fwdDecl, toAdd, currentFileName, moduleRules):
                     toRemove.append("%s:%s: %s" % (currentFileName, lineno, fwdDecl))
diff --git a/sw/IwyuFilter_sw.yaml b/sw/IwyuFilter_sw.yaml
index cd278aba47b6..3597e35b8f07 100644
--- a/sw/IwyuFilter_sw.yaml
+++ b/sw/IwyuFilter_sw.yaml
@@ -17,6 +17,8 @@ blacklist:
     - numrule.hxx
     # tox.hxx brings in SwTOXType, which is needed by SwTOXTypes, as SwVectorModifyBase's dtor wants to delete it
     - tox.hxx
+    # section.hxx brings in SwSectionFormat, which is needed by SwSectionFormats, as SwFormatsModifyBase's type param has to be complete
+    - section.hxx
     sw/inc/docfac.hxx:
     # Complete type is needed by rtl::Reference<SwDoc>.
     - doc.hxx
@@ -36,6 +38,8 @@ blacklist:
     - o3tl/typed_flags_set.hxx
     sw/inc/doc.hxx:
     - o3tl/deleter.hxx
+    sw/inc/docsh.hxx:
+    - o3tl/deleter.hxx
     sw/inc/list.hxx:
     - o3tl/deleter.hxx
     sw/inc/IDocumentLinksAdministration.hxx:
@@ -56,6 +60,8 @@ blacklist:
     - 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
@@ -240,6 +246,7 @@ blacklist:
     - class SwUpdateAttr
     - class SfxBoolItem
     - class SvxCharSetColorItem
+    - class SvxColorItem
     # used in extern declaration
     - struct SfxItemInfo
     sw/inc/textboxhelper.hxx:
@@ -252,3 +259,8 @@ blacklist:
     # complete type is wanted
     - com/sun/star/awt/XBitmap.hpp
     - com/sun/star/text/XTextColumns.hpp
+    sw/inc/pagepreviewlayout.hxx:
+    - vector
+    sw/inc/shellio.hxx:
+    - o3tl/deleter.hxx
+    - o3tl/typed_flags_set.hxx
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx
index 08f9e254829e..d470ea12a9ac 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -20,17 +20,18 @@
 #ifndef INCLUDED_SW_INC_CALBCK_HXX
 #define INCLUDED_SW_INC_CALBCK_HXX
 
+#include <cassert>
+
 #include <svl/hint.hxx>
 #include <svl/broadcast.hxx>
-#include <svl/poolitem.hxx>
 #include "swdllapi.h"
 #include "ring.hxx"
-#include "hintids.hxx"
 #include <type_traits>
 #include <vector>
 #include <memory>
 
 class SwModify;
+class SfxPoolItem;
 
 /*
     SwModify and SwClient cooperate in propagating attribute changes.
diff --git a/sw/inc/cellatr.hxx b/sw/inc/cellatr.hxx
index 62a5716c3af0..3b9de189478f 100644
--- a/sw/inc/cellatr.hxx
+++ b/sw/inc/cellatr.hxx
@@ -24,6 +24,7 @@
 #include <svl/zforlist.hxx>
 #include "swdllapi.h"
 #include "format.hxx"
+#include "hintids.hxx"
 #include "cellfml.hxx"
 
 /** The number formatter's default locale's @ Text format.
diff --git a/sw/inc/charfmt.hxx b/sw/inc/charfmt.hxx
index b84d31c780bc..b372de271437 100644
--- a/sw/inc/charfmt.hxx
+++ b/sw/inc/charfmt.hxx
@@ -20,6 +20,7 @@
 #define INCLUDED_SW_INC_CHARFMT_HXX
 
 #include "format.hxx"
+#include "hintids.hxx"
 
 class SW_DLLPUBLIC SwCharFormat : public SwFormat
 {
diff --git a/sw/inc/dbgoutsw.hxx b/sw/inc/dbgoutsw.hxx
index b32f410cc36d..28551b180666 100644
--- a/sw/inc/dbgoutsw.hxx
+++ b/sw/inc/dbgoutsw.hxx
@@ -41,7 +41,6 @@ class SwUndo;
 class SwRect;
 class SwFrameFormat;
 class SwFrameFormats;
-class SwNodes;
 class SwNumRuleTable;
 class SwNumRule;
 class SwOutlineNodes;
diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx
index c38cf044291c..c4abf4920b49 100644
--- a/sw/inc/dbmgr.hxx
+++ b/sw/inc/dbmgr.hxx
@@ -20,7 +20,6 @@
 #define INCLUDED_SW_INC_DBMGR_HXX
 
 #include <rtl/ustring.hxx>
-#include <tools/link.hxx>
 #include <tools/solar.h>
 #include <i18nlangtag/lang.h>
 #include <com/sun/star/util/Date.hpp>
@@ -30,7 +29,6 @@
 #include <com/sun/star/uno/Sequence.hxx>
 #include <com/sun/star/lang/Locale.hpp>
 #include <com/sun/star/beans/PropertyValue.hpp>
-#include <vcl/weld.hxx>
 
 #include <memory>
 #include <vector>
@@ -77,7 +75,6 @@ namespace weld {
 class SwView;
 class SwWrtShell;
 class ListBox;
-class Button;
 class SvNumberFormatter;
 class SwXMailMerge;
 class SwMailMergeConfigItem;
diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx
index 4d3a48fd14d0..d19befc69a96 100644
--- a/sw/inc/dcontact.hxx
+++ b/sw/inc/dcontact.hxx
@@ -38,7 +38,6 @@ class SwFlyDrawObj;
 class SwRect;
 class SwDrawContact;
 struct SwPosition;
-class SwIndex;
 class SdrTextObj;
 class SwContact;
 
diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx
index 940789ad262e..346b3293afb4 100644
--- a/sw/inc/docary.hxx
+++ b/sw/inc/docary.hxx
@@ -30,7 +30,6 @@
 #include <boost/multi_index/ordered_index.hpp>
 #include <boost/multi_index/random_access_index.hpp>
 
-#include "charfmt.hxx"
 #include "fmtcol.hxx"
 #include "frmfmt.hxx"
 #include "section.hxx"
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index 369a6924cb5b..f3f6657af420 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -22,8 +22,6 @@
 #include <memory>
 #include <rtl/ref.hxx>
 #include <com/sun/star/uno/Sequence.h>
-#include <ooo/vba/XSinkCaller.hpp>
-#include <ooo/vba/word/XDocument.hpp>
 #include <sfx2/docfac.hxx>
 #include <sfx2/objsh.hxx>
 #include "swdllapi.h"
@@ -58,6 +56,8 @@ namespace svt
 class EmbeddedObjectRef;
 }
 namespace com { namespace sun { namespace star { namespace frame { class XController; } } } }
+namespace ooo { namespace vba { class XSinkCaller; } }
+namespace ooo { namespace vba { namespace word { class XDocument; } } }
 
 // initialize DrawModel (in form of a SwDrawModel) and DocShell (in form of a SwDocShell)
 // as needed, one or both parameters may be zero
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index e6b977b5c295..0aa7619eaa4f 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -25,6 +25,7 @@
 #include <cppuhelper/weakref.hxx>
 #include <editeng/svxenum.hxx>
 #include <vector>
+#include <climits>
 
 class SwDoc;
 class SvNumberFormatter;
diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx
index 119d636ff7b8..1ae82ceb8e16 100644
--- a/sw/inc/fmtcol.hxx
+++ b/sw/inc/fmtcol.hxx
@@ -21,6 +21,7 @@
 
 #include "swdllapi.h"
 #include "format.hxx"
+#include "hintids.hxx"
 #include <rtl/ustring.hxx>
 
 #include <vector>
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index f06da7bb8006..4469a2c8b4c0 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -24,6 +24,7 @@
 #include <cppuhelper/weakref.hxx>
 #include <tools/gen.hxx>
 #include "format.hxx"
+#include "hintids.hxx"
 #include "swdllapi.h"
 #include <list>
 
diff --git a/sw/inc/hhcwrp.hxx b/sw/inc/hhcwrp.hxx
index 95aa775c76d5..1d8b1bbca091 100644
--- a/sw/inc/hhcwrp.hxx
+++ b/sw/inc/hhcwrp.hxx
@@ -23,7 +23,6 @@
 #include "swdllapi.h"
 
 class SwView;
-namespace vcl { class Window; }
 class SwWrtShell;
 struct SwConversionArgs;
 class SwPaM;
diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index 998c414a879f..2faed3ec01e8 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -29,7 +29,6 @@ class SwAsyncRetrieveInputStreamThreadConsumer;
 
 class SwGrfFormatColl;
 class SwDoc;
-namespace com { namespace sun { namespace star { namespace embed { class XStorage; } } } }
 
 // SwGrfNode
 class SW_DLLPUBLIC SwGrfNode: public SwNoTextNode
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index 8e23f8856d7b..e82375966927 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -31,7 +31,6 @@
 #include "swdllapi.h"
 #include "shellid.hxx"
 #include "fldupde.hxx"
-#include <ooo/vba/XSinkCaller.hpp>
 
 class Color;
 class SfxItemSet;
@@ -69,6 +68,7 @@ namespace com{ namespace sun{ namespace star{ namespace scanner{
 }}}}
 namespace com { namespace sun { namespace star { namespace linguistic2 { class XLanguageGuessing; } } } }
 namespace com { namespace sun { namespace star { namespace linguistic2 { class XLinguServiceEventListener; } } } }
+namespace ooo { namespace vba { class XSinkCaller; } }
 
 class SW_DLLPUBLIC SwModule final : public SfxModule, public SfxListener, public utl::ConfigurationListener
 {
diff --git a/sw/inc/txtftn.hxx b/sw/inc/txtftn.hxx
index 3c830e7ff273..9349750e70ec 100644
--- a/sw/inc/txtftn.hxx
+++ b/sw/inc/txtftn.hxx
@@ -19,10 +19,9 @@
 #ifndef INCLUDED_SW_INC_TXTFTN_HXX
 #define INCLUDED_SW_INC_TXTFTN_HXX
 
+#include <rtl/ustring.hxx>
 #include "txatbase.hxx"
 
-namespace rtl { class OUString; }
-
 class SwNodeIndex;
 class SwTextNode;
 class SwNodes;
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index c907b6c17c32..6976d844b2ea 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -119,6 +119,7 @@
 #include <com/sun/star/uri/UriReferenceFactory.hpp>
 #include <com/sun/star/uri/VndSunStarPkgUrlReferenceFactory.hpp>
 #include <com/sun/star/frame/XStorable.hpp>
+#include <ooo/vba/XSinkCaller.hpp>
 
 #include <unomid.h>
 #include <unotextrange.hxx>
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 7e3b049aa0e3..d299b67de20f 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -21,7 +21,8 @@
 
 #include <com/sun/star/drawing/ModuleDispatcher.hpp>
 #include <com/sun/star/frame/DispatchHelper.hpp>
-
+#include <ooo/vba/XSinkCaller.hpp>
+#include <ooo/vba/word/XDocument.hpp>
 #include <comphelper/fileformat.h>
 #include <comphelper/processfactory.hxx>
 
diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index 481750bf433c..8aa9841c4c06 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -55,6 +55,7 @@
 #include <sfx2/charmappopup.hxx>
 #include <com/sun/star/scanner/ScannerManager.hpp>
 #include <com/sun/star/linguistic2/LanguageGuessing.hpp>
+#include <ooo/vba/XSinkCaller.hpp>
 #include <comphelper/processfactory.hxx>
 #include <docsh.hxx>
 #include <swmodule.hxx>


More information about the Libreoffice-commits mailing list