tdf#42949 Fix IWYU warnings in sw/inc/*

New IWYU and recent developments in f-u-i helped to identify
some non self contained files and mostly those were fixed.

Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I21550193293b987311c56d8f7c9c3145547d2c6d
Reviewed-on: https://gerrit.libreoffice.org/74909
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
diff --git a/sw/IwyuFilter_sw.yaml b/sw/IwyuFilter_sw.yaml
index 64f3504..1809d19 100644
--- a/sw/IwyuFilter_sw.yaml
+++ b/sw/IwyuFilter_sw.yaml
@@ -22,6 +22,9 @@ blacklist:
    sw/inc/docfac.hxx:
    # Complete type is needed by rtl::Reference<SwDoc>.
    - doc.hxx
    sw/inc/swmodule.hxx:
    # Needed for macro #define
    - sfx2/app.hxx
    sw/inc/swtypes.hxx:
    # Needed for macro #define
    - com/sun/star/i18n/CollatorOptions.hpp
@@ -54,6 +57,9 @@ blacklist:
    # inline dtor, complete type is needed
    - com/sun/star/linguistic2/XSpellAlternatives.hpp
    - com/sun/star/linguistic2/XSpellChecker1.hpp
    sw/inc/SwGetPoolIdFromName.hxx:
    # Needed for enum type
    - sal/types.h
    sw/inc/unocoll.hxx:
    # base class has to be a complete type
    - com/sun/star/container/XEnumerationAccess.hpp
diff --git a/sw/inc/SwGetPoolIdFromName.hxx b/sw/inc/SwGetPoolIdFromName.hxx
index 820d864..2a42fae 100644
--- a/sw/inc/SwGetPoolIdFromName.hxx
+++ b/sw/inc/SwGetPoolIdFromName.hxx
@@ -19,6 +19,8 @@
#ifndef INCLUDED_SW_INC_SWGETPOOLIDFROMNAME_HXX
#define INCLUDED_SW_INC_SWGETPOOLIDFROMNAME_HXX

#include <sal/types.h>

/* When using the NameMapper to translate pool ids to UI or programmatic
 * names, this enum is used to define which family is required */

diff --git a/sw/inc/ToxTextGenerator.hxx b/sw/inc/ToxTextGenerator.hxx
index 91eac53..6758355 100644
--- a/sw/inc/ToxTextGenerator.hxx
+++ b/sw/inc/ToxTextGenerator.hxx
@@ -23,6 +23,8 @@
#include <rtl/ustring.hxx>
#include <sal/types.h>

#include "fmtautofmt.hxx"

#include <memory>
#include <vector>

diff --git a/sw/inc/ccoll.hxx b/sw/inc/ccoll.hxx
index 180f9db..de1ada052 100644
--- a/sw/inc/ccoll.hxx
+++ b/sw/inc/ccoll.hxx
@@ -21,6 +21,7 @@

#include <rtl/ustring.hxx>
#include <svl/poolitem.hxx>
#include <tools/solar.h>
#include "swdllapi.h"

enum class Master_CollCondition;
diff --git a/sw/inc/cellfml.hxx b/sw/inc/cellfml.hxx
index f9fd74c..67c2cee 100644
--- a/sw/inc/cellfml.hxx
+++ b/sw/inc/cellfml.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SW_INC_CELLFML_HXX

#include <memory>
#include <rtl/ustrbuf.hxx>
#include <rtl/ustring.hxx>

class SwTable;
diff --git a/sw/inc/crstate.hxx b/sw/inc/crstate.hxx
index 528b572..8697b13 100644
--- a/sw/inc/crstate.hxx
+++ b/sw/inc/crstate.hxx
@@ -23,6 +23,8 @@
#include <tools/gen.hxx>
#include "swrect.hxx"

#include <memory>

enum SwFillMode
{
    FILL_TAB,       ///< default, fill with tabs
diff --git a/sw/inc/ddefld.hxx b/sw/inc/ddefld.hxx
index 8334adb..d0404f2 100644
--- a/sw/inc/ddefld.hxx
+++ b/sw/inc/ddefld.hxx
@@ -21,6 +21,7 @@

#include <sfx2/lnkbase.hxx>
#include <svl/hint.hxx>
#include <tools/solar.h>
#include "swdllapi.h"
#include "fldbas.hxx"

diff --git a/sw/inc/dobjfac.hxx b/sw/inc/dobjfac.hxx
index 421a67c..49173cc 100644
--- a/sw/inc/dobjfac.hxx
+++ b/sw/inc/dobjfac.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_SW_INC_DOBJFAC_HXX

#include <tools/link.hxx>
#include <svx/svdobj.hxx>

class SwObjectFactory
{
diff --git a/sw/inc/edglbldc.hxx b/sw/inc/edglbldc.hxx
index ee246d0..6cac147 100644
--- a/sw/inc/edglbldc.hxx
+++ b/sw/inc/edglbldc.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_SW_INC_EDGLBLDC_HXX

#include <o3tl/sorted_vector.hxx>
#include <tools/solar.h>

class SwSection;
class SwTOXBase;
diff --git a/sw/inc/error.hrc b/sw/inc/error.hrc
index e15abf9..4e8ffbc 100644
--- a/sw/inc/error.hrc
+++ b/sw/inc/error.hrc
@@ -20,6 +20,9 @@
#ifndef INCLUDED_SW_INC_ERROR_HRC
#define INCLUDED_SW_INC_ERROR_HRC

#include <svtools/ehdl.hxx>
#include <vcl/errcode.hxx>

#include "swerror.h"

#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String)
diff --git a/sw/inc/flddat.hxx b/sw/inc/flddat.hxx
index bdc7c93..a095556 100644
--- a/sw/inc/flddat.hxx
+++ b/sw/inc/flddat.hxx
@@ -20,6 +20,8 @@
#ifndef INCLUDED_SW_INC_FLDDAT_HXX
#define INCLUDED_SW_INC_FLDDAT_HXX

#include <tools/solar.h>

#include "fldbas.hxx"

class DateTime;
diff --git a/sw/inc/fmtautofmt.hxx b/sw/inc/fmtautofmt.hxx
index 0863ca5..822f1ac 100644
--- a/sw/inc/fmtautofmt.hxx
+++ b/sw/inc/fmtautofmt.hxx
@@ -19,6 +19,7 @@
#ifndef INCLUDED_SW_INC_FMTAUTOFMT_HXX
#define INCLUDED_SW_INC_FMTAUTOFMT_HXX

#include "hintids.hxx"
#include <svl/poolitem.hxx>
#include <memory>

diff --git a/sw/inc/fmtcolfunc.hxx b/sw/inc/fmtcolfunc.hxx
index 12c3828..2f4e70e 100644
--- a/sw/inc/fmtcolfunc.hxx
+++ b/sw/inc/fmtcolfunc.hxx
@@ -19,6 +19,9 @@
#ifndef INCLUDED_SW_INC_FMTCOLFUNC_HXX
#define INCLUDED_SW_INC_FMTCOLFUNC_HXX

#include "numrule.hxx"
#include "fmtcol.hxx"

class SwFormat;
class SwNumRuleItem;

diff --git a/sw/inc/fmtline.hxx b/sw/inc/fmtline.hxx
index e1a48b3..7c5e393 100644
--- a/sw/inc/fmtline.hxx
+++ b/sw/inc/fmtline.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_SW_INC_FMTLINE_HXX

#include <svl/poolitem.hxx>
#include <tools/solar.h>
#include "hintids.hxx"
#include "swdllapi.h"
#include "swatrset.hxx"
diff --git a/sw/inc/gotodlg.hxx b/sw/inc/gotodlg.hxx
index 46418c6..f6c5d5d 100644
--- a/sw/inc/gotodlg.hxx
+++ b/sw/inc/gotodlg.hxx
@@ -20,6 +20,7 @@
#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_GOTODLG_HXX
#define INCLUDED_SW_SOURCE_UIBASE_INC_GOTODLG_HXX

#include <sfx2/bindings.hxx>
#include <vcl/weld.hxx>

class SwView;
diff --git a/sw/inc/hhcwrp.hxx b/sw/inc/hhcwrp.hxx
index 1d8b1bb..d627eda 100644
--- a/sw/inc/hhcwrp.hxx
+++ b/sw/inc/hhcwrp.hxx
@@ -20,6 +20,9 @@
#define INCLUDED_SW_INC_HHCWRP_HXX

#include <editeng/hangulhanja.hxx>
#include <editeng/svxenum.hxx>
#include <vcl/vclptr.hxx>
#include <vcl/window.hxx>
#include "swdllapi.h"

class SwView;
diff --git a/sw/inc/istyleaccess.hxx b/sw/inc/istyleaccess.hxx
index 7bb832f..b547d55 100644
--- a/sw/inc/istyleaccess.hxx
+++ b/sw/inc/istyleaccess.hxx
@@ -19,6 +19,8 @@
#ifndef INCLUDED_SW_INC_ISTYLEACCESS_HXX
#define INCLUDED_SW_INC_ISTYLEACCESS_HXX

#include <svl/itemset.hxx>
#include <memory>
#include <vector>

// Management of (automatic) styles
diff --git a/sw/inc/modcfg.hxx b/sw/inc/modcfg.hxx
index e7854ef..4cac78f 100644
--- a/sw/inc/modcfg.hxx
+++ b/sw/inc/modcfg.hxx
@@ -25,6 +25,7 @@
#include "SwCapObjType.hxx"
#include "tblenum.hxx"
#include "itabenum.hxx"
#include <caption.hxx>
#include <tools/globname.hxx>
#include <o3tl/typed_flags_set.hxx>

diff --git a/sw/inc/ndhints.hxx b/sw/inc/ndhints.hxx
index a2b8a86..697b113 100644
--- a/sw/inc/ndhints.hxx
+++ b/sw/inc/ndhints.hxx
@@ -19,8 +19,6 @@
#ifndef INCLUDED_SW_INC_NDHINTS_HXX
#define INCLUDED_SW_INC_NDHINTS_HXX

#include <o3tl/sorted_vector.hxx>

#include "swtypes.hxx"

class SwTextNode;
diff --git a/sw/inc/optload.hrc b/sw/inc/optload.hrc
index 9614b48..201fbff 100644
--- a/sw/inc/optload.hrc
+++ b/sw/inc/optload.hrc
@@ -20,6 +20,9 @@
#ifndef INCLUDED_SW_INC_OPTLOAD_HRC
#define INCLUDED_SW_INC_OPTLOAD_HRC

#include <tools/fldunit.hxx>
#include <utility>

#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String)

const std::pair<const char*, FieldUnit> STR_ARR_METRIC[] =
diff --git a/sw/inc/pagepreviewlayout.hxx b/sw/inc/pagepreviewlayout.hxx
index a1bd154..081bacc 100644
--- a/sw/inc/pagepreviewlayout.hxx
+++ b/sw/inc/pagepreviewlayout.hxx
@@ -30,6 +30,7 @@
#include <vcl/outdev.hxx>
// datatype <SwTwips>
#include "swtypes.hxx"
#include <prevwpage.hxx>

class SwViewShell;
class SwRootFrame;
diff --git a/sw/inc/pvprtdat.hxx b/sw/inc/pvprtdat.hxx
index 57a950a..a45aa54 100644
--- a/sw/inc/pvprtdat.hxx
+++ b/sw/inc/pvprtdat.hxx
@@ -20,7 +20,7 @@
#ifndef INCLUDED_SW_INC_PVPRTDAT_HXX
#define INCLUDED_SW_INC_PVPRTDAT_HXX

#include <tools/solar.h>
#include <sal/types.h>

class SwPagePreviewPrtData
{
diff --git a/sw/inc/reffld.hxx b/sw/inc/reffld.hxx
index f2c6187..19851da 100644
--- a/sw/inc/reffld.hxx
+++ b/sw/inc/reffld.hxx
@@ -19,6 +19,8 @@
#ifndef INCLUDED_SW_INC_REFFLD_HXX
#define INCLUDED_SW_INC_REFFLD_HXX

#include <tools/solar.h>

#include "fldbas.hxx"

class SfxPoolItem;
diff --git a/sw/inc/shellres.hxx b/sw/inc/shellres.hxx
index c836592..abdfb34 100644
--- a/sw/inc/shellres.hxx
+++ b/sw/inc/shellres.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_SW_INC_SHELLRES_HXX

#include <memory>
#include <vector>
#include "swdllapi.h"
#include <rtl/ustring.hxx>

diff --git a/sw/inc/sortopt.hxx b/sw/inc/sortopt.hxx
index c641a41..be697b5 100644
--- a/sw/inc/sortopt.hxx
+++ b/sw/inc/sortopt.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_SW_INC_SORTOPT_HXX

#include <rtl/ustring.hxx>
#include <i18nlangtag/lang.h>
#include "swdllapi.h"
#include <memory>
#include <vector>
diff --git a/sw/inc/swbaslnk.hxx b/sw/inc/swbaslnk.hxx
index b450cc1..3604c15 100644
--- a/sw/inc/swbaslnk.hxx
+++ b/sw/inc/swbaslnk.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_SW_INC_SWBASLNK_HXX

#include <sfx2/lnkbase.hxx>
#include <tools/solar.h>

class SwNode;
class SwContentNode;
diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index 5e1ee71..fd74bee 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -30,28 +30,11 @@

#include <memory>

#include <svx/algitem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <editeng/wghtitem.hxx>
#include <editeng/postitem.hxx>
#include <editeng/udlnitem.hxx>
#include <editeng/crossedoutitem.hxx>
#include <editeng/contouritem.hxx>
#include <editeng/shdditem.hxx>
#include <editeng/colritem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/brushitem.hxx>
#include <editeng/adjustitem.hxx>
#include <editeng/justifyitem.hxx>
#include <editeng/formatbreakitem.hxx>
#include <editeng/keepitem.hxx>
#include <editeng/frmdiritem.hxx>
#include <editeng/shaditem.hxx>
#include <svx/rotmodit.hxx>
#include <svx/autoformathelper.hxx>
#include <svl/intitem.hxx>
#include <editeng/lineitem.hxx>
#include "fmtpdsc.hxx"
#include "fmtornt.hxx"
#include "swdllapi.h"
diff --git a/sw/inc/toxwrap.hxx b/sw/inc/toxwrap.hxx
index 02108f6..6146304 100644
--- a/sw/inc/toxwrap.hxx
+++ b/sw/inc/toxwrap.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SW_INC_TOXWRAP_HXX

#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
#include "swdllapi.h"

namespace com { namespace sun { namespace star {
diff --git a/sw/inc/unochart.hxx b/sw/inc/unochart.hxx
index bb5b8fa..a7a5cc2 100644
--- a/sw/inc/unochart.hxx
+++ b/sw/inc/unochart.hxx
@@ -48,7 +48,6 @@
#include <tools/link.hxx>
#include <vcl/timer.hxx>

#include "calbck.hxx"
#include "frmfmt.hxx"
#include "unocrsr.hxx"

diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx
index 153ddd6..a9a13db 100644
--- a/sw/inc/unostyle.hxx
+++ b/sw/inc/unostyle.hxx
@@ -29,7 +29,6 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
#include <cppuhelper/implbase.hxx>
#include "calbck.hxx"

#include <com/sun/star/style/XAutoStyleFamily.hpp>
#include <com/sun/star/style/XAutoStyles.hpp>
diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx
index b31e425..07d525a 100644
--- a/sw/inc/unotbl.hxx
+++ b/sw/inc/unotbl.hxx
@@ -36,7 +36,6 @@

#include <svl/listener.hxx>

#include "calbck.hxx"
#include "TextCursorHelper.hxx"
#include "unotext.hxx"
#include "frmfmt.hxx"
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 6b18e67..d8d3510 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -15,6 +15,23 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/random.hxx>
#include <i18nutil/transliteration.hxx>
#include <editeng/adjustitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/brushitem.hxx>
#include <editeng/colritem.hxx>
#include <editeng/contouritem.hxx>
#include <editeng/crossedoutitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/justifyitem.hxx>
#include <editeng/lineitem.hxx>
#include <editeng/postitem.hxx>
#include <editeng/shdditem.hxx>
#include <editeng/udlnitem.hxx>
#include <editeng/wghtitem.hxx>
#include <svl/intitem.hxx>
#include <svx/algitem.hxx>
#include <svx/rotmodit.hxx>
#include <tools/urlobj.hxx>
#include <unotools/tempfile.hxx>
#include <unotools/transliterationwrapper.hxx>
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 4245a22..3cabe31 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -29,14 +29,21 @@
#include <editeng/acorrcfg.hxx>
#include <editeng/autokernitem.hxx>
#include <editeng/blinkitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/brushitem.hxx>
#include <editeng/formatbreakitem.hxx>
#include <editeng/charhiddenitem.hxx>
#include <editeng/charreliefitem.hxx>
#include <editeng/charrotateitem.hxx>
#include <editeng/charscaleitem.hxx>
#include <editeng/cmapitem.hxx>
#include <editeng/colritem.hxx>
#include <editeng/contouritem.hxx>
#include <editeng/crossedoutitem.hxx>
#include <editeng/emphasismarkitem.hxx>
#include <editeng/escapementitem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <editeng/forbiddenruleitem.hxx>
#include <editeng/frmdiritem.hxx>
#include <editeng/hngpnctitem.hxx>
@@ -54,17 +61,21 @@
#include <editeng/pgrditem.hxx>
#include <editeng/prntitem.hxx>
#include <editeng/protitem.hxx>
#include <editeng/postitem.hxx>
#include <editeng/rsiditem.hxx>
#include <svl/grabbagitem.hxx>
#include <editeng/scriptspaceitem.hxx>
#include <editeng/shaditem.hxx>
#include <editeng/shdditem.hxx>
#include <editeng/spltitem.hxx>
#include <editeng/svxacorr.hxx>
#include <editeng/swafopt.hxx>
#include <editeng/tstpitem.hxx>
#include <editeng/twolinesitem.hxx>
#include <editeng/ulspitem.hxx>
#include <editeng/udlnitem.hxx>
#include <editeng/unolingu.hxx>
#include <editeng/wghtitem.hxx>
#include <editeng/widwitem.hxx>
#include <editeng/wrlmitem.hxx>
#include <editeng/xmlcnitm.hxx>
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 8bd00f8..3b187ea 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -45,8 +45,24 @@
#include <osl/diagnose.h>

#include <svl/legacyitem.hxx>
#include <editeng/adjustitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/brushitem.hxx>
#include <editeng/colritem.hxx>
#include <editeng/contouritem.hxx>
#include <editeng/crossedoutitem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <editeng/justifyitem.hxx>
#include <editeng/legacyitem.hxx>
#include <editeng/lineitem.hxx>
#include <editeng/postitem.hxx>
#include <editeng/shdditem.hxx>
#include <editeng/udlnitem.hxx>
#include <editeng/wghtitem.hxx>
#include <svx/algitem.hxx>
#include <svx/legacyitem.hxx>
#include <svx/rotmodit.hxx>
#include <legacyitem.hxx>

#include <memory>
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 004696b..4f1d057 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -28,14 +28,23 @@
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
#include <svx/pageitem.hxx>
#include <editeng/colritem.hxx>
#include <editeng/contouritem.hxx>
#include <editeng/crossedoutitem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/sizeitem.hxx>
#include <editeng/udlnitem.hxx>
#include <editeng/ulspitem.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/postitem.hxx>
#include <editeng/shaditem.hxx>
#include <editeng/shdditem.hxx>
#include <editeng/brushitem.hxx>
#include <editeng/flstitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <editeng/paperinf.hxx>
#include <editeng/wghtitem.hxx>
#include <pagedesc.hxx>
#include <doc.hxx>
#include <IDocumentUndoRedo.hxx>
diff --git a/sw/source/ui/table/autoformatpreview.cxx b/sw/source/ui/table/autoformatpreview.cxx
index f0a20aa..b524532 100644
--- a/sw/source/ui/table/autoformatpreview.cxx
+++ b/sw/source/ui/table/autoformatpreview.cxx
@@ -17,6 +17,17 @@
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#include <editeng/adjustitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/brushitem.hxx>
#include <editeng/crossedoutitem.hxx>
#include <editeng/colritem.hxx>
#include <editeng/contouritem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/postitem.hxx>
#include <editeng/shdditem.hxx>
#include <editeng/udlnitem.hxx>
#include <editeng/wghtitem.hxx>
#include <vcl/settings.hxx>
#include <com/sun/star/i18n/BreakIterator.hpp>
#include <comphelper/processfactory.hxx>
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index f84787a..58593a9 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -47,6 +47,8 @@
#include <svl/itemiter.hxx>
#include <svl/stritem.hxx>
#include <editeng/colritem.hxx>
#include <editeng/fhgtitem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/shaditem.hxx>
#include <editeng/boxitem.hxx>
#include <svl/srchitem.hxx>