[Libreoffice-commits] core.git: sw/inc sw/IwyuFilter_sw.yaml sw/qa sw/source

Gabor Kelemen (via logerrit) logerrit at kemper.freedesktop.org
Tue Nov 24 14:46:26 UTC 2020


 sw/IwyuFilter_sw.yaml                                            |  115 ++++++++++
 sw/inc/HandleAnchorNodeChg.hxx                                   |    3 
 sw/inc/PageColumnPopup.hxx                                       |    1 
 sw/inc/PageMarginPopup.hxx                                       |    1 
 sw/inc/PageOrientationPopup.hxx                                  |    1 
 sw/inc/PageSizePopup.hxx                                         |    1 
 sw/inc/SwNumberTree.hxx                                          |    1 
 sw/inc/cellfml.hxx                                               |    2 
 sw/inc/charatr.hxx                                               |    1 
 sw/inc/editsh.hxx                                                |    1 
 sw/inc/expfld.hxx                                                |    1 
 sw/inc/fldbas.hxx                                                |    2 
 sw/inc/flypos.hxx                                                |    2 
 sw/inc/fmtfld.hxx                                                |    1 
 sw/inc/grfatr.hxx                                                |    2 
 sw/inc/legacyitem.hxx                                            |    2 
 sw/inc/ndole.hxx                                                 |    2 
 sw/inc/ndtxt.hxx                                                 |    1 
 sw/inc/pageformatpanel.hrc                                       |    2 
 sw/inc/redline.hxx                                               |    3 
 sw/inc/unodraw.hxx                                               |    1 
 sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx         |    1 
 sw/qa/core/filters-test2.cxx                                     |    2 
 sw/qa/extras/layout/layout.cxx                                   |   23 --
 sw/qa/extras/layout/layout2.cxx                                  |    4 
 sw/qa/extras/odfimport/odfimport.cxx                             |    1 
 sw/qa/extras/ooxmlexport/ooxmlexport10.cxx                       |    3 
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx                       |    5 
 sw/qa/extras/ooxmlexport/ooxmlexport15.cxx                       |    2 
 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx                        |    2 
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx                        |    1 
 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx                        |    4 
 sw/qa/extras/txtexport/txtexport.cxx                             |    6 
 sw/qa/extras/uiwriter/uiwriter.cxx                               |    2 
 sw/qa/extras/uiwriter/uiwriter3.cxx                              |    1 
 sw/qa/extras/ww8import/ww8import.cxx                             |    3 
 sw/qa/uibase/uiview/uiview.cxx                                   |   10 
 sw/source/core/SwNumberTree/SwNodeNum.cxx                        |    1 
 sw/source/core/access/AccessibilityCheck.cxx                     |    3 
 sw/source/core/access/accdoc.cxx                                 |    1 
 sw/source/core/access/accportions.cxx                            |    1 
 sw/source/core/access/acctable.cxx                               |    1 
 sw/source/core/access/acctable.hxx                               |    1 
 sw/source/core/access/parachangetrackinginfo.cxx                 |    1 
 sw/source/core/access/textmarkuphelper.cxx                       |    1 
 sw/source/core/attr/cellatr.cxx                                  |    1 
 sw/source/core/attr/fmtfollowtextflow.cxx                        |    3 
 sw/source/core/attr/format.cxx                                   |    1 
 sw/source/core/crsr/annotationmark.cxx                           |    1 
 sw/source/core/crsr/bookmrk.cxx                                  |    4 
 sw/source/core/crsr/callnk.cxx                                   |    1 
 sw/source/core/crsr/callnk.hxx                                   |    1 
 sw/source/core/crsr/findattr.cxx                                 |    1 
 sw/source/core/crsr/pam.cxx                                      |    1 
 sw/source/core/crsr/trvltbl.cxx                                  |    1 
 sw/source/core/crsr/viscrs.cxx                                   |    2 
 sw/source/core/doc/DocumentContentOperationsManager.cxx          |    1 
 sw/source/core/doc/DocumentDeviceManager.cxx                     |    1 
 sw/source/core/doc/DocumentFieldsManager.cxx                     |    1 
 sw/source/core/doc/DocumentLayoutManager.cxx                     |    1 
 sw/source/core/doc/DocumentRedlineManager.cxx                    |    1 
 sw/source/core/doc/DocumentSettingManager.cxx                    |    1 
 sw/source/core/doc/DocumentStatisticsManager.cxx                 |    1 
 sw/source/core/doc/DocumentTimerManager.cxx                      |    1 
 sw/source/core/doc/acmplwrd.cxx                                  |    1 
 sw/source/core/doc/dbgoutsw.cxx                                  |    2 
 sw/source/core/doc/docbasic.cxx                                  |    1 
 sw/source/core/doc/docchart.cxx                                  |    2 
 sw/source/core/doc/doccorr.cxx                                   |    1 
 sw/source/core/doc/docdesc.cxx                                   |    1 
 sw/source/core/doc/docedt.cxx                                    |    1 
 sw/source/core/doc/docfld.cxx                                    |    4 
 sw/source/core/doc/docfly.cxx                                    |    1 
 sw/source/core/doc/docfmt.cxx                                    |    2 
 sw/source/core/doc/docftn.cxx                                    |    1 
 sw/source/core/doc/docnew.cxx                                    |    1 
 sw/source/core/doc/docnum.cxx                                    |    3 
 sw/source/core/doc/docsort.cxx                                   |    1 
 sw/source/core/doc/doctxm.cxx                                    |    2 
 sw/source/core/doc/htmltbl.cxx                                   |    1 
 sw/source/core/doc/lineinfo.cxx                                  |    2 
 sw/source/core/doc/notxtfrm.cxx                                  |    1 
 sw/source/core/doc/tblcpy.cxx                                    |    1 
 sw/source/core/docnode/ndcopy.cxx                                |    1 
 sw/source/core/docnode/ndnotxt.cxx                               |    1 
 sw/source/core/docnode/ndsect.cxx                                |    3 
 sw/source/core/docnode/node.cxx                                  |    2 
 sw/source/core/docnode/node2lay.cxx                              |    1 
 sw/source/core/docnode/section.cxx                               |    2 
 sw/source/core/docnode/swbaslnk.cxx                              |    9 
 sw/source/core/draw/dcontact.cxx                                 |    2 
 sw/source/core/edit/acorrect.cxx                                 |    6 
 sw/source/core/edit/autofmt.cxx                                  |    1 
 sw/source/core/edit/edattr.cxx                                   |    1 
 sw/source/core/edit/edglss.cxx                                   |    2 
 sw/source/core/edit/editsh.cxx                                   |    1 
 sw/source/core/edit/edlingu.cxx                                  |    1 
 sw/source/core/edit/ednumber.cxx                                 |    1 
 sw/source/core/edit/edredln.cxx                                  |    1 
 sw/source/core/edit/edsect.cxx                                   |    1 
 sw/source/core/edit/edws.cxx                                     |    2 
 sw/source/core/fields/authfld.cxx                                |    2 
 sw/source/core/fields/cellfml.cxx                                |    2 
 sw/source/core/fields/chpfld.cxx                                 |    1 
 sw/source/core/fields/dbfld.cxx                                  |    2 
 sw/source/core/fields/ddefld.cxx                                 |    1 
 sw/source/core/fields/expfld.cxx                                 |    2 
 sw/source/core/fields/fldlst.cxx                                 |    1 
 sw/source/core/fields/tblcalc.cxx                                |    1 
 sw/source/core/frmedt/fecopy.cxx                                 |    3 
 sw/source/core/frmedt/fefly1.cxx                                 |    1 
 sw/source/core/frmedt/tblsel.cxx                                 |    2 
 sw/source/core/graphic/grfatr.cxx                                |    2 
 sw/source/core/graphic/ndgrf.cxx                                 |    1 
 sw/source/core/inc/SwXMLBlockImport.hxx                          |    1 
 sw/source/core/inc/UndoBookmark.hxx                              |    1 
 sw/source/core/inc/frame.hxx                                     |    2 
 sw/source/core/inc/layact.hxx                                    |    1 
 sw/source/core/inc/pamtyp.hxx                                    |    1 
 sw/source/core/layout/atrfrm.cxx                                 |    1 
 sw/source/core/layout/calcmove.cxx                               |    1 
 sw/source/core/layout/colfrm.cxx                                 |    1 
 sw/source/core/layout/findfrm.cxx                                |    1 
 sw/source/core/layout/fly.cxx                                    |    1 
 sw/source/core/layout/flypos.cxx                                 |    1 
 sw/source/core/layout/ftnfrm.cxx                                 |    1 
 sw/source/core/layout/hffrm.cxx                                  |    1 
 sw/source/core/layout/laycache.cxx                               |    2 
 sw/source/core/layout/layouter.cxx                               |    1 
 sw/source/core/layout/objectformatter.cxx                        |    1 
 sw/source/core/layout/objectformatterlayfrm.cxx                  |    1 
 sw/source/core/layout/objectformattertxtfrm.cxx                  |    3 
 sw/source/core/layout/pagechg.cxx                                |    1 
 sw/source/core/layout/pagedesc.cxx                               |    2 
 sw/source/core/layout/paintfrm.cxx                               |    1 
 sw/source/core/layout/sectfrm.cxx                                |    1 
 sw/source/core/layout/tabfrm.cxx                                 |    1 
 sw/source/core/layout/unusedf.cxx                                |    1 
 sw/source/core/layout/virtoutp.cxx                               |    1 
 sw/source/core/layout/wsfrm.cxx                                  |    1 
 sw/source/core/objectpositioning/anchoredobjectposition.cxx      |    2 
 sw/source/core/objectpositioning/environmentofanchoredobject.cxx |    1 
 sw/source/core/ole/ndole.cxx                                     |    1 
 sw/source/core/swg/SwXMLSectionList.cxx                          |    1 
 sw/source/core/table/swnewtable.cxx                              |    5 
 sw/source/core/table/swtable.cxx                                 |    1 
 sw/source/core/text/EnhancedPDFExportHelper.cxx                  |    1 
 sw/source/core/text/atrstck.cxx                                  |    1 
 sw/source/core/text/frmform.cxx                                  |    1 
 sw/source/core/text/frmpaint.cxx                                 |    1 
 sw/source/core/text/inftxt.hxx                                   |    1 
 sw/source/core/text/pordrop.hxx                                  |    3 
 sw/source/core/text/redlnitr.hxx                                 |    3 
 sw/source/core/tox/ToxTextGenerator.cxx                          |    1 
 sw/source/core/tox/txmsrt.cxx                                    |    1 
 sw/source/core/txtnode/SwGrammarContact.cxx                      |    1 
 sw/source/core/txtnode/atrftn.cxx                                |    1 
 sw/source/core/txtnode/fmtatr2.cxx                               |    1 
 sw/source/core/txtnode/ndhints.cxx                               |    1 
 sw/source/core/txtnode/ndtxt.cxx                                 |    1 
 sw/source/core/txtnode/swfont.cxx                                |    1 
 sw/source/core/txtnode/thints.cxx                                |    2 
 sw/source/core/txtnode/txtedt.cxx                                |    1 
 sw/source/core/undo/undel.cxx                                    |    1 
 sw/source/core/undo/undobj1.cxx                                  |    1 
 sw/source/core/undo/undraw.cxx                                   |    2 
 sw/source/core/undo/unins.cxx                                    |    1 
 sw/source/core/undo/unredln.cxx                                  |    1 
 sw/source/core/unocore/unofield.cxx                              |    1 
 sw/source/core/unocore/unoframe.cxx                              |    1 
 sw/source/core/unocore/unoidx.cxx                                |    1 
 sw/source/core/unocore/unomap.cxx                                |    1 
 sw/source/core/unocore/unomap1.cxx                               |    2 
 sw/source/core/unocore/unoobj2.cxx                               |    1 
 sw/source/core/unocore/unoredline.cxx                            |    1 
 sw/source/core/unocore/unoredlines.cxx                           |    1 
 sw/source/core/unocore/unosect.cxx                               |    1 
 sw/source/core/unocore/unostyle.cxx                              |    1 
 sw/source/core/unocore/unotbl.cxx                                |    5 
 sw/source/core/unocore/unotext.cxx                               |    1 
 sw/source/core/view/pagepreviewlayout.cxx                        |    1 
 sw/source/core/view/viewpg.cxx                                   |    1 
 sw/source/core/view/viewsh.cxx                                   |    1 
 sw/source/filter/ascii/wrtasc.cxx                                |    1 
 sw/source/filter/basflt/fltini.cxx                               |    2 
 sw/source/filter/basflt/fltshell.cxx                             |    1 
 sw/source/filter/basflt/iodetect.cxx                             |    1 
 sw/source/filter/html/css1atr.hxx                                |    2 
 sw/source/filter/html/css1kywd.hxx                               |    2 
 sw/source/filter/html/htmldrawwriter.cxx                         |    1 
 sw/source/filter/html/htmlforw.cxx                               |    1 
 sw/source/filter/html/htmlgrin.cxx                               |    1 
 sw/source/filter/html/htmltab.cxx                                |    1 
 sw/source/filter/html/swhtml.cxx                                 |    1 
 sw/source/filter/html/swhtml.hxx                                 |    2 
 sw/source/filter/inc/fltshell.hxx                                |    3 
 sw/source/filter/inc/wrtswtbl.hxx                                |    1 
 sw/source/filter/ww8/attributeoutputbase.hxx                     |    2 
 sw/source/filter/ww8/docxattributeoutput.cxx                     |    3 
 sw/source/filter/ww8/docxexport.hxx                              |    1 
 sw/source/filter/ww8/docxsdrexport.cxx                           |    2 
 sw/source/filter/ww8/writerhelper.cxx                            |    1 
 sw/source/filter/ww8/wrtw8esh.cxx                                |    1 
 sw/source/filter/ww8/wrtww8.hxx                                  |    3 
 sw/source/filter/ww8/wrtww8gr.cxx                                |    1 
 sw/source/filter/ww8/ww8atr.cxx                                  |    1 
 sw/source/filter/ww8/ww8glsy.cxx                                 |    1 
 sw/source/filter/xml/XMLRedlineImportHelper.hxx                  |    1 
 sw/source/filter/xml/xmlbrsh.cxx                                 |    2 
 sw/source/filter/xml/xmlfmt.cxx                                  |    2 
 sw/source/filter/xml/xmlimpit.hxx                                |    2 
 sw/source/filter/xml/xmlitem.hxx                                 |    2 
 sw/source/filter/xml/xmlitemi.cxx                                |    2 
 sw/source/filter/xml/xmlitemm.cxx                                |    1 
 sw/source/filter/xml/xmlitmpr.cxx                                |    1 
 sw/source/filter/xml/xmlscript.cxx                               |    2 
 sw/source/filter/xml/xmltext.cxx                                 |    1 
 sw/source/filter/xml/xmltexte.cxx                                |    1 
 sw/source/filter/xml/xmltexti.cxx                                |    1 
 sw/source/ui/dbui/dbtablepreviewdialog.cxx                       |    2 
 sw/source/ui/dbui/mmlayoutpage.cxx                               |    1 
 sw/source/ui/dialog/swdlgfact.hxx                                |    2 
 sw/source/ui/dialog/wordcountdialog.cxx                          |    1 
 sw/source/ui/envelp/envfmt.cxx                                   |    1 
 sw/source/ui/inc/mmresultdialogs.hxx                             |    1 
 sw/source/ui/vba/vbaaddin.cxx                                    |    1 
 sw/source/ui/vba/vbabookmark.cxx                                 |    1 
 sw/source/ui/vba/vbacell.cxx                                     |    1 
 sw/source/ui/vba/vbafind.cxx                                     |    1 
 sw/source/ui/vba/vbaframe.cxx                                    |    1 
 sw/source/ui/vba/vbaheaderfooter.cxx                             |    1 
 sw/source/ui/vba/vbalistgallery.cxx                              |    1 
 sw/source/ui/vba/vbalisttemplate.cxx                             |    1 
 sw/source/ui/vba/vbaparagraph.cxx                                |    1 
 sw/source/ui/vba/vbareplacement.cxx                              |    1 
 sw/source/ui/vba/vbarevision.cxx                                 |    1 
 sw/source/ui/vba/vbatableofcontents.cxx                          |    1 
 sw/source/ui/vba/vbatabstop.cxx                                  |    1 
 sw/source/ui/vba/vbavariable.cxx                                 |    1 
 sw/source/uibase/app/docsh2.cxx                                  |    1 
 sw/source/uibase/app/swmodul1.cxx                                |    1 
 sw/source/uibase/config/modcfg.cxx                               |    1 
 sw/source/uibase/config/usrpref.cxx                              |    1 
 sw/source/uibase/dialog/watermarkdialog.cxx                      |    2 
 sw/source/uibase/docvw/FrameControlsManager.cxx                  |    2 
 sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx           |    2 
 sw/source/uibase/docvw/PageBreakWin.cxx                          |    1 
 sw/source/uibase/docvw/edtwin.cxx                                |    1 
 sw/source/uibase/docvw/edtwin2.cxx                               |    1 
 sw/source/uibase/inc/HeaderFooterWin.hxx                         |    2 
 sw/source/uibase/inc/chartins.hxx                                |    1 
 sw/source/uibase/inc/conform.hxx                                 |    1 
 sw/source/uibase/inc/content.hxx                                 |    1 
 sw/source/uibase/inc/conttree.hxx                                |    3 
 sw/source/uibase/inc/labrec.hxx                                  |    1 
 sw/source/uibase/inc/mmconfigitem.hxx                            |    1 
 sw/source/uibase/inc/navicont.hxx                                |    1 
 sw/source/uibase/inc/navipi.hxx                                  |    2 
 sw/source/uibase/inc/redlndlg.hxx                                |    1 
 sw/source/uibase/inc/swcont.hxx                                  |    1 
 sw/source/uibase/inc/swtablerep.hxx                              |    1 
 sw/source/uibase/misc/swruler.cxx                                |    1 
 sw/source/uibase/ribbar/conarc.cxx                               |    1 
 sw/source/uibase/ribbar/workctrl.cxx                             |    1 
 sw/source/uibase/shells/annotsh.cxx                              |    4 
 sw/source/uibase/shells/drawsh.cxx                               |    3 
 sw/source/uibase/shells/drwtxtex.cxx                             |    3 
 sw/source/uibase/shells/grfshex.cxx                              |    1 
 sw/source/uibase/shells/langhelper.cxx                           |    1 
 sw/source/uibase/shells/slotadd.cxx                              |    1 
 sw/source/uibase/shells/textfld.cxx                              |    2 
 sw/source/uibase/shells/textsh1.cxx                              |    2 
 sw/source/uibase/sidebar/PageColumnPopup.cxx                     |    1 
 sw/source/uibase/sidebar/PageFooterPanel.cxx                     |    2 
 sw/source/uibase/sidebar/PageFooterPanel.hxx                     |    2 
 sw/source/uibase/sidebar/PageHeaderPanel.cxx                     |    2 
 sw/source/uibase/sidebar/PageHeaderPanel.hxx                     |    2 
 sw/source/uibase/sidebar/PageMarginUtils.hxx                     |    2 
 sw/source/uibase/sidebar/PageOrientationPopup.cxx                |    1 
 sw/source/uibase/sidebar/PageSizePopup.cxx                       |    1 
 sw/source/uibase/sidebar/PageStylesPanel.cxx                     |    1 
 sw/source/uibase/sidebar/PageStylesPanel.hxx                     |    1 
 sw/source/uibase/sidebar/SwPanelFactory.cxx                      |    1 
 sw/source/uibase/sidebar/TableEditPanel.cxx                      |    1 
 sw/source/uibase/sidebar/WrapPropertyPanel.cxx                   |    6 
 sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx            |    1 
 sw/source/uibase/table/chartins.cxx                              |    2 
 sw/source/uibase/table/swtablerep.cxx                            |    1 
 sw/source/uibase/table/tablemgr.cxx                              |    1 
 sw/source/uibase/uitest/uiobject.cxx                             |    1 
 sw/source/uibase/uiview/srcview.cxx                              |    1 
 sw/source/uibase/uiview/view2.cxx                                |    2 
 sw/source/uibase/uiview/viewsrch.cxx                             |    1 
 sw/source/uibase/uiview/viewstat.cxx                             |    1 
 sw/source/uibase/uno/unodoc.cxx                                  |    1 
 sw/source/uibase/uno/unotxdoc.cxx                                |    2 
 sw/source/uibase/utlui/attrdesc.cxx                              |    2 
 sw/source/uibase/utlui/content.cxx                               |    2 
 sw/source/uibase/utlui/glbltree.cxx                              |    2 
 sw/source/uibase/utlui/navipi.cxx                                |    1 
 sw/source/uibase/wrtsh/wrtsh2.cxx                                |    1 
 301 files changed, 271 insertions(+), 328 deletions(-)

New commits:
commit fe88ffb661053f8fff9bd77affdf4de820c43ca8
Author:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
AuthorDate: Thu Nov 19 20:11:29 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Nov 24 15:45:27 2020 +0100

    tdf#42949 Fix new IWYU warnings in directory sw
    
    Found with bin/find-unneeded-includes
    Only removal proposals are dealt with here.
    
    Change-Id: I4bb84c3f401aba8a3dede9cec3a7f2187a2ba02a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106473
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sw/IwyuFilter_sw.yaml b/sw/IwyuFilter_sw.yaml
index ec23d4163ced..b0ddaded4060 100644
--- a/sw/IwyuFilter_sw.yaml
+++ b/sw/IwyuFilter_sw.yaml
@@ -1,6 +1,15 @@
 ---
 assumeFilename: sw/source/core/doc/docnew.cxx
 excludelist:
+    sw/sdi/swslots.hrc:
+    # Needed for sdi files to compile
+    - editeng/memberids.h
+    - editeng/editids.hrc
+    - svx/svxids.hrc
+    - svx/unomid.hxx
+    - globals.hrc
+    - cmdid.h
+    - unomid.h
     sw/inc/extinput.hxx:
     - vector
     sw/inc/fmtmeta.hxx:
@@ -439,18 +448,48 @@ excludelist:
     sw/qa/extras/layout/layout.cxx:
     - comphelper/scopeguard.hxx
     - com/sun/star/linguistic2/LinguServiceManager.hpp
+    sw/source/core/access/acccontext.cxx:
+    # Actually used
+    - com/sun/star/accessibility/XAccessibleStateSet.hpp
+    sw/source/core/access/AccessibilityCheck.cxx:
+    # Needed for template
+    - com/sun/star/frame/XModel.hpp
+    sw/source/core/access/accnotextframe.cxx:
+    # Actually used
+    - com/sun/star/accessibility/XAccessibleRelationSet.hpp
+    sw/source/core/access/accpara.cxx:
+    # Actually used
+    - com/sun/star/accessibility/AccessibleScrollType.hpp
+    sw/source/core/access/acctextframe.cxx:
+    # Actually used
+    - com/sun/star/accessibility/XAccessibleRelationSet.hpp
     sw/source/core/doc/DocumentFieldsManager.cxx:
     # Actually used
     - comphelper/scopeguard.hxx
+    sw/source/core/doc/DocumentStatisticsManager.cxx:
+    # Needed for template
+    - com/sun/star/frame/XModel.hpp
     sw/source/core/doc/docbm.cxx:
     # Needed for implicit dtor SwHistoryTextFieldmark
     - rolbck.hxx
     sw/source/core/doc/docredln.cxx:
     # Needed for linker visibility of sw_DebugRedline
     - docredln.hxx
+    sw/source/core/doc/doccomp.cxx:
+    # Needed for template
+    - com/sun/star/frame/XModel.hpp
+    sw/source/core/doc/docglbl.cxx:
+    # Needed for template
+    - com/sun/star/frame/XModel.hpp
+    sw/source/core/doc/docglos.cxx:
+    # Needed for template
+    - com/sun/star/frame/XModel.hpp
     sw/source/core/docnode/threadmanager.cxx:
     # Actually used
     - com/sun/star/util/XJobManager.hpp
+    sw/source/core/draw/drawdoc.cxx:
+    # Needed for template
+    - com/sun/star/frame/XModel.hpp
     sw/source/filter/html/htmlreqifreader.cxx:
     - comphelper/scopeguard.hxx
     sw/source/uibase/sidebar/PageMarginUtils.hxx:
@@ -478,6 +517,9 @@ excludelist:
     sw/source/core/swg/SwXMLSectionList.cxx:
     # Actually used
     - vector
+    sw/source/core/text/txtftn.cxx:
+    # Needed for template
+    - com/sun/star/text/XTextRange.hpp
     sw/source/core/undo/unsect.cxx:
     # Actually used
     - comphelper/scopeguard.hxx
@@ -511,15 +553,32 @@ excludelist:
     # Actually used
     - com/sun/star/text/TextMarkupDescriptor.hpp
     - com/sun/star/text/XTextRange.hpp
+    sw/source/core/unocore/unotbl.cxx:
+    # No .hxx -> .h replacement in URE headers
+    - cppuhelper/interfacecontainer.hxx
+    sw/source/core/unocore/unoredline.cxx:
+    # Needed for template
+    - com/sun/star/text/XTextSection.hpp
+    sw/source/core/unocore/unostyle.cxx:
+    # Needed for template
+    - com/sun/star/frame/XModel.hpp
     sw/source/filter/basflt/iodetect.cxx:
     # Actually used
     - com/sun/star/embed/XStorage.hpp
     sw/source/filter/html/SwAppletImpl.cxx:
     # Needed for direct member access
     - com/sun/star/embed/XEmbeddedObject.hpp
+    sw/source/filter/html/htmlfld.cxx:
+    # Needed for template
+    - com/sun/star/frame/XModel.hpp
+    sw/source/filter/html/htmlforw.cxx:
+    # Needed for template
+    - com/sun/star/frame/XModel.hpp
     sw/source/filter/html/wrthtml.cxx:
     # Actually used
     - comphelper/scopeguard.hxx
+    # Needed for template
+    - com/sun/star/frame/XModel.hpp
     sw/source/filter/html/swhtml.cxx:
     # Actually used
     - com/sun/star/document/XDocumentProperties.hpp
@@ -546,6 +605,24 @@ excludelist:
     # OSL_BIGENDIAN is being checked
     - osl/endian.h
     - com/sun/star/frame/XModel.hpp
+    sw/source/filter/xml/xmlbrsh.cxx:
+    # Needed for XMLOFF_WARN_UNKNOWN_ELEMENT
+    - sal/log.hxx
+    sw/source/filter/xml/xmlexp.hxx:
+    # Needed for typedef
+    - vector
+    sw/source/filter/xml/xmlfmt.cxx:
+    # Needed for template
+    - com/sun/star/frame/XModel.hpp
+    sw/source/filter/xml/xmlitem.cxx:
+    # Needed for XMLOFF_WARN_UNKNOWN_ELEMENT
+    - sal/log.hxx
+    sw/source/filter/xml/xmlmeta.cxx:
+    # Needed for template
+    - com/sun/star/frame/XModel.hpp
+    sw/source/filter/xml/xmltbli.cxx:
+    # Needed for template
+    - com/sun/star/frame/XModel.hpp
     sw/source/filter/xml/wrtxml.cxx:
     # Actually used
     - com/sun/star/task/XStatusIndicator.hpp
@@ -555,6 +632,9 @@ excludelist:
     sw/source/uibase/app/docsh2.cxx:
     # Needed for direct member access
     - ooo/vba/word/XDocument.hpp
+    sw/source/uibase/app/docst.cxx:
+    # Needed for template
+    - com/sun/star/frame/XModel.hpp
     sw/source/uibase/dbui/mmconfigitem.cxx:
     # Actually used
     - com/sun/star/sdbc/XDataSource.hpp
@@ -564,6 +644,15 @@ excludelist:
     sw/source/uibase/dochdl/swdtflvr.cxx:
     # OSL_BIGENDIAN is being checked
     - osl/endian.h
+    sw/source/uibase/docvw/edtdd.cxx:
+    # Needed for extern variable
+    - edtdd.hxx
+    sw/source/uibase/docvw/srcedtw.cxx:
+    # Needed for template
+    - com/sun/star/container/XHierarchicalNameAccess.hpp
+    sw/source/uibase/misc/glshell.cxx:
+    # Needed for template
+    - com/sun/star/frame/XModel.hpp
     sw/source/uibase/shells/basesh.cxx:
     # Actually used
     - comphelper/scopeguard.hxx
@@ -626,6 +715,8 @@ excludelist:
     - editeng/boxitem.hxx
     - editeng/sizeitem.hxx
     - editeng/lrspitem.hxx
+    - svx/sdmetitm.hxx
+    - svx/sdprcitm.hxx
     - svx/xlnstit.hxx
     - svx/xlnedit.hxx
     - svx/xfillit0.hxx
@@ -671,6 +762,9 @@ excludelist:
     sw/source/uibase/shells/textsh.cxx:
     # Needed for defines in swslots.hxx
     - globals.hrc
+    sw/source/uibase/uiview/srcview.cxx:
+    # Needed for template
+    - com/sun/star/frame/XModel.hpp
     sw/source/uibase/uiview/view0.cxx:
     # Needed for defines in swslots.hxx
     - globals.hrc
@@ -702,6 +796,12 @@ excludelist:
     # Needed for defines in swslots.hxx
     - cmdid.h
     - globals.hrc
+    sw/source/ui/dialog/wordcountdialog.cxx:
+    # Needed for rtl::math::round
+    - rtl/math.hxx
+    sw/source/ui/fldui/fldedt.cxx:
+    # Needed for template
+    - com/sun/star/frame/XModel.hpp
     sw/source/ui/fldui/flddinf.cxx:
     # Needed for direct member access
     - com/sun/star/beans/XPropertySet.hpp
@@ -727,6 +827,9 @@ excludelist:
     sw/source/ui/vba/vbaglobals.cxx:
     # Needed for extern functions
     - service.hxx
+    sw/source/ui/vba/vbalistformat.cxx:
+    # Actually used
+    - comphelper/scopeguard.hxx
     sw/source/ui/vba/vbalisttemplate.cxx:
     # Actually needed
     - com/sun/star/beans/XPropertySet.hpp
@@ -773,3 +876,15 @@ excludelist:
     sw/qa/extras/uiwriter/uiwriter.cxx:
     # Required in C++20 mode.
     - o3tl/cppunittraitshelper.hxx
+    sw/qa/extras/uiwriter/uiwriter2.cxx:
+    # Actually used
+    - comphelper/scopeguard.hxx
+    sw/qa/extras/rtfexport/rtfexport4.cxx:
+    # Required in C++20 mode.
+    - o3tl/cppunittraitshelper.hxx
+    sw/qa/extras/txtexport/txtexport.cxx:
+    # No .hxx -> .h replacement in URE headers
+    - osl/thread.hxx
+    sw/qa/extras/layout/layout2.cxx:
+    # Actually used
+    - comphelper/scopeguard.hxx
diff --git a/sw/inc/HandleAnchorNodeChg.hxx b/sw/inc/HandleAnchorNodeChg.hxx
index c936bea5c6f0..ae46c7e2cc89 100644
--- a/sw/inc/HandleAnchorNodeChg.hxx
+++ b/sw/inc/HandleAnchorNodeChg.hxx
@@ -19,6 +19,9 @@
 #ifndef INCLUDED_SW_INC_HANDLEANCHORNODECHG_HXX
 #define INCLUDED_SW_INC_HANDLEANCHORNODECHG_HXX
 
+#include "pam.hxx"
+#include <wrtsh.hxx>
+
 class SwFlyFrameFormat;
 class SwFormatAnchor;
 class SwFlyFrame;
diff --git a/sw/inc/PageColumnPopup.hxx b/sw/inc/PageColumnPopup.hxx
index 843c14490143..6d50daa1576a 100644
--- a/sw/inc/PageColumnPopup.hxx
+++ b/sw/inc/PageColumnPopup.hxx
@@ -20,7 +20,6 @@
 #define INCLUDED_SW_INC_PAGECOLUMNPOPUP_HXX
 
 #include <svtools/popupwindowcontroller.hxx>
-#include "swdllapi.h"
 
 class PageColumnPopup final : public svt::PopupWindowController
 {
diff --git a/sw/inc/PageMarginPopup.hxx b/sw/inc/PageMarginPopup.hxx
index bb96980a30ab..ddfb7049f037 100644
--- a/sw/inc/PageMarginPopup.hxx
+++ b/sw/inc/PageMarginPopup.hxx
@@ -20,7 +20,6 @@
 #define INCLUDED_SW_INC_PAGEMARGINPOPUP_HXX
 
 #include <svtools/popupwindowcontroller.hxx>
-#include "swdllapi.h"
 
 class PageMarginPopup final : public svt::PopupWindowController
 {
diff --git a/sw/inc/PageOrientationPopup.hxx b/sw/inc/PageOrientationPopup.hxx
index 4ae08907b864..9f50ffdacd60 100644
--- a/sw/inc/PageOrientationPopup.hxx
+++ b/sw/inc/PageOrientationPopup.hxx
@@ -20,7 +20,6 @@
 #define INCLUDED_SW_INC_PAGEORIENTATIONPOPUP_HXX
 
 #include <svtools/popupwindowcontroller.hxx>
-#include "swdllapi.h"
 
 class PageOrientationPopup final : public svt::PopupWindowController
 {
diff --git a/sw/inc/PageSizePopup.hxx b/sw/inc/PageSizePopup.hxx
index d3a59e6c2c40..3eb4088c2af9 100644
--- a/sw/inc/PageSizePopup.hxx
+++ b/sw/inc/PageSizePopup.hxx
@@ -20,7 +20,6 @@
 #define INCLUDED_SW_INC_PAGESIZEPOPUP_HXX
 
 #include <svtools/popupwindowcontroller.hxx>
-#include "swdllapi.h"
 
 class PageSizePopup final : public svt::PopupWindowController
 {
diff --git a/sw/inc/SwNumberTree.hxx b/sw/inc/SwNumberTree.hxx
index fc26817f471b..b4625ab80138 100644
--- a/sw/inc/SwNumberTree.hxx
+++ b/sw/inc/SwNumberTree.hxx
@@ -21,7 +21,6 @@
 
 #include <set>
 #include <vector>
-#include "swdllapi.h"
 #include "SwNumberTreeTypes.hxx"
 
 class SwNumberTreeNode;
diff --git a/sw/inc/cellfml.hxx b/sw/inc/cellfml.hxx
index 1e3c2c506b11..a3934a8003dd 100644
--- a/sw/inc/cellfml.hxx
+++ b/sw/inc/cellfml.hxx
@@ -20,6 +20,8 @@
 #ifndef INCLUDED_SW_INC_CELLFML_HXX
 #define INCLUDED_SW_INC_CELLFML_HXX
 
+#include "swdllapi.h"
+
 #include <memory>
 #include <rtl/ustrbuf.hxx>
 #include <rtl/ustring.hxx>
diff --git a/sw/inc/charatr.hxx b/sw/inc/charatr.hxx
index a49cd5017021..0e97a27abff2 100644
--- a/sw/inc/charatr.hxx
+++ b/sw/inc/charatr.hxx
@@ -35,7 +35,6 @@
 #include <editeng/escapementitem.hxx>
 #include <editeng/cmapitem.hxx>
 #include <editeng/nhypitem.hxx>
-#include <editeng/blinkitem.hxx>
 #include <editeng/emphasismarkitem.hxx>
 #include <editeng/twolinesitem.hxx>
 #include <editeng/charscaleitem.hxx>
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 40a63023f8ac..a68ccce143f1 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -31,7 +31,6 @@
 
 #include <memory>
 #include <vector>
-#include <set>
 #include <o3tl/sorted_vector.hxx>
 
 namespace tools { class PolyPolygon; }
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index 95673e62b2c8..7517afc34715 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -22,7 +22,6 @@
 #include "swdllapi.h"
 #include "fldbas.hxx"
 #include "cellfml.hxx"
-#include <set>
 #include <memory>
 #include <vector>
 #include <tools/solar.h>
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index 847e9d2ef356..5c13eece54ea 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -22,10 +22,10 @@
 #include <i18nlangtag/lang.h>
 #include "swdllapi.h"
 #include "calbck.hxx"
-#include "ndindex.hxx"
 
 #include <cppuhelper/weakref.hxx>
 #include <editeng/svxenum.hxx>
+#include <tools/solar.h>
 #include <vector>
 #include <climits>
 
diff --git a/sw/inc/flypos.hxx b/sw/inc/flypos.hxx
index 933a9a30e5e0..fc098c4ffaab 100644
--- a/sw/inc/flypos.hxx
+++ b/sw/inc/flypos.hxx
@@ -19,7 +19,7 @@
 #ifndef INCLUDED_SW_INC_FLYPOS_HXX
 #define INCLUDED_SW_INC_FLYPOS_HXX
 
-#include "swdllapi.h"
+#include <sal/types.h>
 #include <memory>
 #include <set>
 
diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx
index f65f7d437464..706026120aaa 100644
--- a/sw/inc/fmtfld.hxx
+++ b/sw/inc/fmtfld.hxx
@@ -26,7 +26,6 @@
 
 #include "swdllapi.h"
 #include "calbck.hxx"
-#include "ndindex.hxx"
 #include "reffld.hxx"
 
 class SwField;
diff --git a/sw/inc/grfatr.hxx b/sw/inc/grfatr.hxx
index 55d0f99ddb82..954a1a39dc28 100644
--- a/sw/inc/grfatr.hxx
+++ b/sw/inc/grfatr.hxx
@@ -23,7 +23,7 @@
 #include <tools/gen.hxx>
 #include <svl/eitem.hxx>
 #include <svl/intitem.hxx>
-#include <vcl/GraphicObject.hxx>
+#include <vcl/GraphicAttributes.hxx>
 #include <svx/grfcrop.hxx>
 #include "swdllapi.h"
 #include "swatrset.hxx"
diff --git a/sw/inc/legacyitem.hxx b/sw/inc/legacyitem.hxx
index de7764b6c38f..9ce879d0118a 100644
--- a/sw/inc/legacyitem.hxx
+++ b/sw/inc/legacyitem.hxx
@@ -19,7 +19,7 @@
 #ifndef INCLUDED_SW_LEGACYITEM_HXX
 #define INCLUDED_SW_LEGACYITEM_HXX
 
-#include "swdllapi.h"
+#include <sal/types.h>
 
 //////////////////////////////////////////////////////////////////////////////
 // // sw
diff --git a/sw/inc/ndole.hxx b/sw/inc/ndole.hxx
index 7c07c2656b44..e54be15a22dd 100644
--- a/sw/inc/ndole.hxx
+++ b/sw/inc/ndole.hxx
@@ -21,7 +21,7 @@
 
 #include "ndnotxt.hxx"
 #include <svtools/embedhlp.hxx>
-#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
 #include <rtl/ref.hxx>
 
 class SwGrfFormatColl;
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index b222b6568ed2..190649642ffb 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -33,7 +33,6 @@
 #include <o3tl/sorted_vector.hxx>
 #include <memory>
 #include <vector>
-#include <set>
 #include <functional>
 
 class SfxHint;
diff --git a/sw/inc/pageformatpanel.hrc b/sw/inc/pageformatpanel.hrc
index 70a8bbbc1930..97ccdee9e844 100644
--- a/sw/inc/pageformatpanel.hrc
+++ b/sw/inc/pageformatpanel.hrc
@@ -12,6 +12,8 @@
 
 #define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String)
 
+#include <utility>
+
 namespace sw
 {
 
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index 35bacea29950..8d352b2b423c 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -19,13 +19,12 @@
 #ifndef INCLUDED_SW_INC_REDLINE_HXX
 #define INCLUDED_SW_INC_REDLINE_HXX
 
+#include <svx/ctredlin.hxx>
 #include <tools/datetime.hxx>
 #include <rtl/ustring.hxx>
 
 #include "pam.hxx"
 
-#include "IDocumentRedlineAccess.hxx"
-
 #include <cstddef>
 #include <memory>
 #include <vector>
diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx
index 2b9b6f2f2f2f..22ddffda5881 100644
--- a/sw/inc/unodraw.hxx
+++ b/sw/inc/unodraw.hxx
@@ -22,7 +22,6 @@
 #include <svl/itemprop.hxx>
 #include <svl/listener.hxx>
 #include <svx/fmdpage.hxx>
-#include "calbck.hxx"
 #include "frmfmt.hxx"
 #include <com/sun/star/text/XTextContent.hpp>
 #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
diff --git a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
index e7d96f8ea993..2d3f411d88f0 100644
--- a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
+++ b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
@@ -8,7 +8,6 @@
  */
 
 #include <swmodeltestbase.hxx>
-#include <wrtsh.hxx>
 #include <AccessibilityCheck.hxx>
 #include <unotxdoc.hxx>
 #include <docsh.hxx>
diff --git a/sw/qa/core/filters-test2.cxx b/sw/qa/core/filters-test2.cxx
index e2c3e7e7766f..20d8eed4a644 100644
--- a/sw/qa/core/filters-test2.cxx
+++ b/sw/qa/core/filters-test2.cxx
@@ -10,8 +10,6 @@
 #include <unotest/filters-test.hxx>
 #include <test/bootstrapfixture.hxx>
 
-#include <comphelper/fileformat.h>
-
 #include <sfx2/app.hxx>
 #include <sfx2/docfilt.hxx>
 #include <sfx2/docfile.hxx>
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index e2481d58686b..124b6749fe82 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -8,36 +8,13 @@
  */
 
 #include <swmodeltestbase.hxx>
-#include <comphelper/propertysequence.hxx>
 #include <com/sun/star/linguistic2/LinguServiceManager.hpp>
-#include <com/sun/star/text/WrapTextMode.hpp>
 #include <comphelper/scopeguard.hxx>
-#include <unotools/syslocaleoptions.hxx>
-#include <i18nlangtag/languagetag.hxx>
-#include <vcl/event.hxx>
-#include <vcl/scheduler.hxx>
-#include <editeng/lrspitem.hxx>
-#include <editeng/fontitem.hxx>
-#include <editeng/fhgtitem.hxx>
-#include <editeng/postitem.hxx>
-#include <editeng/unolingu.hxx>
-#include <comphelper/sequence.hxx>
 
 #include <fmtanchr.hxx>
 #include <fmtfsize.hxx>
 #include <fmtcntnt.hxx>
 #include <wrtsh.hxx>
-#include <edtwin.hxx>
-#include <view.hxx>
-#include <txtfrm.hxx>
-#include <pagefrm.hxx>
-#include <bodyfrm.hxx>
-#include <sortedobjs.hxx>
-#include <anchoredobject.hxx>
-#include <ndtxt.hxx>
-#include <frmatr.hxx>
-#include <IDocumentSettingAccess.hxx>
-#include <config_features.h>
 #include <unotxdoc.hxx>
 #include <rootfrm.hxx>
 #include <docsh.hxx>
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index da43c0fa1e90..3d0066d25339 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -9,7 +9,7 @@
 
 #include <swmodeltestbase.hxx>
 #include <comphelper/propertysequence.hxx>
-#include <com/sun/star/linguistic2/LinguServiceManager.hpp>
+#include <com/sun/star/linguistic2/XHyphenator.hpp>
 #include <com/sun/star/text/WrapTextMode.hpp>
 #include <comphelper/scopeguard.hxx>
 #include <unotools/syslocaleoptions.hxx>
@@ -23,9 +23,7 @@
 #include <editeng/unolingu.hxx>
 #include <comphelper/sequence.hxx>
 
-#include <fmtanchr.hxx>
 #include <fmtfsize.hxx>
-#include <fmtcntnt.hxx>
 #include <wrtsh.hxx>
 #include <edtwin.hxx>
 #include <view.hxx>
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 3fc4f8e77cf1..71046fe1ca9e 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -30,7 +30,6 @@
 #include <com/sun/star/text/PageNumberType.hpp>
 #include <com/sun/star/text/VertOrientation.hpp>
 #include <com/sun/star/view/XControlAccess.hpp>
-#include <com/sun/star/util/XNumberFormatTypes.hpp>
 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
 #include <com/sun/star/lang/Locale.hpp>
 #include <com/sun/star/text/XTextFieldsSupplier.hpp>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index 99cbb7fa4ee5..20e45e7a23b5 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -11,7 +11,6 @@
 
 #include <swmodeltestbase.hxx>
 
-#include <com/sun/star/awt/XBitmap.hpp>
 #include <com/sun/star/awt/FontSlant.hpp>
 #include <com/sun/star/awt/FontUnderline.hpp>
 #include <com/sun/star/awt/FontWeight.hpp>
@@ -29,7 +28,6 @@
 #include <com/sun/star/text/WritingMode2.hpp>
 #include <com/sun/star/text/XBookmarksSupplier.hpp>
 #include <com/sun/star/text/XFootnote.hpp>
-#include <com/sun/star/text/XPageCursor.hpp>
 #include <com/sun/star/text/XTextColumns.hpp>
 #include <com/sun/star/text/XTextFrame.hpp>
 #include <com/sun/star/text/XTextFramesSupplier.hpp>
@@ -49,7 +47,6 @@
 #include <com/sun/star/text/XFootnotesSupplier.hpp>
 #include <com/sun/star/text/XTextDocument.hpp>
 #include <com/sun/star/text/XDocumentIndexesSupplier.hpp>
-#include <com/sun/star/util/XModifiable.hpp>
 #include <com/sun/star/text/XEndnotesSupplier.hpp>
 #include <com/sun/star/beans/XPropertyState.hpp>
 
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index db2137081b18..1670d11cfeca 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -30,17 +30,12 @@
 #include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
 #include <com/sun/star/text/XTextTable.hpp>
 #include <com/sun/star/text/XTextTablesSupplier.hpp>
-#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
 
 #include <comphelper/sequenceashashmap.hxx>
 #include <oox/drawingml/drawingmltypes.hxx>
 #include <tools/lineend.hxx>
 #include <unotools/mediadescriptor.hxx>
 
-#include <IDocumentSettingAccess.hxx>
-#include <editsh.hxx>
-#include <frmatr.hxx>
-
 using namespace com::sun::star;
 
 char const DATA_DIRECTORY[] = "/sw/qa/extras/ooxmlexport/data/";
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index acc87b9199aa..0425e05bab32 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -12,8 +12,6 @@
 #include <com/sun/star/drawing/FillStyle.hpp>
 #include <tools/color.hxx>
 #include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/style/BreakType.hpp>
 #include <com/sun/star/text/RelOrientation.hpp>
 #include <com/sun/star/text/XTextViewCursorSupplier.hpp>
 #include <com/sun/star/text/XPageCursor.hpp>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index c56c0739d30b..a7cca71375f3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -12,13 +12,11 @@
 #include <com/sun/star/drawing/FillStyle.hpp>
 #include <com/sun/star/awt/Gradient.hpp>
 #include <com/sun/star/text/XTextTable.hpp>
-#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
 #include <com/sun/star/style/CaseMap.hpp>
 #include <com/sun/star/style/ParagraphAdjust.hpp>
 #include <com/sun/star/table/BorderLine2.hpp>
 #include <com/sun/star/table/ShadowFormat.hpp>
 #include <com/sun/star/text/GraphicCrop.hpp>
-#include <com/sun/star/text/XPageCursor.hpp>
 #include <com/sun/star/text/WritingMode2.hpp>
 #include <com/sun/star/xml/dom/XDocument.hpp>
 #include <com/sun/star/style/BreakType.hpp>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index e503fe92bf6e..c39059e7904d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -20,7 +20,6 @@
 #include <com/sun/star/text/XTextColumns.hpp>
 #include <com/sun/star/table/BorderLine2.hpp>
 #include <com/sun/star/text/XPageCursor.hpp>
-#include <com/sun/star/util/Date.hpp>
 #include <com/sun/star/drawing/XShapes.hpp>
 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
 #include <com/sun/star/packages/zip/ZipFileAccess.hpp>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index f95920b7a9dc..3a099e4a5df9 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -33,17 +33,13 @@
 #include <com/sun/star/text/VertOrientation.hpp>
 #include <com/sun/star/text/WrapTextMode.hpp>
 #include <com/sun/star/text/WritingMode2.hpp>
-#include <com/sun/star/text/XPageCursor.hpp>
 #include <com/sun/star/text/XTextFramesSupplier.hpp>
-#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
 #include <com/sun/star/style/BreakType.hpp>
 #include <com/sun/star/style/ParagraphAdjust.hpp>
 #include <com/sun/star/table/ShadowFormat.hpp>
-#include <com/sun/star/view/XFormLayerAccess.hpp>
 #include <com/sun/star/table/BorderLine2.hpp>
 #include <com/sun/star/table/TableBorder2.hpp>
 #include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/drawing/XShapes2.hpp>
 #include <com/sun/star/text/XNumberingRulesSupplier.hpp>
 #include <com/sun/star/text/XTextTablesSupplier.hpp>
 #include <com/sun/star/drawing/XShapes.hpp>
diff --git a/sw/qa/extras/txtexport/txtexport.cxx b/sw/qa/extras/txtexport/txtexport.cxx
index 0151ee289cc3..3bacc1975c6e 100644
--- a/sw/qa/extras/txtexport/txtexport.cxx
+++ b/sw/qa/extras/txtexport/txtexport.cxx
@@ -9,11 +9,7 @@
 
 #include <swmodeltestbase.hxx>
 
-#include <shellio.hxx>
-#include <unotextrange.hxx>
-#include <iodetect.hxx>
-#include <unotxdoc.hxx>
-#include <docsh.hxx>
+#include <osl/thread.hxx>
 
 class TxtExportTest : public SwModelTestBase
 {
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 8190ef8834ca..40a60f6d3e1e 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -69,6 +69,7 @@
 #include <txtftn.hxx>
 #include <IDocumentDrawModelAccess.hxx>
 #include <IDocumentFieldsAccess.hxx>
+#include <IDocumentRedlineAccess.hxx>
 #include <IDocumentState.hxx>
 #include <unofldmid.h>
 #include <UndoManager.hxx>
@@ -100,7 +101,6 @@
 #include <com/sun/star/text/XTextViewCursorSupplier.hpp>
 #include <com/sun/star/text/XPageCursor.hpp>
 #include <o3tl/cppunittraitshelper.hxx>
-#include <o3tl/make_shared.hxx>
 #include <osl/file.hxx>
 #include <osl/thread.hxx>
 #include <paratr.hxx>
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index de5892c4b7bf..38b9e6e7115a 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -11,7 +11,6 @@
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
 #include <vcl/scheduler.hxx>
 #include <com/sun/star/drawing/GraphicExportFilter.hpp>
-#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
 #include <IDocumentDrawModelAccess.hxx>
 #include <com/sun/star/text/TextContentAnchorType.hpp>
 #include <com/sun/star/text/XTextTablesSupplier.hpp>
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index d63310b661c6..7fca28bb49e5 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -20,11 +20,10 @@
 #include <sfx2/docfile.hxx>
 #include <sfx2/docfilt.hxx>
 
-#include <viscrs.hxx>
-#include <wrtsh.hxx>
 #include <ndgrf.hxx>
 #include <docsh.hxx>
 #include <unotxdoc.hxx>
+#include <viewsh.hxx>
 #include <IDocumentLayoutAccess.hxx>
 
 // tests should only be added to ww8IMPORT *if* they fail round-tripping in ww8EXPORT
diff --git a/sw/qa/uibase/uiview/uiview.cxx b/sw/qa/uibase/uiview/uiview.cxx
index 4d622aafaa5f..9f84a734a016 100644
--- a/sw/qa/uibase/uiview/uiview.cxx
+++ b/sw/qa/uibase/uiview/uiview.cxx
@@ -9,21 +9,17 @@
 
 #include <swmodeltestbase.hxx>
 
-#include <unotools/mediadescriptor.hxx>
 #include <comphelper/processfactory.hxx>
 #include <osl/file.hxx>
 #include <comphelper/propertyvalue.hxx>
 
-#include <com/sun/star/frame/DispatchHelper.hpp>
+#include <com/sun/star/frame/XDispatchHelper.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
 #include <com/sun/star/frame/XComponentLoader.hpp>
+#include <com/sun/star/frame/XStorable2.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/packages/zip/ZipFileAccess.hpp>
 
-#include <unotxdoc.hxx>
-#include <docsh.hxx>
-#include <wrtsh.hxx>
-#include <swdtflvr.hxx>
-
 char const DATA_DIRECTORY[] = "/sw/qa/uibase/uiview/data/";
 
 /// Covers sw/source/uibase/uiview/ fixes.
diff --git a/sw/source/core/SwNumberTree/SwNodeNum.cxx b/sw/source/core/SwNumberTree/SwNodeNum.cxx
index c433a4e36351..a097f3b7a74f 100644
--- a/sw/source/core/SwNumberTree/SwNodeNum.cxx
+++ b/sw/source/core/SwNumberTree/SwNodeNum.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <osl/diagnose.h>
-#include <svl/stritem.hxx>
 #include <numrule.hxx>
 #include <SwNodeNum.hxx>
 #include <ndtxt.hxx>
diff --git a/sw/source/core/access/AccessibilityCheck.cxx b/sw/source/core/access/AccessibilityCheck.cxx
index b2299ca36c59..b8dc54b69ccf 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -11,8 +11,7 @@
 #include <AccessibilityCheck.hxx>
 #include <AccessibilityIssue.hxx>
 #include <AccessibilityCheckStrings.hrc>
-#include <ndgrf.hxx>
-#include <ndole.hxx>
+#include <ndnotxt.hxx>
 #include <ndtxt.hxx>
 #include <docsh.hxx>
 #include <IDocumentDrawModelAccess.hxx>
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index cf59efdb21ce..4b9777b74c36 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -44,7 +44,6 @@
 #include <txtfrm.hxx>
 #include <sectfrm.hxx>
 #include <section.hxx>
-#include <svx/unoapi.hxx>
 #include <swmodule.hxx>
 #include <svtools/colorcfg.hxx>
 
diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx
index c472490f8b59..6b2f57682316 100644
--- a/sw/source/core/access/accportions.cxx
+++ b/sw/source/core/access/accportions.cxx
@@ -22,6 +22,7 @@
 #include <string_view>
 
 #include "accportions.hxx"
+#include <osl/diagnose.h>
 #include <rtl/ustring.hxx>
 #include <com/sun/star/i18n/Boundary.hpp>
 #include <com/sun/star/i18n/XBreakIterator.hpp>
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index 9564aa7a8f26..2adcda28e35a 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -36,7 +36,6 @@
 #include <swtable.hxx>
 #include <crsrsh.hxx>
 #include <viscrs.hxx>
-#include <hints.hxx>
 #include "accfrmobjslist.hxx"
 #include <accmap.hxx>
 #include <strings.hrc>
diff --git a/sw/source/core/access/acctable.hxx b/sw/source/core/access/acctable.hxx
index eea56e379015..a1207986c347 100644
--- a/sw/source/core/access/acctable.hxx
+++ b/sw/source/core/access/acctable.hxx
@@ -24,7 +24,6 @@
 #include <vector>
 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
 
-#include <svl/poolitem.hxx>
 #include <svl/listener.hxx>
 
 #include "acccontext.hxx"
diff --git a/sw/source/core/access/parachangetrackinginfo.cxx b/sw/source/core/access/parachangetrackinginfo.cxx
index 5fcc6f41c8db..0943dc15ea25 100644
--- a/sw/source/core/access/parachangetrackinginfo.cxx
+++ b/sw/source/core/access/parachangetrackinginfo.cxx
@@ -21,6 +21,7 @@
 
 #include <wrong.hxx>
 #include <com/sun/star/text/TextMarkupType.hpp>
+#include <osl/diagnose.h>
 
 #include <txtfrm.hxx>
 #include <rootfrm.hxx>
diff --git a/sw/source/core/access/textmarkuphelper.cxx b/sw/source/core/access/textmarkuphelper.cxx
index 887633412248..5329241c6f1b 100644
--- a/sw/source/core/access/textmarkuphelper.cxx
+++ b/sw/source/core/access/textmarkuphelper.cxx
@@ -21,7 +21,6 @@
 #include "accportions.hxx"
 
 #include <vector>
-#include <algorithm>
 
 #include <com/sun/star/text/TextMarkupType.hpp>
 #include <com/sun/star/accessibility/TextSegment.hpp>
diff --git a/sw/source/core/attr/cellatr.cxx b/sw/source/core/attr/cellatr.cxx
index 8b97ff2095fa..09003a7fff64 100644
--- a/sw/source/core/attr/cellatr.cxx
+++ b/sw/source/core/attr/cellatr.cxx
@@ -25,7 +25,6 @@
 #include <hints.hxx>
 #include <node.hxx>
 #include <rolbck.hxx>
-#include <rtl/math.hxx>
 #include <rtl/ustring.hxx>
 #include <calbck.hxx>
 #include <swtable.hxx>
diff --git a/sw/source/core/attr/fmtfollowtextflow.cxx b/sw/source/core/attr/fmtfollowtextflow.cxx
index 71c390d4bbbe..5b424053731e 100644
--- a/sw/source/core/attr/fmtfollowtextflow.cxx
+++ b/sw/source/core/attr/fmtfollowtextflow.cxx
@@ -18,9 +18,6 @@
  */
 
 #include <fmtfollowtextflow.hxx>
-#include <unomid.h>
-
-#include <sal/log.hxx>
 
 SwFormatFollowTextFlow* SwFormatFollowTextFlow::Clone(SfxItemPool*) const
 {
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index 459f66ccd3f2..1af9e993a35a 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -27,6 +27,7 @@
 #include <hints.hxx>
 #include <swcache.hxx>
 #include <frmatr.hxx>
+#include <osl/diagnose.h>
 #include <svl/grabbagitem.hxx>
 #include <svx/sdr/attribute/sdrallfillattributeshelper.hxx>
 #include <svx/unobrushitemhelper.hxx>
diff --git a/sw/source/core/crsr/annotationmark.cxx b/sw/source/core/crsr/annotationmark.cxx
index 061d88a08323..62895ab852c9 100644
--- a/sw/source/core/crsr/annotationmark.cxx
+++ b/sw/source/core/crsr/annotationmark.cxx
@@ -24,7 +24,6 @@
 #include <IDocumentFieldsAccess.hxx>
 #include <IDocumentState.hxx>
 #include <fldbas.hxx>
-#include <calbck.hxx>
 #include <fmtfld.hxx>
 #include <docufld.hxx>
 #include <IDocumentUndoRedo.hxx>
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 89352072ac70..d2359c82a0cc 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -27,6 +27,7 @@
 #include <pam.hxx>
 #include <swserv.hxx>
 #include <sfx2/linkmgr.hxx>
+#include <sfx2/viewsh.hxx>
 #include <UndoBookmark.hxx>
 #include <unobookmark.hxx>
 #include <xmloff/odffields.hxx>
@@ -41,11 +42,8 @@
 #include <DocumentContentOperationsManager.hxx>
 #include <comphelper/lok.hxx>
 #include <txtfrm.hxx>
-#include <view.hxx>
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
-#include <wrtsh.hxx>
 #include <rtl/strbuf.hxx>
-#include <sfx2/lokhelper.hxx>
 #include <strings.hrc>
 
 using namespace ::sw::mark;
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 300691c950a0..955622409af8 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <com/sun/star/i18n/XBreakIterator.hpp>
+#include <osl/diagnose.h>
 #include <fmtcntnt.hxx>
 #include <txatbase.hxx>
 #include "callnk.hxx"
diff --git a/sw/source/core/crsr/callnk.hxx b/sw/source/core/crsr/callnk.hxx
index 713f469bb6cc..ca47821c147f 100644
--- a/sw/source/core/crsr/callnk.hxx
+++ b/sw/source/core/crsr/callnk.hxx
@@ -20,6 +20,7 @@
 #ifndef INCLUDED_SW_SOURCE_CORE_CRSR_CALLNK_HXX
 #define INCLUDED_SW_SOURCE_CORE_CRSR_CALLNK_HXX
 
+#include <tools/long.hxx>
 #include <tools/solar.h>
 #include <ndtyp.hxx>
 
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index 5824a83007fd..85d7830c502f 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -22,6 +22,7 @@
 #include <com/sun/star/util/SearchFlags.hpp>
 #include <i18nlangtag/languagetag.hxx>
 #include <i18nutil/searchopt.hxx>
+#include <osl/diagnose.h>
 #include <unotools/syslocale.hxx>
 #include <hintids.hxx>
 #include <svl/itemiter.hxx>
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 55775a358826..6d7e8e388046 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -44,6 +44,7 @@
 #include <DocumentSettingManager.hxx>
 #include <hints.hxx>
 #include <txatbase.hxx>
+#include <osl/diagnose.h>
 #include <xmloff/odffields.hxx>
 #include <rtl/ustrbuf.hxx>
 
diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx
index fb093622b51a..92285077fc95 100644
--- a/sw/source/core/crsr/trvltbl.cxx
+++ b/sw/source/core/crsr/trvltbl.cxx
@@ -32,6 +32,7 @@
 #include <shellres.hxx>
 #include <cellfrm.hxx>
 #include <IDocumentLayoutAccess.hxx>
+#include <osl/diagnose.h>
 #include <svx/srchdlg.hxx>
 
 /// set cursor into next/previous cell
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 92dbbdb29f49..7a364b2ee83a 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <config_features.h>
+#include <config_feature_desktop.h>
 
 #include <vcl/weld.hxx>
 #include <vcl/svapp.hxx>
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 360b3fae7f9c..62e5b078f73e 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -22,6 +22,7 @@
 #include <IDocumentMarkAccess.hxx>
 #include <IDocumentState.hxx>
 #include <IDocumentLayoutAccess.hxx>
+#include <IDocumentRedlineAccess.hxx>
 #include <IDocumentStylePoolAccess.hxx>
 #include <IDocumentSettingAccess.hxx>
 #include <UndoManager.hxx>
diff --git a/sw/source/core/doc/DocumentDeviceManager.cxx b/sw/source/core/doc/DocumentDeviceManager.cxx
index 5dadd15d2130..5083838684aa 100644
--- a/sw/source/core/doc/DocumentDeviceManager.cxx
+++ b/sw/source/core/doc/DocumentDeviceManager.cxx
@@ -27,6 +27,7 @@
 #include <IDocumentDrawModelAccess.hxx>
 #include <IDocumentState.hxx>
 #include <IDocumentLayoutAccess.hxx>
+#include <osl/diagnose.h>
 #include <sfx2/printer.hxx>
 #include <vcl/virdev.hxx>
 #include <vcl/outdev.hxx>
diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx
index cbae4727e10d..4ef9322d7c91 100644
--- a/sw/source/core/doc/DocumentFieldsManager.cxx
+++ b/sw/source/core/doc/DocumentFieldsManager.cxx
@@ -53,6 +53,7 @@
 #include <ndindex.hxx>
 #include <pam.hxx>
 #include <o3tl/deleter.hxx>
+#include <osl/diagnose.h>
 #include <unotools/transliterationwrapper.hxx>
 #include <comphelper/scopeguard.hxx>
 #include <com/sun/star/uno/Any.hxx>
diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx b/sw/source/core/doc/DocumentLayoutManager.cxx
index 7df5d2871f91..727aa8428611 100644
--- a/sw/source/core/doc/DocumentLayoutManager.cxx
+++ b/sw/source/core/doc/DocumentLayoutManager.cxx
@@ -35,7 +35,6 @@
 #include <fmtflcnt.hxx>
 #include <ndtxt.hxx>
 #include <unoframe.hxx>
-#include <docary.hxx>
 #include <textboxhelper.hxx>
 #include <ndindex.hxx>
 #include <pam.hxx>
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index 466ffa0464a0..7b004695dbd6 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -37,6 +37,7 @@
 #include <authfld.hxx>
 #include <strings.hrc>
 #include <swmodule.hxx>
+#include <osl/diagnose.h>
 
 using namespace com::sun::star;
 
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx
index 5f609221752f..f6c15065a453 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -26,6 +26,7 @@
 #include <IDocumentLayoutAccess.hxx>
 #include <comphelper/processfactory.hxx>
 #include <editeng/forbiddencharacterstable.hxx>
+#include <osl/diagnose.h>
 #include <svx/svdmodel.hxx>
 #include <svl/asiancfg.hxx>
 #include <unotools/compatibility.hxx>
diff --git a/sw/source/core/doc/DocumentStatisticsManager.cxx b/sw/source/core/doc/DocumentStatisticsManager.cxx
index dd67d88ea89e..c222017cfda8 100644
--- a/sw/source/core/doc/DocumentStatisticsManager.cxx
+++ b/sw/source/core/doc/DocumentStatisticsManager.cxx
@@ -25,7 +25,6 @@
 #include <IDocumentLayoutAccess.hxx>
 #include <view.hxx>
 #include <ndtxt.hxx>
-#include <calbck.hxx>
 #include <fmtfld.hxx>
 #include <rootfrm.hxx>
 #include <docufld.hxx>
diff --git a/sw/source/core/doc/DocumentTimerManager.cxx b/sw/source/core/doc/DocumentTimerManager.cxx
index 4b3d6dd3856f..4f4875cf775c 100644
--- a/sw/source/core/doc/DocumentTimerManager.cxx
+++ b/sw/source/core/doc/DocumentTimerManager.cxx
@@ -26,7 +26,6 @@
 #include <viewsh.hxx>
 #include <unotools/lingucfg.hxx>
 #include <unotools/linguprops.hxx>
-#include <set>
 #include <fldupde.hxx>
 #include <sfx2/progress.hxx>
 #include <viewopt.hxx>
diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index ebf380b6e081..3aa05a5f579a 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -19,7 +19,6 @@
 
 #include <tools/urlobj.hxx>
 #include <hintids.hxx>
-#include <hints.hxx>
 #include <acmplwrd.hxx>
 #include <doc.hxx>
 #include <pagedesc.hxx>
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index 05a8e0b2d810..a742754f6010 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -23,7 +23,6 @@
 #include <rtl/ustring.hxx>
 #include <svl/poolitem.hxx>
 #include <svl/itemiter.hxx>
-#include <string>
 #include <map>
 #include <node.hxx>
 #include <ndtxt.hxx>
@@ -31,7 +30,6 @@
 #include <txatbase.hxx>
 #include <pam.hxx>
 #include <docary.hxx>
-#include <swundo.hxx>
 #include <undobj.hxx>
 #include <numrule.hxx>
 #include <doc.hxx>
diff --git a/sw/source/core/doc/docbasic.cxx b/sw/source/core/doc/docbasic.cxx
index 4fb0db9641c5..e0d62e645644 100644
--- a/sw/source/core/doc/docbasic.cxx
+++ b/sw/source/core/doc/docbasic.cxx
@@ -28,7 +28,6 @@
 #include <fmtinfmt.hxx>
 #include <fmturl.hxx>
 #include <frmatr.hxx>
-#include <docary.hxx>
 #include <doc.hxx>
 #include <docsh.hxx>
 #include <swevent.hxx>
diff --git a/sw/source/core/doc/docchart.cxx b/sw/source/core/doc/docchart.cxx
index 053fbad4f3ee..cfa3f153074b 100644
--- a/sw/source/core/doc/docchart.cxx
+++ b/sw/source/core/doc/docchart.cxx
@@ -21,7 +21,6 @@
 #include <IDocumentChartDataProviderAccess.hxx>
 #include <IDocumentState.hxx>
 #include <IDocumentLayoutAccess.hxx>
-#include <docary.hxx>
 #include <ndindex.hxx>
 #include <swtable.hxx>
 #include <viewsh.hxx>
@@ -30,6 +29,7 @@
 #include <tblsel.hxx>
 #include <frameformats.hxx>
 #include <unochart.hxx>
+#include <osl/diagnose.h>
 
 void SwTable::UpdateCharts() const
 {
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx
index 9a31c6ad01e6..2c8ce7eec4c0 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -19,6 +19,7 @@
 
 #include <doc.hxx>
 #include <IDocumentLayoutAccess.hxx>
+#include <IDocumentRedlineAccess.hxx>
 #include <node.hxx>
 #include <editsh.hxx>
 #include <viscrs.hxx>
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 1e0c8d1d6a1d..bd5308e27790 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -57,7 +57,6 @@
 #include <unotools/configmgr.hxx>
 #include <unotools/syslocale.hxx>
 #include <svx/swframetypes.hxx>
-#include <svx/svxids.hrc>
 #include <com/sun/star/embed/XEmbeddedObject.hpp>
 
 using namespace com::sun::star;
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 3f0b3802b417..9efeb5c1ec75 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -43,6 +43,7 @@
 #include <vector>
 #include <com/sun/star/linguistic2/XProofreadingIterator.hpp>
 #include <com/sun/star/frame/XModel.hpp>
+#include <osl/diagnose.h>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::linguistic2;
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 6646c903d6e6..ad21d076a3ac 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -22,8 +22,8 @@
 #include <hintids.hxx>
 
 #include <comphelper/string.hxx>
+#include <osl/diagnose.h>
 #include <unotools/charclass.hxx>
-#include <unotools/transliterationwrapper.hxx>
 #include <doc.hxx>
 #include <IDocumentFieldsAccess.hxx>
 #include <IDocumentState.hxx>
@@ -51,8 +51,6 @@
 #include <txtinet.hxx>
 #include <fmtcntnt.hxx>
 
-#include <calbck.hxx>
-
 using namespace ::com::sun::star::uno;
 
 // the StartIndex can be supplied optionally (e.g. if it was queried before - is a virtual
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 988e59c76a58..1c2408e235ae 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -31,7 +31,6 @@
 #include <IDocumentState.hxx>
 #include <IDocumentLayoutAccess.hxx>
 #include <ndindex.hxx>
-#include <docary.hxx>
 #include <drawdoc.hxx>
 #include <fmtcntnt.hxx>
 #include <fmtanchr.hxx>
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 281e9cb9de64..c4c8b1a64ebc 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -26,6 +26,7 @@
 #include <editeng/rsiditem.hxx>
 #include <editeng/colritem.hxx>
 #include <officecfg/Office/Common.hxx>
+#include <osl/diagnose.h>
 #include <svl/zforlist.hxx>
 #include <comphelper/doublecheckedinit.hxx>
 #include <comphelper/processfactory.hxx>
@@ -47,6 +48,7 @@
 #include <IDocumentFieldsAccess.hxx>
 #include <IDocumentState.hxx>
 #include <IDocumentLayoutAccess.hxx>
+#include <IDocumentRedlineAccess.hxx>
 #include <IDocumentStylePoolAccess.hxx>
 #include <rootfrm.hxx>
 #include <txtfrm.hxx>
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index 44963f66b781..286f0b4ad47f 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -25,7 +25,6 @@
 #include <pagedesc.hxx>
 #include <charfmt.hxx>
 #include <UndoAttribute.hxx>
-#include <hints.hxx>
 #include <rolbck.hxx>
 #include <doc.hxx>
 #include <IDocumentFieldsAccess.hxx>
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 3380b5e6bc15..e656ee85e78d 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -103,7 +103,6 @@
 #include <svx/xfillit0.hxx>
 #include <unotools/configmgr.hxx>
 #include <i18nlangtag/mslangid.hxx>
-#include <editeng/langitem.hxx>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::document;
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 29905b64a246..f8ac5687b6cc 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -18,13 +18,13 @@
  */
 
 #include <hintids.hxx>
-#include <editeng/lrspitem.hxx>
 #include <ftninfo.hxx>
 #include <ftnidx.hxx>
 #include <doc.hxx>
 #include <IDocumentUndoRedo.hxx>
 #include <IDocumentListsAccess.hxx>
 #include <IDocumentFieldsAccess.hxx>
+#include <IDocumentRedlineAccess.hxx>
 #include <IDocumentState.hxx>
 #include <IDocumentStylePoolAccess.hxx>
 #include <pam.hxx>
@@ -49,6 +49,7 @@
 #include <comphelper/string.hxx>
 #include <comphelper/random.hxx>
 #include <o3tl/safeint.hxx>
+#include <osl/diagnose.h>
 #include <tools/datetimeutils.hxx>
 
 #include <map>
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index b15a22dbe1f9..25a664d17bf8 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -28,6 +28,7 @@
 #include <doc.hxx>
 #include <IDocumentUndoRedo.hxx>
 #include <IDocumentFieldsAccess.hxx>
+#include <IDocumentRedlineAccess.hxx>
 #include <IDocumentState.hxx>
 #include <node.hxx>
 #include <pam.hxx>
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 9f274cb1f8c0..d367ce54a482 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -59,7 +59,6 @@
 #include <node2lay.hxx>
 #include <SwStyleNameMapper.hxx>
 #include <breakit.hxx>
-#include <scriptinfo.hxx>
 #include <calbck.hxx>
 #include <ToxTextGenerator.hxx>
 #include <ToxTabStopTokenHandler.hxx>
@@ -68,6 +67,7 @@
 #include <tools/globname.hxx>
 #include <com/sun/star/embed/XEmbeddedObject.hpp>
 #include <o3tl/safeint.hxx>
+#include <osl/diagnose.h>
 
 #include <memory>
 
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index 31edb6dff0bc..67dc9b9c56b5 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -39,6 +39,7 @@
 #include <htmltbl.hxx>
 #include <calbck.hxx>
 #include <o3tl/numeric.hxx>
+#include <osl/diagnose.h>
 #ifdef DBG_UTIL
 #include <tblrwcl.hxx>
 #endif
diff --git a/sw/source/core/doc/lineinfo.cxx b/sw/source/core/doc/lineinfo.cxx
index 094c3854a8e9..2a9963f39cda 100644
--- a/sw/source/core/doc/lineinfo.cxx
+++ b/sw/source/core/doc/lineinfo.cxx
@@ -25,7 +25,7 @@
 #include <charfmt.hxx>
 #include <poolfmt.hxx>
 #include <rootfrm.hxx>
-#include <set>
+#include <osl/diagnose.h>
 
 void SwDoc::SetLineNumberInfo( const SwLineNumberInfo &rNew )
 {
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 8bf008297233..15778a3a5863 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -55,7 +55,6 @@
 #include <ndole.hxx>
 #include <swregion.hxx>
 #include <poolfmt.hxx>
-#include <mdiexp.hxx>
 #include <strings.hrc>
 #include <accessibilityoptions.hxx>
 #include <com/sun/star/embed/EmbedMisc.hpp>
diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index ba2eac002e9b..6bc270801873 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -36,7 +36,6 @@
 #include <poolfmt.hxx>
 #include <cellatr.hxx>
 #include <mvsave.hxx>
-#include <docary.hxx>
 #include <fmtanchr.hxx>
 #include <hints.hxx>
 #include <UndoTable.hxx>
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index 37fe854f88c4..6ccc17003f53 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -24,7 +24,6 @@
 #include <ndtxt.hxx>
 #include <swtblfmt.hxx>
 #include <cellatr.hxx>
-#include <docary.hxx>
 #include <ddefld.hxx>
 #include <swddetbl.hxx>
 #include <ndindex.hxx>
diff --git a/sw/source/core/docnode/ndnotxt.cxx b/sw/source/core/docnode/ndnotxt.cxx
index 3da7273bfc7c..4e04943b92c3 100644
--- a/sw/source/core/docnode/ndnotxt.cxx
+++ b/sw/source/core/docnode/ndnotxt.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <hintids.hxx>
+#include <osl/diagnose.h>
 #include <tools/poly.hxx>
 #include <svl/stritem.hxx>
 #include <svx/contdlg.hxx>
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index be7774ae238a..b13c8fe662ce 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <hintids.hxx>
+#include <osl/diagnose.h>
 #include <sfx2/linkmgr.hxx>
 #include <svl/itemiter.hxx>
 #include <sal/log.hxx>
@@ -28,6 +29,7 @@
 #include <IDocumentLinksAdministration.hxx>
 #include <IDocumentLayoutAccess.hxx>
 #include <IDocumentFieldsAccess.hxx>
+#include <IDocumentRedlineAccess.hxx>
 #include <IDocumentState.hxx>
 #include <rootfrm.hxx>
 #include <pam.hxx>
@@ -52,7 +54,6 @@
 #include <strings.hrc>
 #include <viewsh.hxx>
 #include <txtfrm.hxx>
-#include <hints.hxx>
 #include <memory>
 #include "ndsect.hxx"
 #include <tools/datetimeutils.hxx>
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 7c4155f5badf..2ed5ff85a3c4 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -19,6 +19,7 @@
 
 #include <hintids.hxx>
 #include <editeng/protitem.hxx>
+#include <osl/diagnose.h>
 #include <tools/gen.hxx>
 #include <com/sun/star/i18n/CharacterIteratorMode.hpp>
 #include <com/sun/star/i18n/XBreakIterator.hpp>
@@ -28,7 +29,6 @@
 #include <txtftn.hxx>
 #include <ftnfrm.hxx>
 #include <doc.hxx>
-#include <docary.hxx>
 #include <node.hxx>
 #include <ndindex.hxx>
 #include <numrule.hxx>
diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx
index 17b8a82e707d..e44c7d2f3083 100644
--- a/sw/source/core/docnode/node2lay.cxx
+++ b/sw/source/core/docnode/node2lay.cxx
@@ -28,6 +28,7 @@
 #include <frmtool.hxx>
 #include <section.hxx>
 #include <node2lay.hxx>
+#include <osl/diagnose.h>
 
 /**
  * The SwNode2LayImpl class does the actual work, the SwNode2Layout class is
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 00adf5a40f47..e20a5f14319a 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -21,6 +21,7 @@
 #include <libxml/xmlwriter.h>
 #include <stdlib.h>
 #include <hintids.hxx>
+#include <osl/diagnose.h>
 #include <sot/exchange.hxx>
 #include <svl/stritem.hxx>
 #include <sfx2/docfile.hxx>
@@ -53,7 +54,6 @@
 #include <poolfmt.hxx>
 #include <swbaslnk.hxx>
 #include <mvsave.hxx>
-#include <fmtftntx.hxx>
 #include <ftnidx.hxx>
 #include <doctxm.hxx>
 #include <fmteiro.hxx>
diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx
index 544aa0f414bd..1929575a94c6 100644
--- a/sw/source/core/docnode/swbaslnk.cxx
+++ b/sw/source/core/docnode/swbaslnk.cxx
@@ -17,12 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <hintids.hxx>
 #include <vcl/svapp.hxx>
 
-#include <sfx2/docfile.hxx>
+#include <osl/diagnose.h>
 #include <sfx2/lnkbase.hxx>
-#include <sfx2/objsh.hxx>
 #include <editeng/boxitem.hxx>
 #include <sfx2/linkmgr.hxx>
 #include <sfx2/event.hxx>
@@ -32,8 +30,8 @@
 #include <frmatr.hxx>
 #include <frmfmt.hxx>
 #include <doc.hxx>
-#include <DocumentLinksAdministrationManager.hxx>
 #include <IDocumentLayoutAccess.hxx>
+#include <IDocumentLinksAdministration.hxx>
 #include <pam.hxx>
 #include <swtable.hxx>
 #include <swevent.hxx>
@@ -41,10 +39,7 @@
 #include <swserv.hxx>
 #include <viewsh.hxx>
 #include <ndgrf.hxx>
-#include <hints.hxx>
-#include <cntfrm.hxx>
 #include <htmltbl.hxx>
-#include <calbck.hxx>
 #include <dialoghelp.hxx>
 #include <memory>
 
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 8707bcbaeb84..eb406e418ac9 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -19,7 +19,6 @@
 
 #include <memory>
 #include <hintids.hxx>
-#include <editeng/lrspitem.hxx>
 #include <svx/svdpage.hxx>
 #include <svx/svditer.hxx>
 #include <svx/svdogrp.hxx>
@@ -54,7 +53,6 @@
 #include <hints.hxx>
 #include <txtfrm.hxx>
 #include <frameformats.hxx>
-#include <docary.hxx>
 #include <sortedobjs.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index a1c06e0442d1..a45f1a7de11c 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -31,16 +31,12 @@
 #include <shellio.hxx>
 #include <swundo.hxx>
 #include <viscrs.hxx>
-#include <com/sun/star/i18n/BreakType.hpp>
-#include <com/sun/star/i18n/WordType.hpp>
-#include <com/sun/star/i18n/XBreakIterator.hpp>
 #include <com/sun/star/linguistic2/XHyphenator.hpp>
 #include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
+#include <osl/diagnose.h>
 #include <svl/zforlist.hxx>
-#include <svl/zformat.hxx>
 
 #include <editeng/acorrcfg.hxx>
-#include <redline.hxx>
 #include <IDocumentRedlineAccess.hxx>
 #include <rootfrm.hxx>
 
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index bd0cfc1972fb..f6dfd99988e8 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -19,6 +19,7 @@
 
 #include <hintids.hxx>
 
+#include <osl/diagnose.h>
 #include <unotools/charclass.hxx>
 
 #include <editeng/boxitem.hxx>
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 58bb555c2e08..dc8769f2a61a 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -23,6 +23,7 @@
 #include <editeng/lrspitem.hxx>
 #include <com/sun/star/i18n/ScriptType.hpp>
 #include <com/sun/star/i18n/XBreakIterator.hpp>
+#include <osl/diagnose.h>
 #include <txatbase.hxx>
 #include <txtftn.hxx>
 #include <fmtftn.hxx>
diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx
index ce1aaecad7a4..536a0c1643ff 100644
--- a/sw/source/core/edit/edglss.cxx
+++ b/sw/source/core/edit/edglss.cxx
@@ -20,13 +20,13 @@
 #include <sal/config.h>
 
 #include <o3tl/safeint.hxx>
+#include <osl/diagnose.h>
 #include <osl/endian.h>
 #include <tools/urlobj.hxx>
 #include <doc.hxx>
 #include <IDocumentRedlineAccess.hxx>
 #include <IDocumentFieldsAccess.hxx>
 #include <pam.hxx>
-#include <docary.hxx>
 #include <editsh.hxx>
 #include <frmfmt.hxx>
 #include <rootfrm.hxx>
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 2a665015cc50..c956c2544c44 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <hintids.hxx>
+#include <osl/diagnose.h>
 #include <vcl/commandevent.hxx>
 #include <unotools/charclass.hxx>
 #include <comphelper/processfactory.hxx>
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index b9bf879a5cbe..51e63d16c6f3 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -31,6 +31,7 @@
 
 #include <strings.hrc>
 #include <hintids.hxx>
+#include <osl/diagnose.h>
 #include <unotools/linguprops.hxx>
 #include <linguistic/lngprops.hxx>
 #include <editeng/langitem.hxx>
diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx
index 354e2782e20c..58b587e11dcb 100644
--- a/sw/source/core/edit/ednumber.cxx
+++ b/sw/source/core/edit/ednumber.cxx
@@ -26,6 +26,7 @@
 #include <txtfrm.hxx>
 #include <swundo.hxx>
 #include <numrule.hxx>
+#include <osl/diagnose.h>
 
 SwPamRanges::SwPamRanges( const SwPaM& rRing )
 {
diff --git a/sw/source/core/edit/edredln.cxx b/sw/source/core/edit/edredln.cxx
index a1ff08b5df9c..3fd94b4a64d5 100644
--- a/sw/source/core/edit/edredln.cxx
+++ b/sw/source/core/edit/edredln.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <IDocumentRedlineAccess.hxx>
 #include <docary.hxx>
 #include <redline.hxx>
 #include <doc.hxx>
diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx
index 662293a8d5c8..bbc58b2747a7 100644
--- a/sw/source/core/edit/edsect.cxx
+++ b/sw/source/core/edit/edsect.cxx
@@ -29,6 +29,7 @@
 #include <cntfrm.hxx>
 #include <tabfrm.hxx>
 #include <rootfrm.hxx>
+#include <osl/diagnose.h>
 
 SwSection const*
 SwEditShell::InsertSection(
diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx
index d7876e31a4fb..e21469f6408b 100644
--- a/sw/source/core/edit/edws.cxx
+++ b/sw/source/core/edit/edws.cxx
@@ -20,6 +20,7 @@
 #include <editsh.hxx>
 
 #include <officecfg/Office/Common.hxx>
+#include <osl/diagnose.h>
 #include <unotools/configmgr.hxx>
 #include <vcl/window.hxx>
 
@@ -27,7 +28,6 @@
 #include <IDocumentUndoRedo.hxx>
 #include <IDocumentState.hxx>
 #include <pam.hxx>
-#include <docary.hxx>
 #include <acorrect.hxx>
 #include <swtable.hxx>
 #include <ndtxt.hxx>
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index d75b079cf639..7efac3af55f3 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -21,6 +21,7 @@
 #include <comphelper/string.hxx>
 #include <i18nlangtag/languagetag.hxx>
 #include <o3tl/any.hxx>
+#include <osl/diagnose.h>
 #include <swtypes.hxx>
 #include <strings.hrc>
 #include <authfld.hxx>
@@ -38,7 +39,6 @@
 #include <IDocumentLayoutAccess.hxx>
 #include <unofldmid.h>
 #include <unoprnms.hxx>
-#include <calbck.hxx>
 
 #include <com/sun/star/beans/PropertyValues.hpp>
 
diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx
index 04321a37a4f8..6f7c7789a848 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -32,7 +32,6 @@
 #include <tabfrm.hxx>
 #include <doc.hxx>
 #include <IDocumentLayoutAccess.hxx>
-#include <docary.hxx>
 #include <ndtxt.hxx>
 #include <swtable.hxx>
 #include <tblsel.hxx>
@@ -46,6 +45,7 @@
 #include <frameformats.hxx>
 #include <comphelper/string.hxx>
 #include <o3tl/safeint.hxx>
+#include <osl/diagnose.h>
 
 namespace
 {
diff --git a/sw/source/core/fields/chpfld.cxx b/sw/source/core/fields/chpfld.cxx
index e275aedf8592..191c1de85110 100644
--- a/sw/source/core/fields/chpfld.cxx
+++ b/sw/source/core/fields/chpfld.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <com/sun/star/text/ChapterFormat.hpp>
+#include <osl/diagnose.h>
 #include <doc.hxx>
 #include <frame.hxx>
 #include <rootfrm.hxx>
diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx
index 62559485e76b..b93c30d8f8f4 100644
--- a/sw/source/core/fields/dbfld.cxx
+++ b/sw/source/core/fields/dbfld.cxx
@@ -29,11 +29,9 @@
 #include <IDocumentFieldsAccess.hxx>
 #include <docary.hxx>
 #include <fldbas.hxx>
-#include <ndtxt.hxx>
 #include <dbfld.hxx>
 #include <dbmgr.hxx>
 #include <unofldmid.h>
-#include <calbck.hxx>
 
 using namespace ::com::sun::star::sdbc;
 using namespace ::com::sun::star;
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index 9c4ba9c762cb..817545ad2a04 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -35,7 +35,6 @@
 #include <swbaslnk.hxx>
 #include <unofldmid.h>
 #include <hints.hxx>
-#include <calbck.hxx>
 
 using namespace ::com::sun::star;
 
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 0e486a2963e1..6384010b9bde 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -24,6 +24,7 @@
 #include <UndoTable.hxx>
 #include <hintids.hxx>
 #include <o3tl/any.hxx>
+#include <osl/diagnose.h>
 #include <unotools/collatorwrapper.hxx>
 #include <unotools/charclass.hxx>
 #include <editeng/langitem.hxx>
@@ -57,7 +58,6 @@
 #include <SwStyleNameMapper.hxx>
 #include <unofldmid.h>
 #include <numrule.hxx>
-#include <calbck.hxx>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::text;
diff --git a/sw/source/core/fields/fldlst.cxx b/sw/source/core/fields/fldlst.cxx
index aa937cb22140..39b5ec2c181c 100644
--- a/sw/source/core/fields/fldlst.cxx
+++ b/sw/source/core/fields/fldlst.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <calbck.hxx>
 #include <editsh.hxx>
 #include <doc.hxx>
 #include <IDocumentFieldsAccess.hxx>
diff --git a/sw/source/core/fields/tblcalc.cxx b/sw/source/core/fields/tblcalc.cxx
index c93d04a5c4bd..d9c78be88ede 100644
--- a/sw/source/core/fields/tblcalc.cxx
+++ b/sw/source/core/fields/tblcalc.cxx
@@ -22,7 +22,6 @@
 #include <o3tl/any.hxx>
 
 #include <calc.hxx>
-#include <calbck.hxx>
 #include <doc.hxx>
 #include <ndtxt.hxx>
 #include <fmtfld.hxx>
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index bad9f4a671cb..c3e7b0be030c 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -22,7 +22,6 @@
 
 #include <vcl/graph.hxx>
 #include <sot/formats.hxx>
-#include <sfx2/docfile.hxx>
 #include <svx/xfillit0.hxx>
 #include <svx/svdocapt.hxx>
 #include <svx/svdouno.hxx>
@@ -34,13 +33,13 @@
 #include <svx/unomodel.hxx>
 #include <svx/svditer.hxx>
 #include <svx/svdograf.hxx>
+#include <tools/stream.hxx>
 #include <unotools/streamwrap.hxx>
 #include <fmtanchr.hxx>
 #include <fmtcntnt.hxx>
 #include <fmtornt.hxx>
 #include <fmtflcnt.hxx>
 #include <frmfmt.hxx>
-#include <docary.hxx>
 #include <txtfrm.hxx>
 #include <txtflcnt.hxx>
 #include <fesh.hxx>
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 7afe6ee04afa..5ddbd7de1e31 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -35,7 +35,6 @@
 #include <fmtornt.hxx>
 #include <fmturl.hxx>
 #include <fmtfsize.hxx>
-#include <docary.hxx>
 #include <fesh.hxx>
 #include <rootfrm.hxx>
 #include <pagefrm.hxx>
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 11129ec7c225..067786a6c2a2 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -19,6 +19,7 @@
 
 #include <editeng/boxitem.hxx>
 #include <editeng/protitem.hxx>
+#include <osl/diagnose.h>
 
 #include <hintids.hxx>
 #include <fmtanchr.hxx>
@@ -29,7 +30,6 @@
 #include <doc.hxx>
 #include <IDocumentUndoRedo.hxx>
 #include <IDocumentLayoutAccess.hxx>
-#include <docary.hxx>
 #include <pam.hxx>
 #include <ndtxt.hxx>
 #include <swtable.hxx>
diff --git a/sw/source/core/graphic/grfatr.cxx b/sw/source/core/graphic/grfatr.cxx
index a8e2e63c7dcb..9c30a4bc9072 100644
--- a/sw/source/core/graphic/grfatr.cxx
+++ b/sw/source/core/graphic/grfatr.cxx
@@ -19,7 +19,7 @@
 
 #include <com/sun/star/drawing/ColorMode.hpp>
 #include <o3tl/any.hxx>
-#include <vcl/GraphicObject.hxx>
+#include <vcl/GraphicAttributes.hxx>
 #include <grfatr.hxx>
 #include <swunohelper.hxx>
 #include <osl/diagnose.h>
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index df244ccf1865..5446ba6eed00 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -42,7 +42,6 @@
 #include <hints.hxx>
 #include <swbaslnk.hxx>
 #include <pagefrm.hxx>
-#include <cntfrm.hxx>
 
 #include <rtl/ustring.hxx>
 #include <o3tl/deleter.hxx>
diff --git a/sw/source/core/inc/SwXMLBlockImport.hxx b/sw/source/core/inc/SwXMLBlockImport.hxx
index 178ab57b7b25..07a4dc69695c 100644
--- a/sw/source/core/inc/SwXMLBlockImport.hxx
+++ b/sw/source/core/inc/SwXMLBlockImport.hxx
@@ -24,7 +24,6 @@
 #include <xmloff/xmlnamespace.hxx>
 #include <com/sun/star/xml/sax/FastToken.hpp>
 #include <sax/fastattribs.hxx>
-#include <cppuhelper/implbase.hxx>
 
 namespace com::sun::star::xml::sax { class XFastTokenHandler; }
 
diff --git a/sw/source/core/inc/UndoBookmark.hxx b/sw/source/core/inc/UndoBookmark.hxx
index c10ed451c57d..f8fb3dd54dc9 100644
--- a/sw/source/core/inc/UndoBookmark.hxx
+++ b/sw/source/core/inc/UndoBookmark.hxx
@@ -22,6 +22,7 @@
 
 #include <memory>
 #include <undobj.hxx>
+#include "rolbck.hxx"
 
 class SwHistoryBookmark;
 class SwHistoryNoTextFieldmark;
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index d2dc6a15eaaa..ff1a3aba26de 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -20,7 +20,7 @@
 #ifndef INCLUDED_SW_SOURCE_CORE_INC_FRAME_HXX
 #define INCLUDED_SW_SOURCE_CORE_INC_FRAME_HXX
 
-#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
 #include <editeng/borderline.hxx>
 #include <svl/poolitem.hxx>
 #include <swtypes.hxx>
diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx
index a5ed0c4eb37e..4729ea85ebff 100644
--- a/sw/source/core/inc/layact.hxx
+++ b/sw/source/core/inc/layact.hxx
@@ -21,7 +21,6 @@
 
 #include <sal/config.h>
 
-#include <vcl/inputtypes.hxx>
 #include <vcl/TaskStopwatch.hxx>
 #include <tools/color.hxx>
 
diff --git a/sw/source/core/inc/pamtyp.hxx b/sw/source/core/inc/pamtyp.hxx
index b1bb6c1f4722..3e99dd8787cf 100644
--- a/sw/source/core/inc/pamtyp.hxx
+++ b/sw/source/core/inc/pamtyp.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_SW_SOURCE_CORE_INC_PAMTYP_HXX
 
 #include <unotools/textsearch.hxx>
-#include <swdllapi.h>
 
 #include <memory>
 
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 8755ee81235d..c73201436f0c 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -67,7 +67,6 @@
 #include <pagedesc.hxx>
 #include <grfatr.hxx>
 #include <ndnotxt.hxx>
-#include <docary.hxx>
 #include <node2lay.hxx>
 #include <fmtclbl.hxx>
 #include <swunohelper.hxx>
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index b5511d83682c..71a598c229bc 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -28,6 +28,7 @@
 #include <ndtxt.hxx>
 #include <editeng/ulspitem.hxx>
 #include <editeng/keepitem.hxx>
+#include <osl/diagnose.h>
 #include <svx/sdtaitm.hxx>
 
 #include <fmtfsize.hxx>
diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx
index 2040d4f9bf93..4b13576a7b0b 100644
--- a/sw/source/core/layout/colfrm.cxx
+++ b/sw/source/core/layout/colfrm.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <editeng/ulspitem.hxx>
+#include <osl/diagnose.h>
 #include <fmtclds.hxx>
 #include <fmtfordr.hxx>
 #include <frmfmt.hxx>
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index 29dd86b63a23..3696e2a02e0c 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -36,6 +36,7 @@
 #include <calbck.hxx>
 #include <viewopt.hxx>
 #include <ndtxt.hxx>
+#include <osl/diagnose.h>
 #include <sal/log.hxx>
 
 /// Searches the first ContentFrame in BodyText below the page.
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 9987d682dbfc..5dd10dee4eae 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -72,7 +72,6 @@
 #include <bodyfrm.hxx>
 #include <FrameControlsManager.hxx>
 #include <ndtxt.hxx>
-#include <officecfg/Office/Compatibility.hxx>
 
 using namespace ::com::sun::star;
 
diff --git a/sw/source/core/layout/flypos.cxx b/sw/source/core/layout/flypos.cxx
index b65eb966a468..0a7ab2dcae4a 100644
--- a/sw/source/core/layout/flypos.cxx
+++ b/sw/source/core/layout/flypos.cxx
@@ -19,7 +19,6 @@
 
 #include <doc.hxx>
 #include <IDocumentLayoutAccess.hxx>
-#include <docary.hxx>
 #include <fmtanchr.hxx>
 #include <ndindex.hxx>
 #include <frameformats.hxx>
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 51e97fb1c25c..d65d7c70d546 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -36,6 +36,7 @@
 #include <ndindex.hxx>
 #include <pam.hxx>
 #include <ndtxt.hxx>
+#include <osl/diagnose.h>
 #include <sal/log.hxx>
 #include <IDocumentSettingAccess.hxx>
 
diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index ec97ae693029..2ad55a8bb0ab 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -32,6 +32,7 @@
 #include <sortedobjs.hxx>
 #include <objectformatter.hxx>
 #include <ndindex.hxx>
+#include <osl/diagnose.h>
 #include <sal/log.hxx>
 
 static SwTwips lcl_GetFrameMinHeight(const SwLayoutFrame & rFrame)
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index ce33076182aa..afa012400d81 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -24,7 +24,6 @@
 #include <IDocumentStatistics.hxx>
 #include <IDocumentLayoutAccess.hxx>
 #include <docstat.hxx>
-#include <docary.hxx>
 #include <fmtpdsc.hxx>
 #include <laycache.hxx>
 #include "layhelp.hxx"
@@ -49,7 +48,6 @@
 #include <frameformats.hxx>
 
 #include <limits>
-#include <set>
 
 using namespace ::com::sun::star;
 
diff --git a/sw/source/core/layout/layouter.cxx b/sw/source/core/layout/layouter.cxx
index b3e8f83ca2a6..57f2ee0aeae1 100644
--- a/sw/source/core/layout/layouter.cxx
+++ b/sw/source/core/layout/layouter.cxx
@@ -28,6 +28,7 @@
 
 #include <movedfwdfrmsbyobjpos.hxx>
 #include "objstmpconsiderwrapinfl.hxx"
+#include <osl/diagnose.h>
 
 #define LOOP_DETECT 250
 
diff --git a/sw/source/core/layout/objectformatter.cxx b/sw/source/core/layout/objectformatter.cxx
index ca7d713273d4..184fcc820e33 100644
--- a/sw/source/core/layout/objectformatter.cxx
+++ b/sw/source/core/layout/objectformatter.cxx
@@ -27,6 +27,7 @@
 #include <txtfrm.hxx>
 #include <layact.hxx>
 #include <IDocumentSettingAccess.hxx>
+#include <osl/diagnose.h>
 
 #include <vector>
 
diff --git a/sw/source/core/layout/objectformatterlayfrm.cxx b/sw/source/core/layout/objectformatterlayfrm.cxx
index cc9f332167b4..a9b5201b3b50 100644
--- a/sw/source/core/layout/objectformatterlayfrm.cxx
+++ b/sw/source/core/layout/objectformatterlayfrm.cxx
@@ -23,6 +23,7 @@
 #include <pagefrm.hxx>
 
 #include <layact.hxx>
+#include <osl/diagnose.h>
 
 SwObjectFormatterLayFrame::SwObjectFormatterLayFrame( SwLayoutFrame& _rAnchorLayFrame,
                                                   const SwPageFrame& _rPageFrame,
diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx b/sw/source/core/layout/objectformattertxtfrm.cxx
index 85313839f889..5c4aa770b86e 100644
--- a/sw/source/core/layout/objectformattertxtfrm.cxx
+++ b/sw/source/core/layout/objectformattertxtfrm.cxx
@@ -33,8 +33,7 @@
 #include <ftnfrm.hxx>
 #include <fmtornt.hxx>
 #include <textboxhelper.hxx>
-#include <svx/svdobj.hxx>
-#include <svx/svdpage.hxx>
+#include <osl/diagnose.h>
 
 using namespace ::com::sun::star;
 
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index a40b9d18bdcc..f1e2c35f52f1 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -35,7 +35,6 @@
 #include <wrtsh.hxx>
 #include <view.hxx>
 #include <edtwin.hxx>
-#include <docary.hxx>
 #include <frameformats.hxx>
 
 #include <viewimp.hxx>
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index 0deff1919ce3..2f7c9e0047bd 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -24,6 +24,7 @@
 #include <editeng/boxitem.hxx>
 #include <editeng/shaditem.hxx>
 #include <editeng/frmdiritem.hxx>
+#include <osl/diagnose.h>
 #include <sal/log.hxx>
 #include <fmtclds.hxx>
 #include <fmtfsize.hxx>
@@ -39,7 +40,6 @@
 #include <IDocumentStylePoolAccess.hxx>
 #include <poolfmt.hxx>
 #include <calbck.hxx>
-#include <hints.hxx>
 
 SwPageDesc::SwPageDesc(const OUString& rName, SwFrameFormat *pFormat, SwDoc *const pDoc)
     : sw::BroadcastingModify()
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 43c655e5c856..201b63be1fcd 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -89,7 +89,6 @@
 #include <bitmaps.hlst>
 #include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
 #include <drawinglayer/primitive2d/PolyPolygonStrokePrimitive2D.hxx>
-#include <drawinglayer/primitive2d/borderlineprimitive2d.hxx>
 #include <drawinglayer/primitive2d/discreteshadowprimitive2d.hxx>
 #include <drawinglayer/primitive2d/maskprimitive2d.hxx>
 #include <drawinglayer/primitive2d/textprimitive2d.hxx>
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index e293be36a2ed..aa2af7d515f7 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -21,6 +21,7 @@
 #include <sal/log.hxx>
 
 #include <o3tl/safeint.hxx>
+#include <osl/diagnose.h>
 #include <svl/itemiter.hxx>
 #include <txtftn.hxx>
 #include <fmtftn.hxx>
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 953e2a9be87b..ed54f255c052 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -58,7 +58,6 @@
 #include <layouter.hxx>
 #include <calbck.hxx>
 #include <DocumentSettingManager.hxx>
-#include <docary.hxx>
 #include <sal/log.hxx>
 #include <frmatr.hxx>
 #include <frmtool.hxx>
diff --git a/sw/source/core/layout/unusedf.cxx b/sw/source/core/layout/unusedf.cxx
index fea1c055167b..e8322c896b12 100644
--- a/sw/source/core/layout/unusedf.cxx
+++ b/sw/source/core/layout/unusedf.cxx
@@ -20,6 +20,7 @@
 #include <rootfrm.hxx>
 #include <cntfrm.hxx>
 #include <flyfrm.hxx>
+#include <osl/diagnose.h>
 
 void SwFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderAttrs * )
 {
diff --git a/sw/source/core/layout/virtoutp.cxx b/sw/source/core/layout/virtoutp.cxx
index ad0fa58eb0a5..dd044317dbd0 100644
--- a/sw/source/core/layout/virtoutp.cxx
+++ b/sw/source/core/layout/virtoutp.cxx
@@ -20,6 +20,7 @@
 #include "virtoutp.hxx"
 #include <viewopt.hxx>
 #include <rootfrm.hxx>
+#include <osl/diagnose.h>
 
 /* The SWLayVout class manages the virtual output devices.
  * RootFrame has a static member of this class which is created in FrameInit
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index e7efffdec412..472c0bf619e8 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <hints.hxx>
+#include <osl/diagnose.h>
 #include <o3tl/safeint.hxx>
 #include <svl/itemiter.hxx>
 #include <editeng/brushitem.hxx>
diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
index a5180ac06536..ae6c338fd716 100644
--- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
@@ -30,7 +30,6 @@
 #include <dcontact.hxx>
 #include <frmfmt.hxx>
 #include <fmtornt.hxx>
-#include <fmtfsize.hxx>
 #include <fmtfollowtextflow.hxx>
 #include <editeng/lrspitem.hxx>
 #include <editeng/ulspitem.hxx>
@@ -38,7 +37,6 @@
 #include <IDocumentSettingAccess.hxx>
 #include <textboxhelper.hxx>
 #include <fmtsrnd.hxx>
-#include <svx/sdtagitm.hxx>
 
 using namespace ::com::sun::star;
 using namespace objectpositioning;
diff --git a/sw/source/core/objectpositioning/environmentofanchoredobject.cxx b/sw/source/core/objectpositioning/environmentofanchoredobject.cxx
index b8fb4f02a7fd..8d197f464f02 100644
--- a/sw/source/core/objectpositioning/environmentofanchoredobject.cxx
+++ b/sw/source/core/objectpositioning/environmentofanchoredobject.cxx
@@ -20,6 +20,7 @@
 #include <environmentofanchoredobject.hxx>
 #include <frame.hxx>
 #include <pagefrm.hxx>
+#include <osl/diagnose.h>
 
 using namespace objectpositioning;
 
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 74ceed65d2e0..d52cbd09722f 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -55,6 +55,7 @@
 #include <deque>
 #include <libxml/xmlwriter.h>
 #include <sfx2/xmldump.hxx>
+#include <osl/diagnose.h>
 
 using namespace utl;
 using namespace com::sun::star::uno;
diff --git a/sw/source/core/swg/SwXMLSectionList.cxx b/sw/source/core/swg/SwXMLSectionList.cxx
index 4fe4c1b0c710..77e1fcbd6e86 100644
--- a/sw/source/core/swg/SwXMLSectionList.cxx
+++ b/sw/source/core/swg/SwXMLSectionList.cxx
@@ -19,7 +19,6 @@
 
 #include <SwXMLSectionList.hxx>
 #include <xmloff/xmlictxt.hxx>
-#include <xmloff/namespacemap.hxx>
 #include <xmloff/xmlnamespace.hxx>
 #include <vector>
 
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index 84d7185c3ec2..85592b9a7458 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -31,13 +31,9 @@
 #include <fmtfsize.hxx>
 #include <doc.hxx>
 #include <IDocumentUndoRedo.hxx>
-#include <IDocumentChartDataProviderAccess.hxx>
 #include <IDocumentContentOperations.hxx>
 #include <IDocumentFieldsAccess.hxx>
 #include <IDocumentLayoutAccess.hxx>
-#include <IDocumentMarkAccess.hxx>
-#include <IDocumentRedlineAccess.hxx>
-#include <ftnidx.hxx>
 #include <cstdlib>
 #include <vector>
 #include <set>
@@ -48,6 +44,7 @@
 #include <swtblfmt.hxx>
 #include <calbck.hxx>
 #include <sal/log.hxx>
+#include <osl/diagnose.h>
 
 #ifdef DBG_UTIL
 #define CHECK_TABLE(t) (t).CheckConsistency();
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 97e999b1e21f..8864701cb59b 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -23,6 +23,7 @@
 #include <editeng/shaditem.hxx>
 #include <editeng/adjustitem.hxx>
 #include <editeng/colritem.hxx>
+#include <osl/diagnose.h>
 #include <sfx2/linkmgr.hxx>
 #include <fmtfsize.hxx>
 #include <fmtornt.hxx>
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 6e8f19a98e72..0360bc35667c 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -54,7 +54,6 @@
 #include <reffld.hxx>
 #include <doc.hxx>
 #include <IDocumentOutlineNodes.hxx>
-#include <docary.hxx>
 #include <mdiexp.hxx>
 #include <docufld.hxx>
 #include <ftnidx.hxx>
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index b1dc40bf4879..e30d03816da5 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -36,7 +36,6 @@
 #include <editeng/wghtitem.hxx>
 #include <editeng/wrlmitem.hxx>
 #include <editeng/autokernitem.hxx>
-#include <editeng/blinkitem.hxx>
 #include <editeng/charrotateitem.hxx>
 #include <editeng/emphasismarkitem.hxx>
 #include <editeng/charscaleitem.hxx>
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 731ecdc324bf..aee8bcae2985 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -20,6 +20,7 @@
 #include <sal/config.h>
 #include <sal/log.hxx>
 
+#include <IDocumentRedlineAccess.hxx>
 #include <anchoredobject.hxx>
 #include <bodyfrm.hxx>
 #include <hintids.hxx>
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index 0127b8a04083..706d265ab43e 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -46,6 +46,7 @@
 
 #include <EnhancedPDFExportHelper.hxx>
 
+#include <IDocumentRedlineAccess.hxx>
 #include <IDocumentStylePoolAccess.hxx>
 
 #define REDLINE_DISTANCE 567/4
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index e006148e79b7..d9f745a2de71 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -31,7 +31,6 @@
 #include <txtfrm.hxx>
 #include <ndtxt.hxx>
 #include <editeng/paravertalignitem.hxx>
-#include <sal/log.hxx>
 
 namespace com::sun::star::linguistic2 { class XHyphenatedWord; }
 
diff --git a/sw/source/core/text/pordrop.hxx b/sw/source/core/text/pordrop.hxx
index c8948197fe45..5e01906cdd55 100644
--- a/sw/source/core/text/pordrop.hxx
+++ b/sw/source/core/text/pordrop.hxx
@@ -20,6 +20,9 @@
 #define INCLUDED_SW_SOURCE_CORE_TEXT_PORDROP_HXX
 
 #include "portxt.hxx"
+#include <swfont.hxx>
+
+#include <memory>
 
 class SwFont;
 
diff --git a/sw/source/core/text/redlnitr.hxx b/sw/source/core/text/redlnitr.hxx
index 1623a31aacc2..84c3dd0d7980 100644
--- a/sw/source/core/text/redlnitr.hxx
+++ b/sw/source/core/text/redlnitr.hxx
@@ -19,8 +19,7 @@
 #ifndef INCLUDED_SW_SOURCE_CORE_TEXT_REDLNITR_HXX
 #define INCLUDED_SW_SOURCE_CORE_TEXT_REDLNITR_HXX
 
-#include <IDocumentRedlineAccess.hxx>
-
+#include <docary.hxx>
 #include <swfont.hxx>
 
 #include <vcl/commandevent.hxx>
diff --git a/sw/source/core/tox/ToxTextGenerator.cxx b/sw/source/core/tox/ToxTextGenerator.cxx
index 0cd6babd20b1..ba76ecdaaa62 100644
--- a/sw/source/core/tox/ToxTextGenerator.cxx
+++ b/sw/source/core/tox/ToxTextGenerator.cxx
@@ -39,6 +39,7 @@
 #include <txatbase.hxx>
 #include <modeltoviewhelper.hxx>
 
+#include <osl/diagnose.h>
 #include <rtl/ustrbuf.hxx>
 #include <svl/itemiter.hxx>
 
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index d69e57ba2c3b..962c6edf3044 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <unotools/charclass.hxx>
+#include <osl/diagnose.h>
 #include <txtfld.hxx>
 #include <doc.hxx>
 #include <IDocumentLayoutAccess.hxx>
diff --git a/sw/source/core/txtnode/SwGrammarContact.cxx b/sw/source/core/txtnode/SwGrammarContact.cxx
index ad1e510e6d2a..7b061bdaf9ba 100644
--- a/sw/source/core/txtnode/SwGrammarContact.cxx
+++ b/sw/source/core/txtnode/SwGrammarContact.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <vcl/timer.hxx>
-#include <hints.hxx>
 #include <IGrammarContact.hxx>
 #include <pam.hxx>
 #include <ndtxt.hxx>
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index 2274eb5e960b..7f7e6e1dba4c 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -40,6 +40,7 @@
 #include <rtl/ustrbuf.hxx>
 #include <vcl/svapp.hxx>
 #include <unotextrange.hxx>
+#include <osl/diagnose.h>
 
 namespace {
     /// Get a sorted list of the used footnote reference numbers.
diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx
index add813112a29..16fb03cfb941 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -31,7 +31,6 @@
 #include <txtatr.hxx>
 #include <fmtruby.hxx>
 #include <charfmt.hxx>
-#include <hints.hxx>
 #include <unoevent.hxx>
 #include <com/sun/star/text/RubyAdjust.hpp>
 #include <com/sun/star/text/RubyPosition.hpp>
diff --git a/sw/source/core/txtnode/ndhints.cxx b/sw/source/core/txtnode/ndhints.cxx
index e7f34081c8ec..cd136f21a9c5 100644
--- a/sw/source/core/txtnode/ndhints.cxx
+++ b/sw/source/core/txtnode/ndhints.cxx
@@ -26,7 +26,6 @@
 #ifdef DBG_UTIL
 #include <pam.hxx>
 #include <fmtautofmt.hxx>
-#include <set>
 #endif
 
 /// sort order: Start, End (reverse), Which (reverse),
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 6b00cf30e9cd..8ebdc1322a68 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -42,7 +42,6 @@
 #include <ftnidx.hxx>
 #include <ftninfo.hxx>
 #include <fmtftn.hxx>
-#include <fmtmeta.hxx>
 #include <charfmt.hxx>
 #include <ndtxt.hxx>
 #include <doc.hxx>
diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index 1bc5a3f6ba3b..2a2801c0517e 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -23,7 +23,6 @@
 #include <vcl/outdev.hxx>
 #include <editeng/brushitem.hxx>
 #include <editeng/wrlmitem.hxx>
-#include <editeng/blinkitem.hxx>
 #include <editeng/kernitem.hxx>
 #include <editeng/cmapitem.hxx>
 #include <editeng/langitem.hxx>
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index af1f220fa448..a5626e71f053 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -22,8 +22,8 @@
 
 #include <DocumentContentOperationsManager.hxx>
 #include <hintids.hxx>
-#include <editeng/xmlcnitm.hxx>
 #include <editeng/rsiditem.hxx>
+#include <osl/diagnose.h>
 #include <svl/whiter.hxx>
 #include <svl/itemiter.hxx>
 #include <editeng/charhiddenitem.hxx>
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index ba47a0021b73..67aae7f85650 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -28,6 +28,7 @@
 #include <i18nutil/transliteration.hxx>
 #include <SwSmartTagMgr.hxx>
 #include <o3tl/safeint.hxx>
+#include <osl/diagnose.h>
 #include <officecfg/Office/Writer.hxx>
 #include <unotools/transliterationwrapper.hxx>
 #include <unotools/charclass.hxx>
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index df3b1caba424..b8570b17c533 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -22,6 +22,7 @@
 #include <libxml/xmlwriter.h>
 
 #include <hintids.hxx>
+#include <osl/diagnose.h>
 #include <rtl/ustrbuf.hxx>
 #include <unotools/charclass.hxx>
 #include <frmfmt.hxx>
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index fb779e53d4f9..83e49c114ae0 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -32,7 +32,6 @@
 #include <rolbck.hxx>
 #include <doc.hxx>
 #include <IDocumentLayoutAccess.hxx>
-#include <docary.hxx>
 #include <rootfrm.hxx>
 #include <swundo.hxx>
 #include <pam.hxx>
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx
index 1a2ad32bb0e8..060cc08e6559 100644
--- a/sw/source/core/undo/undraw.cxx
+++ b/sw/source/core/undo/undraw.cxx
@@ -26,7 +26,6 @@
 #include <svx/svdview.hxx>
 
 #include <hintids.hxx>
-#include <hints.hxx>
 #include <fmtanchr.hxx>
 #include <fmtflcnt.hxx>
 #include <txtflcnt.hxx>
@@ -34,7 +33,6 @@
 #include <doc.hxx>
 #include <IDocumentUndoRedo.hxx>
 #include <IDocumentLayoutAccess.hxx>
-#include <docary.hxx>
 #include <swundo.hxx>
 #include <pam.hxx>
 #include <ndtxt.hxx>
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index dcd3c4c689f0..06a56636d7a8 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -21,7 +21,6 @@
 
 #include <hintids.hxx>
 #include <unotools/charclass.hxx>
-#include <sot/storage.hxx>
 #include <editeng/keepitem.hxx>
 #include <svx/svdobj.hxx>
 
diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx
index 564eb781f3ed..c592c0bbb1f4 100644
--- a/sw/source/core/undo/unredln.cxx
+++ b/sw/source/core/undo/unredln.cxx
@@ -19,6 +19,7 @@
 
 #include <UndoRedline.hxx>
 #include <hintids.hxx>
+#include <osl/diagnose.h>
 #include <unotools/charclass.hxx>
 #include <doc.hxx>
 #include <IDocumentRedlineAccess.hxx>
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index fa423875dbb2..7aca78714e65 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -32,7 +32,6 @@
 #include <IDocumentStylePoolAccess.hxx>
 #include <IDocumentLayoutAccess.hxx>
 #include <IDocumentState.hxx>
-#include <hints.hxx>
 #include <fmtfld.hxx>
 #include <txtfld.hxx>
 #include <ndtxt.hxx>
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index a73b8e74fa95..c853a6653d3b 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -27,7 +27,6 @@
 #include <com/sun/star/frame/XTitle.hpp>
 #include <com/sun/star/frame/XModel.hpp>
 #include <o3tl/any.hxx>
-#include <svx/svxids.hrc>
 #include <svx/xfillit0.hxx>
 #include <svx/xflgrit.hxx>
 #include <svx/sdtaitm.hxx>
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index bb0782e07cfc..459a2b4e7b6e 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -38,7 +38,6 @@
 #include <vcl/svapp.hxx>
 #include <i18nlangtag/languagetag.hxx>
 #include <editeng/memberids.h>
-#include <hints.hxx>
 #include <swtypes.hxx>
 #include <shellres.hxx>
 #include <viewsh.hxx>
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 0ae02dedefed..abcb313351d0 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -54,7 +54,6 @@
 #include <unomid.h>
 #include <cmdid.h>
 #include <unofldmid.h>
-#include <editeng/colritem.hxx>
 #include <editeng/memberids.h>
 #include <editeng/unoprnms.hxx>
 #include <svl/itemprop.hxx>
diff --git a/sw/source/core/unocore/unomap1.cxx b/sw/source/core/unocore/unomap1.cxx
index 11508d462912..f9474dc92e27 100644
--- a/sw/source/core/unocore/unomap1.cxx
+++ b/sw/source/core/unocore/unomap1.cxx
@@ -19,7 +19,6 @@
 
 #include <hintids.hxx>
 
-#include <svx/svxids.hrc>
 #include <svx/unomid.hxx>
 #include <com/sun/star/awt/FontSlant.hpp>
 #include <com/sun/star/awt/Gradient.hpp>
@@ -74,7 +73,6 @@
 #include <unoprnms.hxx>
 #include <unomid.h>
 #include <cmdid.h>
-#include <editeng/colritem.hxx>
 #include <editeng/memberids.h>
 #include <editeng/unoprnms.hxx>
 #include <svl/itemprop.hxx>
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 63dc5a50d392..f88ee9b84a9f 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -41,7 +41,6 @@
 #include <swundo.hxx>
 #include <rootfrm.hxx>
 #include <ftnidx.hxx>
-#include <docary.hxx>
 #include <pam.hxx>
 #include <swtblfmt.hxx>
 #include <docsh.hxx>
diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx
index 4a25cd38cd61..7095280585f1 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -37,6 +37,7 @@
 #include <unoport.hxx>
 #include <unoredline.hxx>
 #include <doc.hxx>
+#include <IDocumentRedlineAccess.hxx>
 #include <IDocumentStylePoolAccess.hxx>
 #include <docary.hxx>
 
diff --git a/sw/source/core/unocore/unoredlines.cxx b/sw/source/core/unocore/unoredlines.cxx
index bbab06ed6a13..637e16b52c6b 100644
--- a/sw/source/core/unocore/unoredlines.cxx
+++ b/sw/source/core/unocore/unoredlines.cxx
@@ -30,6 +30,7 @@
 #include <pagedesc.hxx>
 #include <poolfmt.hxx>
 #include <doc.hxx>
+#include <IDocumentRedlineAccess.hxx>
 #include <IDocumentStylePoolAccess.hxx>
 #include <docary.hxx>
 #include <redline.hxx>
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index a0c158cc2897..132a4dde5aec 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -47,6 +47,7 @@
 #include <unomap.hxx>
 #include <section.hxx>
 #include <doc.hxx>
+#include <IDocumentRedlineAccess.hxx>
 #include <IDocumentUndoRedo.hxx>
 #include <docsh.hxx>
 #include <sfx2/docfile.hxx>
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 2f1d9d6f7e3d..1235417db455 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -20,7 +20,6 @@
 #include <sal/config.h>
 
 #include <o3tl/safeint.hxx>
-#include <svx/svxids.hrc>
 #include <hintids.hxx>
 #include <vcl/svapp.hxx>
 #include <svl/hint.hxx>
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index c28a6a38f325..527b56099cb0 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -23,9 +23,9 @@
 #include <vector>
 #include <algorithm>
 
+#include <cppuhelper/interfacecontainer.hxx>
 #include <o3tl/any.hxx>
 #include <o3tl/safeint.hxx>
-#include <svx/svxids.hrc>
 #include <editeng/memberids.h>
 #include <float.h>
 #include <swtypes.hxx>
@@ -42,12 +42,12 @@
 #include <IDocumentUndoRedo.hxx>
 #include <IDocumentContentOperations.hxx>
 #include <IDocumentFieldsAccess.hxx>
+#include <IDocumentRedlineAccess.hxx>
 #include <IDocumentState.hxx>
 #include <IDocumentLayoutAccess.hxx>
 #include <shellres.hxx>
 #include <docary.hxx>
 #include <ndole.hxx>
-#include <ndtxt.hxx>
 #include <frame.hxx>
 #include <vcl/svapp.hxx>
 #include <fmtfsize.hxx>
@@ -105,7 +105,6 @@
 #include <docsh.hxx>
 #include <fesh.hxx>
 #include <itabenum.hxx>
-#include <poolfmt.hxx>
 #include <frameformats.hxx>
 
 using namespace ::com::sun::star;
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 590141a5693e..4c0f0afda5f6 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -59,6 +59,7 @@
 #include <unocrsrhelper.hxx>
 #include <docary.hxx>
 #include <doc.hxx>
+#include <IDocumentRedlineAccess.hxx>
 #include <IDocumentUndoRedo.hxx>
 #include <redline.hxx>
 #include <swundo.hxx>
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index 57fda67e4e2c..c7d22e89e787 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -21,6 +21,7 @@
 #include <prevwpage.hxx>
 
 #include <algorithm>
+#include <osl/diagnose.h>
 #include <tools/fract.hxx>
 #include <vcl/window.hxx>
 #include <vcl/settings.hxx>
diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx
index 98df16715059..2c4d195ba3eb 100644
--- a/sw/source/core/view/viewpg.cxx
+++ b/sw/source/core/view/viewpg.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <tools/fract.hxx>
+#include <osl/diagnose.h>
 #include <viewsh.hxx>
 #include <pagefrm.hxx>
 #include <viewimp.hxx>
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 1cc7288a6200..acfd1dac62af 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -72,7 +72,6 @@
 #include <vcl/virdev.hxx>
 #include <vcl/svapp.hxx>
 #include <svx/sdrpaintwindow.hxx>
-#include <svx/sdr/overlay/overlaymanager.hxx>
 #include <svx/sdrpagewindow.hxx>
 #include <svx/svdpagv.hxx>
 #include <comphelper/lok.hxx>
diff --git a/sw/source/filter/ascii/wrtasc.cxx b/sw/source/filter/ascii/wrtasc.cxx
index 3c618ecb5b52..2d530e7531b5 100644
--- a/sw/source/filter/ascii/wrtasc.cxx
+++ b/sw/source/filter/ascii/wrtasc.cxx
@@ -23,7 +23,6 @@
 #include <doc.hxx>
 #include <ndtxt.hxx>
 #include <mdiexp.hxx>
-#include <docary.hxx>
 #include <fmtcntnt.hxx>
 #include <frmfmt.hxx>
 #include "wrtasc.hxx"
diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx
index a36bc9ae0603..7bdddbd40862 100644
--- a/sw/source/filter/basflt/fltini.cxx
+++ b/sw/source/filter/basflt/fltini.cxx
@@ -23,8 +23,6 @@
 #include <o3tl/any.hxx>
 #include <tools/svlibrary.h>
 #include <sot/storage.hxx>
-#include <doc.hxx>
-#include <docary.hxx>
 #include <shellio.hxx>
 #include <fltini.hxx>
 #include <init.hxx>
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index 1fe51c4afbd5..5a6aefa85191 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -20,7 +20,6 @@
 #include <memory>
 #include <sal/config.h>
 #include <sal/log.hxx>
-#include <o3tl/safeint.hxx>
 #include <osl/diagnose.h>
 
 #include <cstddef>
diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx
index 960497b8d27f..2f49b2b199d1 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -29,7 +29,6 @@
 #include <com/sun/star/ucb/ContentCreationException.hpp>
 #include <com/sun/star/embed/XStorage.hpp>
 #include <unicode/ucsdet.h>
-#include <unicode/uclean.h>
 
 using namespace ::com::sun::star;
 
diff --git a/sw/source/filter/html/css1atr.hxx b/sw/source/filter/html/css1atr.hxx
index c5e394e18f89..42b925587ff1 100644
--- a/sw/source/filter/html/css1atr.hxx
+++ b/sw/source/filter/html/css1atr.hxx
@@ -20,6 +20,8 @@
 #ifndef INCLUDED_SW_SOURCE_FILTER_HTML_CSS1ATR_HXX
 #define INCLUDED_SW_SOURCE_FILTER_HTML_CSS1ATR_HXX
 
+class SfxPoolItem;
+
 bool swhtml_css1atr_equalFontItems(const SfxPoolItem& r1, const SfxPoolItem& r2);
 
 #endif
diff --git a/sw/source/filter/html/css1kywd.hxx b/sw/source/filter/html/css1kywd.hxx
index 47be061d9de6..443af7e1ae91 100644
--- a/sw/source/filter/html/css1kywd.hxx
+++ b/sw/source/filter/html/css1kywd.hxx
@@ -20,8 +20,6 @@
 #ifndef INCLUDED_SW_SOURCE_FILTER_HTML_CSS1KYWD_HXX
 #define INCLUDED_SW_SOURCE_FILTER_HTML_CSS1KYWD_HXX
 
-#include <sal/types.h>
-
 extern const char* const sCSS_mimetype;
 
 extern const char* const sCSS1_page;
diff --git a/sw/source/filter/html/htmldrawwriter.cxx b/sw/source/filter/html/htmldrawwriter.cxx
index a1b6f6aa094b..d9ff363bda18 100644
--- a/sw/source/filter/html/htmldrawwriter.cxx
+++ b/sw/source/filter/html/htmldrawwriter.cxx
@@ -28,7 +28,6 @@
 #include <editeng/outliner.hxx>
 #include <svx/xfillit0.hxx>
 #include <svx/xflclit.hxx>
-#include <editeng/colritem.hxx>
 #include <svl/whiter.hxx>
 #include <svtools/htmlout.hxx>
 #include <svtools/htmlkywd.hxx>
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index 1072edeceab4..2e99b3d770b2 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -48,7 +48,6 @@
 #include <editeng/crossedoutitem.hxx>
 #include <docsh.hxx>
 #include <fmtanchr.hxx>
-#include <docary.hxx>
 #include <viewsh.hxx>
 #include <pam.hxx>
 #include <doc.hxx>
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index 8962bc63e3ee..7b0c49cc3f3a 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -51,7 +51,6 @@
 #include <charatr.hxx>
 #include <frmfmt.hxx>
 #include <charfmt.hxx>
-#include <docary.hxx>
 #include <docsh.hxx>
 #include <pam.hxx>
 #include <doc.hxx>
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 4326e66cc029..c3c95cf7f788 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -33,7 +33,6 @@
 #include <svtools/htmltokn.h>
 #include <svtools/htmlkywd.hxx>
 #include <svl/urihelper.hxx>
-#include <svl/listener.hxx>
 #include <sal/log.hxx>
 
 #include <dcontact.hxx>
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index c16bcd406089..5dd73ace4179 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -81,7 +81,6 @@
 #include <fmtinfmt.hxx>
 #include <fmtfollowtextflow.hxx>
 #include <fmtornt.hxx>
-#include <docary.hxx>
 #include <doc.hxx>
 #include <IDocumentUndoRedo.hxx>
 #include <IDocumentSettingAccess.hxx>
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index 7fc910600d75..0f4809e23558 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -29,8 +29,10 @@
 #include <rtl/ref.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <fltshell.hxx>
+#include <swtypes.hxx>
 #include <com/sun/star/drawing/XShape.hpp>
 #include <com/sun/star/form/XFormComponent.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
 
 #include <memory>
 #include <vector>
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
index 959bf5980796..e6e74e111e0d 100644
--- a/sw/source/filter/inc/fltshell.hxx
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -21,15 +21,14 @@
 
 #include <hintids.hxx>
 #include <svl/listener.hxx>
+#include <svx/ctredlin.hxx>
 #include <tools/datetime.hxx>
 #include <mdiexp.hxx>
 #include <ndindex.hxx>
 #include <pam.hxx>
 #include <strings.hrc>
-#include <IDocumentRedlineAccess.hxx>
 
 #include <cstddef>
-#include <limits>
 #include <memory>
 
 class SwTOXBase;
diff --git a/sw/source/filter/inc/wrtswtbl.hxx b/sw/source/filter/inc/wrtswtbl.hxx
index 33cfe6782fba..98b74fa3d29f 100644
--- a/sw/source/filter/inc/wrtswtbl.hxx
+++ b/sw/source/filter/inc/wrtswtbl.hxx
@@ -20,6 +20,7 @@

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list