summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--salhelper/source/timer.cxx1
-rw-r--r--sax/source/fastparser/fastparser.cxx1
-rw-r--r--sc/IwyuFilter_sc.yaml41
-rw-r--r--sc/inc/ChartTools.hxx3
-rw-r--r--sc/inc/ViewSettingsSequenceDefines.hxx2
-rw-r--r--sc/inc/afmtuno.hxx1
-rw-r--r--sc/inc/bigrange.hxx1
-rw-r--r--sc/inc/bulkdatahint.hxx1
-rw-r--r--sc/inc/cellsuno.hxx1
-rw-r--r--sc/inc/chartuno.hxx1
-rw-r--r--sc/inc/columniterator.hxx2
-rw-r--r--sc/inc/conditio.hxx1
-rw-r--r--sc/inc/detdata.hxx1
-rw-r--r--sc/inc/document.hxx1
-rw-r--r--sc/inc/documentlinkmgr.hxx2
-rw-r--r--sc/inc/fielduno.hxx1
-rw-r--r--sc/inc/helpids.h2
-rw-r--r--sc/inc/math.hxx2
-rw-r--r--sc/inc/matrixoperators.hxx2
-rw-r--r--sc/inc/mtvfunctions.hxx2
-rw-r--r--sc/inc/patattr.hxx1
-rw-r--r--sc/inc/postit.hxx1
-rw-r--r--sc/inc/pvfundlg.hrc2
-rw-r--r--sc/inc/queryparam.hxx1
-rw-r--r--sc/inc/refreshtimer.hxx1
-rw-r--r--sc/inc/scabstdlg.hxx1
-rw-r--r--sc/inc/scfuncs.hrc2
-rw-r--r--sc/inc/scmod.hxx1
-rw-r--r--sc/inc/scstyles.hrc1
-rw-r--r--sc/inc/strings.hxx2
-rw-r--r--sc/inc/subtotals.hrc2
-rw-r--r--sc/inc/units.hrc2
-rw-r--r--sc/inc/unonames.hxx2
-rw-r--r--sc/inc/viewuno.hxx1
-rw-r--r--sc/qa/extras/htmlexporttest.cxx1
-rw-r--r--sc/qa/extras/macros-test.cxx5
-rw-r--r--sc/qa/extras/scchartsobj.cxx1
-rw-r--r--sc/qa/extras/scindexenumeration_scenariosenumeration.cxx1
-rw-r--r--sc/qa/extras/scindexenumeration_subtotalfieldsenumeration.cxx1
-rw-r--r--sc/qa/extras/scindexenumeration_tablechartsenumeration.cxx1
-rw-r--r--sc/qa/unit/scshapetest.cxx2
-rw-r--r--sc/qa/unit/subsequent_export_test.cxx4
-rw-r--r--sc/qa/unit/subsequent_export_test2.cxx9
-rw-r--r--sc/qa/unit/subsequent_filters_test.cxx9
-rw-r--r--sc/qa/unit/subsequent_filters_test2.cxx12
-rw-r--r--sc/qa/unit/ucalc.cxx4
-rw-r--r--sc/qa/unit/ucalc_condformat.cxx3
-rw-r--r--sc/qa/unit/ucalc_copypaste.cxx5
-rw-r--r--sc/qa/unit/ucalc_formula.cxx8
-rw-r--r--sc/qa/unit/ucalc_sharedformula.cxx4
-rw-r--r--sc/qa/unit/ucalc_sort.cxx1
-rw-r--r--sc/qa/unit/uicalc/uicalc.cxx2
-rw-r--r--sc/source/core/data/colorscale.cxx1
-rw-r--r--sc/source/core/data/column3.cxx1
-rw-r--r--sc/source/core/data/conditio.cxx1
-rw-r--r--sc/source/core/data/docpool.cxx2
-rw-r--r--sc/source/core/data/documen8.cxx1
-rw-r--r--sc/source/core/data/dpdimsave.cxx1
-rw-r--r--sc/source/core/data/dpobject.cxx1
-rw-r--r--sc/source/core/data/drwlayer.cxx1
-rw-r--r--sc/source/core/data/formulacell.cxx1
-rw-r--r--sc/source/core/data/global.cxx1
-rw-r--r--sc/source/core/data/markdata.cxx1
-rw-r--r--sc/source/core/data/patattr.cxx1
-rw-r--r--sc/source/core/data/table2.cxx1
-rw-r--r--sc/source/core/data/table3.cxx3
-rw-r--r--sc/source/core/data/validat.cxx1
-rw-r--r--sc/source/core/inc/interpre.hxx1
-rw-r--r--sc/source/core/tool/arraysumSSE2.cxx1
-rw-r--r--sc/source/core/tool/cellform.cxx1
-rw-r--r--sc/source/core/tool/chgtrack.cxx1
-rw-r--r--sc/source/core/tool/compiler.cxx1
-rw-r--r--sc/source/core/tool/ddelink.cxx1
-rw-r--r--sc/source/core/tool/detdata.cxx1
-rw-r--r--sc/source/core/tool/docoptio.cxx2
-rw-r--r--sc/source/core/tool/inputopt.cxx1
-rw-r--r--sc/source/core/tool/interpr3.cxx2
-rw-r--r--sc/source/core/tool/math.cxx1
-rw-r--r--sc/source/core/tool/numformat.cxx1
-rw-r--r--sc/source/core/tool/printopt.cxx1
-rw-r--r--sc/source/core/tool/queryparam.cxx1
-rw-r--r--sc/source/core/tool/rangeseq.cxx1
-rw-r--r--sc/source/core/tool/scmatrix.cxx2
-rw-r--r--sc/source/filter/dif/difimp.cxx1
-rw-r--r--sc/source/filter/excel/excrecds.cxx1
-rw-r--r--sc/source/filter/excel/fontbuff.cxx2
-rw-r--r--sc/source/filter/excel/impop.cxx1
-rw-r--r--sc/source/filter/excel/xechart.cxx1
-rw-r--r--sc/source/filter/excel/xeescher.cxx2
-rw-r--r--sc/source/filter/excel/xeformula.cxx1
-rw-r--r--sc/source/filter/excel/xeroot.cxx2
-rw-r--r--sc/source/filter/excel/xestream.cxx5
-rw-r--r--sc/source/filter/excel/xlpage.cxx2
-rw-r--r--sc/source/filter/excel/xltools.cxx1
-rw-r--r--sc/source/filter/html/htmlpars.cxx1
-rw-r--r--sc/source/filter/inc/excdefs.hxx1
-rw-r--r--sc/source/filter/inc/sheetdatabuffer.hxx1
-rw-r--r--sc/source/filter/inc/xlcontent.hxx1
-rw-r--r--sc/source/filter/inc/xlstring.hxx1
-rw-r--r--sc/source/filter/oox/autofilterbuffer.cxx2
-rw-r--r--sc/source/filter/oox/biffhelper.cxx1
-rw-r--r--sc/source/filter/oox/drawingfragment.cxx3
-rw-r--r--sc/source/filter/oox/externallinkbuffer.cxx2
-rw-r--r--sc/source/filter/oox/pagesettings.cxx1
-rw-r--r--sc/source/filter/oox/stylesbuffer.cxx2
-rw-r--r--sc/source/filter/oox/worksheethelper.cxx1
-rw-r--r--sc/source/filter/qpro/qprostyle.cxx1
-rw-r--r--sc/source/filter/rtf/eeimpars.cxx1
-rw-r--r--sc/source/filter/rtf/rtfparse.cxx1
-rw-r--r--sc/source/filter/xcl97/xcl97esc.cxx1
-rw-r--r--sc/source/filter/xml/XMLCellRangeSourceContext.cxx2
-rw-r--r--sc/source/filter/xml/XMLTableShapeImportHelper.cxx3
-rw-r--r--sc/source/filter/xml/XMLTableShapesContext.hxx1
-rw-r--r--sc/source/filter/xml/XMLTrackedChangesContext.cxx1
-rw-r--r--sc/source/filter/xml/celltextparacontext.cxx2
-rw-r--r--sc/source/filter/xml/xmlannoi.cxx2
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx2
-rw-r--r--sc/source/filter/xml/xmlcondformat.cxx2
-rw-r--r--sc/source/filter/xml/xmlconti.cxx1
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx4
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx2
-rw-r--r--sc/source/filter/xml/xmlnexpi.cxx2
-rw-r--r--sc/source/filter/xml/xmlsubti.cxx2
-rw-r--r--sc/source/filter/xml/xmltabi.cxx1
-rw-r--r--sc/source/filter/xml/xmltabi.hxx1
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx1
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx2
-rw-r--r--sc/source/ui/Accessibility/DrawModelBroadcaster.cxx1
-rw-r--r--sc/source/ui/app/inputwin.cxx1
-rw-r--r--sc/source/ui/cctrl/checklistmenu.cxx3
-rw-r--r--sc/source/ui/dataprovider/sqldataprovider.cxx1
-rw-r--r--sc/source/ui/dbgui/csvgrid.cxx1
-rw-r--r--sc/source/ui/dbgui/dapidata.cxx1
-rw-r--r--sc/source/ui/dbgui/filtdlg.cxx2
-rw-r--r--sc/source/ui/docshell/docsh.cxx1
-rw-r--r--sc/source/ui/drawfunc/drawsh2.cxx1
-rw-r--r--sc/source/ui/drawfunc/drawsh5.cxx1
-rw-r--r--sc/source/ui/drawfunc/fuconcustomshape.cxx2
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx1
-rw-r--r--sc/source/ui/drawfunc/mediash.cxx1
-rw-r--r--sc/source/ui/formdlg/formula.cxx1
-rw-r--r--sc/source/ui/inc/FilterListBox.hxx2
-rw-r--r--sc/source/ui/inc/areasave.hxx1
-rw-r--r--sc/source/ui/inc/cellsh.hxx1
-rw-r--r--sc/source/ui/inc/checklistmenu.hxx2
-rw-r--r--sc/source/ui/inc/filtdlg.hxx2
-rw-r--r--sc/source/ui/inc/gridwin.hxx1
-rw-r--r--sc/source/ui/inc/impex.hxx2
-rw-r--r--sc/source/ui/inc/linkarea.hxx1
-rw-r--r--sc/source/ui/inc/tphfedit.hxx1
-rw-r--r--sc/source/ui/inc/tpsubt.hxx1
-rw-r--r--sc/source/ui/inc/uiobject.hxx1
-rw-r--r--sc/source/ui/inc/undostyl.hxx1
-rw-r--r--sc/source/ui/miscdlgs/autofmt.cxx1
-rw-r--r--sc/source/ui/miscdlgs/filldlg.cxx1
-rw-r--r--sc/source/ui/miscdlgs/instbdlg.cxx1
-rw-r--r--sc/source/ui/miscdlgs/linkarea.cxx1
-rw-r--r--sc/source/ui/miscdlgs/optsolver.cxx1
-rw-r--r--sc/source/ui/miscdlgs/solvrdlg.cxx1
-rw-r--r--sc/source/ui/navipi/navipi.cxx1
-rw-r--r--sc/source/ui/navipi/scenwnd.cxx1
-rw-r--r--sc/source/ui/optdlg/tpcalc.cxx1
-rw-r--r--sc/source/ui/optdlg/tpusrlst.cxx1
-rw-r--r--sc/source/ui/pagedlg/scuitphfedit.cxx1
-rw-r--r--sc/source/ui/uitest/uiobject.cxx1
-rw-r--r--sc/source/ui/unoobj/datauno.cxx1
-rw-r--r--sc/source/ui/unoobj/defltuno.cxx1
-rw-r--r--sc/source/ui/unoobj/docuno.cxx3
-rw-r--r--sc/source/ui/unoobj/scdetect.cxx1
-rw-r--r--sc/source/ui/unoobj/shapeuno.cxx1
-rw-r--r--sc/source/ui/unoobj/targuno.cxx2
-rw-r--r--sc/source/ui/vba/excelvbahelper.hxx1
-rw-r--r--sc/source/ui/view/auditsh.cxx1
-rw-r--r--sc/source/ui/view/cellsh3.cxx1
-rw-r--r--sc/source/ui/view/drawutil.cxx1
-rw-r--r--sc/source/ui/view/gridwin.cxx1
-rw-r--r--sc/source/ui/view/gridwin4.cxx3
-rw-r--r--sc/source/ui/view/gridwin5.cxx1
-rw-r--r--sc/source/ui/view/olinewin.cxx3
-rw-r--r--sc/source/ui/view/preview.cxx1
-rw-r--r--sc/source/ui/view/tabview5.cxx1
-rw-r--r--sc/source/ui/view/tabvwsh2.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh5.cxx1
-rw-r--r--sc/source/ui/view/tabvwshf.cxx1
-rw-r--r--sc/source/ui/view/viewfunc.cxx2
-rw-r--r--sc/source/ui/xmlsource/xmlsourcedlg.cxx1
-rw-r--r--sccomp/source/solver/CoinMPSolver.cxx1
-rw-r--r--sccomp/source/solver/LpsolveSolver.cxx1
-rw-r--r--scripting/source/provider/URIHelper.cxx1
189 files changed, 151 insertions, 198 deletions
diff --git a/salhelper/source/timer.cxx b/salhelper/source/timer.cxx
index c0fba72ed68f..10f2e7138a61 100644
--- a/salhelper/source/timer.cxx
+++ b/salhelper/source/timer.cxx
@@ -20,7 +20,6 @@
#include <osl/thread.hxx>
#include <osl/conditn.hxx>
-#include <osl/mutex.hxx>
#include <mutex>
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index e4f0915421af..9effb82c348c 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -49,7 +49,6 @@
#include <cassert>
#include <cstring>
#include <libxml/parser.h>
-#include <cstdint>
// Inverse of libxml's BAD_CAST.
#define XML_CAST( str ) reinterpret_cast< const char* >( str )
diff --git a/sc/IwyuFilter_sc.yaml b/sc/IwyuFilter_sc.yaml
index 514c2c313824..4b199a80e8b6 100644
--- a/sc/IwyuFilter_sc.yaml
+++ b/sc/IwyuFilter_sc.yaml
@@ -352,9 +352,26 @@ excludelist:
sc/inc/unitconv.hxx:
# base class has to be a complete type
- map
+ sc/qa/unit/uicalc/uicalc.cxx:
+ # Actually used
+ - comphelper/scopeguard.hxx
+ sc/qa/unit/ucalc.cxx:
+ # Needed for namespace shortcuts
+ - helper/debughelper.hxx
+ sc/qa/unit/ucalc_copypaste.cxx:
+ # Needed for namespace shortcuts
+ - helper/debughelper.hxx
sc/qa/unit/ucalc_formula.cxx:
# Needed in template
- docpool.hxx
+ # Needed for namespace shortcuts
+ - helper/debughelper.hxx
+ sc/qa/unit/ucalc_sharedformula.cxx:
+ # Needed for namespace shortcuts
+ - helper/debughelper.hxx
+ sc/qa/unit/ucalc_sort.cxx:
+ # Needed for namespace shortcuts
+ - helper/debughelper.hxx
sc/qa/unit/functions_test.hxx:
# Needed for css shortcut
- sal/types.h
@@ -364,11 +381,17 @@ excludelist:
sc/qa/unit/subsequent_filters-test.cxx:
# Actually used
- comphelper/scopeguard.hxx
- sc/qa/unit/subsequent_export-test.cxx:
+ sc/qa/unit/subsequent_export_test.cxx:
# Actually used
- comphelper/scopeguard.hxx
# Needed for namespace shortcuts
- helper/debughelper.hxx
+ sc/qa/unit/subsequent_export_test2.cxx:
+ # Actually used
+ - comphelper/scopeguard.hxx
+ sc/qa/unit/subsequent_filters_test2.cxx:
+ # Actually used
+ - comphelper/scopeguard.hxx
sc/source/core/inc/addinlis.hxx:
# base class has to be a complete type
- com/sun/star/lang/XServiceInfo.hpp
@@ -855,6 +878,8 @@ excludelist:
- tokenarray.hxx
# Needed for direct member access
- com/sun/star/task/XStatusIndicator.hpp
+ # Don't propose hxx -> h in URE headers
+ - osl/thread.hxx
sc/source/filter/orcus/xmlcontext.cxx:
# Needed for implicit dtor
- tokenarray.hxx
@@ -995,6 +1020,9 @@ excludelist:
sc/source/ui/dataprovider/htmldataprovider.cxx:
# Needed for unique_ptr type
- tools/stream.hxx
+ sc/source/ui/dbgui/csvgrid.cxx:
+ # Needed for implicit dtor
+ - svl/itempool.hxx
sc/source/ui/docshell/docfunc.cxx:
# Needed for direct member access
- svx/svdocapt.hxx
@@ -1008,8 +1036,6 @@ excludelist:
- impex.hxx
- rangeseq.hxx
sc/source/ui/docshell/impex.cxx:
- # OSL_BIGENDIAN is being checked
- - osl/endian.h
# Needed for unique_ptr type
- tokenarray.hxx
- refundo.hxx
@@ -1039,6 +1065,9 @@ excludelist:
sc/source/ui/unoobj/confuno.cxx:
# Used with function template
- docpool.hxx
+ sc/source/ui/unoobj/docuno.cxx:
+ # Needed for implicit dtor
+ - transobj.hxx
sc/source/ui/unoobj/notesuno.cxx:
# Needed for macro defines
- editeng/unoprnms.hxx
@@ -1051,6 +1080,12 @@ excludelist:
sc/source/ui/view/tabview.cxx:
# Needed for direct member access
- pagedata.hxx
+ sc/source/ui/view/tabview5.cxx:
+ # Needed for implicit dtor
+ - olinewin.hxx
+ sc/source/ui/unoobj/viewuno.cxx:
+ # Needed for implicit dtor
+ - transobj.hxx
sc/source/ui/vba/vbaformatconditions.cxx:
# Needed for template
- ooo/vba/excel/XRange.hpp
diff --git a/sc/inc/ChartTools.hxx b/sc/inc/ChartTools.hxx
index 05e3bb404b8a..4738c669390e 100644
--- a/sc/inc/ChartTools.hxx
+++ b/sc/inc/ChartTools.hxx
@@ -10,13 +10,12 @@
#pragma once
+#include <string_view>
#include <memory>
#include <vector>
#include <svx/svditer.hxx>
-#include <rtl/ustring.hxx>
#include <tools/long.hxx>
-
#include "types.hxx"
class ScDocShell;
diff --git a/sc/inc/ViewSettingsSequenceDefines.hxx b/sc/inc/ViewSettingsSequenceDefines.hxx
index 5ec1023e98ff..8fdbb5bb16ec 100644
--- a/sc/inc/ViewSettingsSequenceDefines.hxx
+++ b/sc/inc/ViewSettingsSequenceDefines.hxx
@@ -19,6 +19,8 @@
#pragma once
+#include <rtl/ustring.hxx>
+
// this are the defines for the position of the settings in the
// ViewSettingsSequence
diff --git a/sc/inc/afmtuno.hxx b/sc/inc/afmtuno.hxx
index 250dbb242936..ae1b1a9a9330 100644
--- a/sc/inc/afmtuno.hxx
+++ b/sc/inc/afmtuno.hxx
@@ -19,6 +19,7 @@
#pragma once
+#include <rtl/ref.hxx>
#include <svl/itemprop.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
diff --git a/sc/inc/bigrange.hxx b/sc/inc/bigrange.hxx
index 33d12b98724c..f776d6fd36fd 100644
--- a/sc/inc/bigrange.hxx
+++ b/sc/inc/bigrange.hxx
@@ -20,7 +20,6 @@
#pragma once
#include "address.hxx"
-#include <algorithm>
const sal_Int32 nInt32Min = 0x80000000;
const sal_Int32 nInt32Max = 0x7fffffff;
diff --git a/sc/inc/bulkdatahint.hxx b/sc/inc/bulkdatahint.hxx
index d8d51bf96b1c..e77ef317ef72 100644
--- a/sc/inc/bulkdatahint.hxx
+++ b/sc/inc/bulkdatahint.hxx
@@ -10,7 +10,6 @@
#pragma once
#include <svl/hint.hxx>
-#include <memory>
class ScDocument;
diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx
index e06c9d355b96..5e3e1f69f7c7 100644
--- a/sc/inc/cellsuno.hxx
+++ b/sc/inc/cellsuno.hxx
@@ -88,7 +88,6 @@
#include <com/sun/star/document/XEventsSupplier.hpp>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/implbase.hxx>
-#include <cppuhelper/weakref.hxx>
#include <memory>
#include <optional>
diff --git a/sc/inc/chartuno.hxx b/sc/inc/chartuno.hxx
index 63b121b8dfc1..1a2e3a314ee7 100644
--- a/sc/inc/chartuno.hxx
+++ b/sc/inc/chartuno.hxx
@@ -20,6 +20,7 @@
#pragma once
#include "rangelst.hxx"
+#include <rtl/ref.hxx>
#include <svl/lstner.hxx>
#include <comphelper/proparrhlp.hxx>
#include <comphelper/propertycontainer.hxx>
diff --git a/sc/inc/columniterator.hxx b/sc/inc/columniterator.hxx
index 64ea55e31325..260c13e03551 100644
--- a/sc/inc/columniterator.hxx
+++ b/sc/inc/columniterator.hxx
@@ -11,7 +11,7 @@
#include <stddef.h>
#include "address.hxx"
-#include <mdds/multi_type_vector_types.hpp>
+#include <mdds/multi_type_vector/types.hpp>
#include "mtvelements.hxx"
#include <sal/types.h>
#include "types.hxx"
diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index 5a131e5f6a10..d47b841b0880 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -19,7 +19,6 @@
#pragma once
-#include "global.hxx"
#include <tools/solar.h>
#include <tools/color.hxx>
#include "address.hxx"
diff --git a/sc/inc/detdata.hxx b/sc/inc/detdata.hxx
index db8e2f6cc4e9..d9eeea6ad996 100644
--- a/sc/inc/detdata.hxx
+++ b/sc/inc/detdata.hxx
@@ -21,7 +21,6 @@
#include "global.hxx"
-#include <memory>
#include <vector>
enum ScDetOpType
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 158b9f3844c6..a53c9334d47f 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -28,6 +28,7 @@
#include "interpretercontext.hxx"
#include "rangelst.hxx"
#include "rangenam.hxx"
+#include "recursionhelper.hxx"
#include "tabopparams.hxx"
#include "types.hxx"
#include <formula/grammar.hxx>
diff --git a/sc/inc/documentlinkmgr.hxx b/sc/inc/documentlinkmgr.hxx
index 3d7bb9b82ddb..e37719a3431c 100644
--- a/sc/inc/documentlinkmgr.hxx
+++ b/sc/inc/documentlinkmgr.hxx
@@ -9,8 +9,8 @@
#pragma once
-#include <rtl/ustring.hxx>
#include <memory>
+#include <string_view>
class SfxObjectShell;
namespace weld { class Window; }
diff --git a/sc/inc/fielduno.hxx b/sc/inc/fielduno.hxx
index f4cf3bac7520..c8e50f3642ca 100644
--- a/sc/inc/fielduno.hxx
+++ b/sc/inc/fielduno.hxx
@@ -34,7 +34,6 @@
#include <com/sun/star/util/DateTime.hpp>
#include <comphelper/interfacecontainer3.hxx>
#include <comphelper/servicehelper.hxx>
-#include <cppuhelper/component.hxx>
#include <cppuhelper/implbase.hxx>
#include <comphelper/compbase.hxx>
#include <osl/mutex.hxx>
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 927569e767c7..d677f133edf0 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -19,6 +19,8 @@
#pragma once
+#include <rtl/string.hxx>
+
inline constexpr OStringLiteral HID_INSWIN_POS = "SC_HID_INSWIN_POS";
inline constexpr OStringLiteral HID_INSWIN_CALC = "SC_HID_INSWIN_CALC";
inline constexpr OStringLiteral HID_INSWIN_CANCEL = "SC_HID_INSWIN_CANCEL";
diff --git a/sc/inc/math.hxx b/sc/inc/math.hxx
index a1afff90a0a7..492e5d91448e 100644
--- a/sc/inc/math.hxx
+++ b/sc/inc/math.hxx
@@ -20,8 +20,6 @@
#pragma once
#include <formula/errorcodes.hxx>
-#include <rtl/math.hxx>
-#include "kahan.hxx"
namespace sc {
diff --git a/sc/inc/matrixoperators.hxx b/sc/inc/matrixoperators.hxx
index 7d994bc6067c..b5771a290faf 100644
--- a/sc/inc/matrixoperators.hxx
+++ b/sc/inc/matrixoperators.hxx
@@ -12,7 +12,7 @@
#include <functional>
#include <vector>
-#include "math.hxx"
+#include "kahan.hxx"
namespace sc::op {
diff --git a/sc/inc/mtvfunctions.hxx b/sc/inc/mtvfunctions.hxx
index 854ca42c37fc..8f69c05c39fd 100644
--- a/sc/inc/mtvfunctions.hxx
+++ b/sc/inc/mtvfunctions.hxx
@@ -10,7 +10,7 @@
#pragma once
#include <cstdlib>
-#include <mdds/multi_type_vector_types.hpp>
+#include <mdds/multi_type_vector/types.hpp>
namespace sc {
diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx
index f60144c2feaf..c449190b2305 100644
--- a/sc/inc/patattr.hxx
+++ b/sc/inc/patattr.hxx
@@ -26,7 +26,6 @@
#include <editeng/svxenum.hxx>
#include "scdllapi.h"
#include "fonthelper.hxx"
-#include <memory>
namespace vcl { class Font; }
class OutputDevice;
diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx
index 4bf519a9fbc6..dd3475ebb9f9 100644
--- a/sc/inc/postit.hxx
+++ b/sc/inc/postit.hxx
@@ -25,7 +25,6 @@
#include "scdllapi.h"
#include <memory>
-#include <optional>
#include <string_view>
class EditTextObject;
diff --git a/sc/inc/pvfundlg.hrc b/sc/inc/pvfundlg.hrc
index 0f3fe4dd424f..1f3f8df37c17 100644
--- a/sc/inc/pvfundlg.hrc
+++ b/sc/inc/pvfundlg.hrc
@@ -19,6 +19,8 @@
#pragma once
+# include <unotools/resmgr.hxx>
+
#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String))
const TranslateId SCSTR_DPFUNCLISTBOX[] =
diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx
index 8d9dbe01fe0f..e80cb864fd48 100644
--- a/sc/inc/queryparam.hxx
+++ b/sc/inc/queryparam.hxx
@@ -24,7 +24,6 @@
#include "queryentry.hxx"
#include "types.hxx"
-#include <memory>
#include <vector>
#include <ostream>
diff --git a/sc/inc/refreshtimer.hxx b/sc/inc/refreshtimer.hxx
index 83ec8f966d4b..546fa7feda2c 100644
--- a/sc/inc/refreshtimer.hxx
+++ b/sc/inc/refreshtimer.hxx
@@ -21,7 +21,6 @@
#include <sal/config.h>
-#include <tools/solar.h>
#include <vcl/timer.hxx>
#include "scdllapi.h"
#include <memory>
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index fd872b273b11..5d9285b5017a 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -19,7 +19,6 @@
#pragma once
-#include <tools/solar.h>
#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
#include <sfx2/tabdlg.hxx>
#include <tools/fldunit.hxx>
diff --git a/sc/inc/scfuncs.hrc b/sc/inc/scfuncs.hrc
index 88d78f2f7c28..12d59858260e 100644
--- a/sc/inc/scfuncs.hrc
+++ b/sc/inc/scfuncs.hrc
@@ -18,6 +18,8 @@
*/
#pragma once
+#include <unotools/resmgr.hxx>
+
#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String))
/* Resource file for the function wizard / autopilot.
diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx
index 4a89fd3424cd..c21082043ceb 100644
--- a/sc/inc/scmod.hxx
+++ b/sc/inc/scmod.hxx
@@ -23,7 +23,6 @@
#include <o3tl/deleter.hxx>
#include <vcl/timer.hxx>
#include <svl/lstner.hxx>
-#include <svl/itempool.hxx>
#include <sfx2/app.hxx>
#include <sfx2/module.hxx>
#include "global.hxx"
diff --git a/sc/inc/scstyles.hrc b/sc/inc/scstyles.hrc
index 2d11b56d713f..4e4c449d69c9 100644
--- a/sc/inc/scstyles.hrc
+++ b/sc/inc/scstyles.hrc
@@ -20,6 +20,7 @@
#pragma once
#include <svl/style.hxx>
+#include <unotools/resmgr.hxx>
#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String))
diff --git a/sc/inc/strings.hxx b/sc/inc/strings.hxx
index 96430261c8d8..38c6a1fdd4dd 100644
--- a/sc/inc/strings.hxx
+++ b/sc/inc/strings.hxx
@@ -9,6 +9,8 @@
#pragma once
+#include <rtl/ustring.hxx>
+
inline constexpr OUStringLiteral SCSTR_FIELDSEP = u",\t44\t;\t59\t:\t58\t{%TAB}\t9\t{%SPACE}\t32 ";
inline constexpr OUStringLiteral SCSTR_TEXTSEP = u"\"\t34\t'\t39";
inline constexpr OUStringLiteral STR_ACC_DOC_DESCR = u"";
diff --git a/sc/inc/subtotals.hrc b/sc/inc/subtotals.hrc
index bbf7884fcbaf..21ede539b113 100644
--- a/sc/inc/subtotals.hrc
+++ b/sc/inc/subtotals.hrc
@@ -19,6 +19,8 @@
#pragma once
+#include <unotools/resmgr.hxx>
+
#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String))
const TranslateId SCSTR_SUBTOTALS[] =
diff --git a/sc/inc/units.hrc b/sc/inc/units.hrc
index 426141fab788..66ba5bd933e4 100644
--- a/sc/inc/units.hrc
+++ b/sc/inc/units.hrc
@@ -19,6 +19,8 @@
#pragma once
+#include <unotools/resmgr.hxx>
+
#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String))
#include <tools/fldunit.hxx>
diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index 556f003d2a33..7a73176cfd29 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -19,6 +19,8 @@
#pragma once
+#include <rtl/ustring.hxx>
+
// service names
inline constexpr OUStringLiteral SC_SERVICENAME_VALBIND = u"com.sun.star.table.CellValueBinding";
inline constexpr OUStringLiteral SC_SERVICENAME_LISTCELLBIND = u"com.sun.star.table.ListPositionCellBinding";
diff --git a/sc/inc/viewuno.hxx b/sc/inc/viewuno.hxx
index 4f428b3b6a39..b4ce26f7fc8d 100644
--- a/sc/inc/viewuno.hxx
+++ b/sc/inc/viewuno.hxx
@@ -19,6 +19,7 @@
#pragma once
+#include <rtl/ref.hxx>
#include <sfx2/sfxbasecontroller.hxx>
#include <svl/itemprop.hxx>
#include <svl/lstner.hxx>
diff --git a/sc/qa/extras/htmlexporttest.cxx b/sc/qa/extras/htmlexporttest.cxx
index 04c946a1bd32..663bb468c76e 100644
--- a/sc/qa/extras/htmlexporttest.cxx
+++ b/sc/qa/extras/htmlexporttest.cxx
@@ -20,7 +20,6 @@
#include <test/xmltesttools.hxx>
#include <comphelper/processfactory.hxx>
#include <unotools/mediadescriptor.hxx>
-#include <unotools/localfilehelper.hxx>
#include <unotest/macros_test.hxx>
using namespace css::uno;
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index a774129f5ae7..802f44a0541c 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -9,19 +9,14 @@
#include <sal/config.h>
#include <test/unoapi_test.hxx>
-#include <osl/file.hxx>
#include <sal/log.hxx>
#include <unotools/tempfile.hxx>
-#include <vcl/svapp.hxx>
-#include <editeng/borderline.hxx>
#include <svx/svdpage.hxx>
#include <unotools/mediadescriptor.hxx>
#include <comphelper/propertyvalue.hxx>
#include <docsh.hxx>
#include <document.hxx>
-#include <attrib.hxx>
-#include <scitems.hxx>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
diff --git a/sc/qa/extras/scchartsobj.cxx b/sc/qa/extras/scchartsobj.cxx
index 0b85a2988d25..57b0c584ee07 100644
--- a/sc/qa/extras/scchartsobj.cxx
+++ b/sc/qa/extras/scchartsobj.cxx
@@ -23,7 +23,6 @@
#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XSpreadsheets.hpp>
-#include <com/sun/star/table/CellRangeAddress.hpp>
#include <com/sun/star/table/XCell.hpp>
#include <com/sun/star/table/XCellRange.hpp>
#include <com/sun/star/table/XTableChart.hpp>
diff --git a/sc/qa/extras/scindexenumeration_scenariosenumeration.cxx b/sc/qa/extras/scindexenumeration_scenariosenumeration.cxx
index bd01aaee7681..9de0bbb98f03 100644
--- a/sc/qa/extras/scindexenumeration_scenariosenumeration.cxx
+++ b/sc/qa/extras/scindexenumeration_scenariosenumeration.cxx
@@ -18,7 +18,6 @@
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/sheet/XSpreadsheets.hpp>
-#include <com/sun/star/table/CellRangeAddress.hpp>
#include <com/sun/star/table/XCellRange.hpp>
#include <com/sun/star/uno/XInterface.hpp>
diff --git a/sc/qa/extras/scindexenumeration_subtotalfieldsenumeration.cxx b/sc/qa/extras/scindexenumeration_subtotalfieldsenumeration.cxx
index 69cc3abbc7a9..9adba41f6977 100644
--- a/sc/qa/extras/scindexenumeration_subtotalfieldsenumeration.cxx
+++ b/sc/qa/extras/scindexenumeration_subtotalfieldsenumeration.cxx
@@ -14,7 +14,6 @@
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/sheet/GeneralFunction.hpp>
-#include <com/sun/star/sheet/SubTotalColumn.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XSpreadsheets.hpp>
diff --git a/sc/qa/extras/scindexenumeration_tablechartsenumeration.cxx b/sc/qa/extras/scindexenumeration_tablechartsenumeration.cxx
index 73facfad4b19..55134be87936 100644
--- a/sc/qa/extras/scindexenumeration_tablechartsenumeration.cxx
+++ b/sc/qa/extras/scindexenumeration_tablechartsenumeration.cxx
@@ -18,7 +18,6 @@
#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XSpreadsheets.hpp>
-#include <com/sun/star/table/CellRangeAddress.hpp>
#include <com/sun/star/table/XCellRange.hpp>
#include <com/sun/star/table/XTableCharts.hpp>
#include <com/sun/star/table/XTableChartsSupplier.hpp>
diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx
index 9771664c24a9..96bbbc3c8912 100644
--- a/sc/qa/unit/scshapetest.cxx
+++ b/sc/qa/unit/scshapetest.cxx
@@ -32,8 +32,6 @@
#include <tabvwsh.hxx>
#include <userdat.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
-
#include <sc.hrc> // defines of slot-IDs
using namespace css;
diff --git a/sc/qa/unit/subsequent_export_test.cxx b/sc/qa/unit/subsequent_export_test.cxx
index 672c95ccf969..779d74413122 100644
--- a/sc/qa/unit/subsequent_export_test.cxx
+++ b/sc/qa/unit/subsequent_export_test.cxx
@@ -11,6 +11,9 @@
#include <config_fonts.h>
#include "helper/debughelper.hxx"
+#include <sfx2/sfxmodelfactory.hxx>
+
+#include "helper/qahelper.hxx"
#include "helper/xpath.hxx"
#include "helper/shared_test_impl.hxx"
@@ -42,6 +45,7 @@
#include <editeng/udlnitem.hxx>
#include <editeng/colritem.hxx>
#include <unotools/useroptions.hxx>
+#include <tools/datetime.hxx>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/awt/XBitmap.hpp>
diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx
index 760628f2310c..6c9dcd240765 100644
--- a/sc/qa/unit/subsequent_export_test2.cxx
+++ b/sc/qa/unit/subsequent_export_test2.cxx
@@ -10,6 +10,8 @@
#include <officecfg/Office/Common.hxx>
+#include <sfx2/sfxmodelfactory.hxx>
+
#include "helper/qahelper.hxx"
#include "helper/xpath.hxx"
@@ -20,6 +22,8 @@
#include <stlpool.hxx>
#include <formulacell.hxx>
#include <validat.hxx>
+#include <global.hxx>
+#include <dpcache.hxx>
#include <dpobject.hxx>
#include <clipparam.hxx>
#include <viewopti.hxx>
@@ -33,12 +37,17 @@
#include <comphelper/propertyvalue.hxx>
#include <comphelper/scopeguard.hxx>
#include <unotools/syslocaleoptions.hxx>
+#include <formula/grammar.hxx>
+#include <tools/fldunit.hxx>
#include <svl/numformat.hxx>
#include <svl/zformat.hxx>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <com/sun/star/drawing/XDrawPages.hpp>
+#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/sheet/GlobalSheetSettings.hpp>
#include <com/sun/star/sheet/XHeaderFooterContent.hpp>
diff --git a/sc/qa/unit/subsequent_filters_test.cxx b/sc/qa/unit/subsequent_filters_test.cxx
index 6d07cf95649b..a0a589a165bb 100644
--- a/sc/qa/unit/subsequent_filters_test.cxx
+++ b/sc/qa/unit/subsequent_filters_test.cxx
@@ -34,6 +34,9 @@
#include <userdat.hxx>
#include <stlsheet.hxx>
#include <docfunc.hxx>
+#include <markdata.hxx>
+#include <colorscale.hxx>
+#include <patattr.hxx>
#include <scitems.hxx>
#include <editutil.hxx>
#include <attrib.hxx>
@@ -41,6 +44,7 @@
#include <scopetools.hxx>
#include <stlpool.hxx>
#include <detfunc.hxx>
+#include <cellmergeoption.hxx>
#include <sortparam.hxx>
#include <orcusfilters.hxx>
@@ -49,6 +53,11 @@
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
+#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/text/textfield/Type.hpp>
+
+#include "helper/qahelper.hxx"
#include "helper/shared_test_impl.hxx"
using namespace ::com::sun::star;
diff --git a/sc/qa/unit/subsequent_filters_test2.cxx b/sc/qa/unit/subsequent_filters_test2.cxx
index c164b52cc730..f6ea696f8cfd 100644
--- a/sc/qa/unit/subsequent_filters_test2.cxx
+++ b/sc/qa/unit/subsequent_filters_test2.cxx
@@ -9,7 +9,13 @@
#include <unotest/filters-test.hxx>
-#include <vcl/svapp.hxx>
+#include <sal/config.h>
+
+#include <memory>
+
+#include <test/bootstrapfixture.hxx>
+
+#include <osl/thread.h>
#include <svl/numformat.hxx>
#include <svl/zformat.hxx>
#include <svx/svdograf.hxx>
@@ -30,6 +36,8 @@
#include <validat.hxx>
#include <formulacell.hxx>
#include <docfunc.hxx>
+#include <userdat.hxx>
+#include <markdata.hxx>
#include <olinetab.hxx>
#include <postit.hxx>
#include <scitems.hxx>
@@ -45,6 +53,8 @@
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
+#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
#include <comphelper/scopeguard.hxx>
#include <tools/UnitConversion.hxx>
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 71ebe3278d23..12748abe5525 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -19,6 +19,7 @@
#include <scitems.hxx>
#include <reffind.hxx>
#include <clipparam.hxx>
+#include <undoblk.hxx>
#include <undotab.hxx>
#include <attrib.hxx>
#include <dbdata.hxx>
@@ -43,6 +44,8 @@
#include <editable.hxx>
#include <tabprotection.hxx>
+#include <formula/IFunctionDescription.hxx>
+
#include <editeng/borderline.hxx>
#include <editeng/brushitem.hxx>
#include <editeng/eeitem.hxx>
@@ -56,6 +59,7 @@
#include <svx/svdocapt.hxx>
#include <svl/numformat.hxx>
#include <svl/srchitem.hxx>
+#include <svl/sharedstringpool.hxx>
#include <unotools/collatorwrapper.hxx>
#include <sfx2/sfxsids.hrc>
diff --git a/sc/qa/unit/ucalc_condformat.cxx b/sc/qa/unit/ucalc_condformat.cxx
index 64a8d4cba01a..a3d34b69e2c9 100644
--- a/sc/qa/unit/ucalc_condformat.cxx
+++ b/sc/qa/unit/ucalc_condformat.cxx
@@ -9,6 +9,9 @@
#include "helper/qahelper.hxx"
+#include <conditio.hxx>
+#include <colorscale.hxx>
+
#include <globstr.hrc>
#include <scresid.hxx>
#include <docfunc.hxx>
diff --git a/sc/qa/unit/ucalc_copypaste.cxx b/sc/qa/unit/ucalc_copypaste.cxx
index 50850c59fc2b..110d2ac481ab 100644
--- a/sc/qa/unit/ucalc_copypaste.cxx
+++ b/sc/qa/unit/ucalc_copypaste.cxx
@@ -20,6 +20,8 @@
#include <editeng/brushitem.hxx>
#include <editutil.hxx>
#include <formulacell.hxx>
+#include <iostream>
+#include <patattr.hxx>
#include <postit.hxx>
#include <queryparam.hxx>
#include <refundo.hxx>
@@ -27,8 +29,11 @@
#include <scitems.hxx>
#include <scopetools.hxx>
+#include <test/bootstrapfixture.hxx>
#include <sfx2/docfile.hxx>
+#include <memory>
+
class TestCopyPaste : public test::BootstrapFixture
{
public:
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 544a3aa15fb0..1dd7b1f70ecd 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -7,6 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include <test/bootstrapfixture.hxx>
#include "helper/debughelper.hxx"
#include "helper/qahelper.hxx"
#include <clipparam.hxx>
@@ -21,6 +22,7 @@
#include <validat.hxx>
#include <scitems.hxx>
#include <docpool.hxx>
+#include <docoptio.hxx>
#include <externalrefmgr.hxx>
#include <scdll.hxx>
#include <scmod.hxx>
@@ -30,6 +32,12 @@
#include <svl/intitem.hxx>
#include <sfx2/docfile.hxx>
+#include <memory>
+#include <functional>
+#include <set>
+#include <algorithm>
+#include <vector>
+
using namespace formula;
namespace {
diff --git a/sc/qa/unit/ucalc_sharedformula.cxx b/sc/qa/unit/ucalc_sharedformula.cxx
index 2230a5869687..ac4383f4f544 100644
--- a/sc/qa/unit/ucalc_sharedformula.cxx
+++ b/sc/qa/unit/ucalc_sharedformula.cxx
@@ -22,6 +22,10 @@
#include <scdll.hxx>
#include <sfx2/docfile.hxx>
+#include <test/bootstrapfixture.hxx>
+
+#include <memory>
+#include <string_view>
class TestSharedFormula : public test::BootstrapFixture
{
diff --git a/sc/qa/unit/ucalc_sort.cxx b/sc/qa/unit/ucalc_sort.cxx
index fe73d9a71833..ccff4d77b50d 100644
--- a/sc/qa/unit/ucalc_sort.cxx
+++ b/sc/qa/unit/ucalc_sort.cxx
@@ -22,6 +22,7 @@
#include <docfunc.hxx>
#include <scitems.hxx>
#include <editutil.hxx>
+#include <drwlayer.hxx>
#include <editeng/wghtitem.hxx>
#include <editeng/postitem.hxx>
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index 41397c17c26a..317f9751c1c4 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -25,7 +25,7 @@
#include <com/sun/star/sheet/GlobalSheetSettings.hpp>
#include <com/sun/star/text/XTextRange.hpp>
#include <conditio.hxx>
-#include <dbfunc.hxx>
+#include <dbdata.hxx>
#include <document.hxx>
#include <docuno.hxx>
#include <docsh.hxx>
diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx
index 48d2ec5ad05f..e998ad9c841d 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -24,7 +24,6 @@
#include <algorithm>
#include <cassert>
-#include <string_view>
ScFormulaListener::ScFormulaListener(ScFormulaCell* pCell):
mbDirty(false),
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 74b2e1ac7fad..e34aac4d135c 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -46,7 +46,6 @@
#include <filterentries.hxx>
#include <conditio.hxx>
#include <colorscale.hxx>
-#include <stlpool.hxx>
#include <editeng/brushitem.hxx>
#include <editeng/colritem.hxx>
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 70ea804076b8..e67b7c56b3c3 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -19,7 +19,6 @@
#include <scitems.hxx>
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <rtl/math.hxx>
#include <sal/log.hxx>
#include <unotools/collatorwrapper.hxx>
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index 9ebf027dee89..6131be280c5d 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -19,8 +19,6 @@
#include <sal/config.h>
-#include <utility>
-
#include <scitems.hxx>
#include <comphelper/string.hxx>
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 3354ead298f0..ff79c90fb56f 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -34,7 +34,6 @@
#include <svl/flagitem.hxx>
#include <svl/intitem.hxx>
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
#include <svl/ctloptions.hxx>
#include <unotools/transliterationwrapper.hxx>
diff --git a/sc/source/core/data/dpdimsave.cxx b/sc/source/core/data/dpdimsave.cxx
index c8ac79cc02ad..07ba25f0acef 100644
--- a/sc/source/core/data/dpdimsave.cxx
+++ b/sc/source/core/data/dpdimsave.cxx
@@ -27,7 +27,6 @@
#include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp>
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <osl/diagnose.h>
#include <rtl/math.hxx>
#include <algorithm>
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index a5ff421649fd..e0f42e1581de 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -70,7 +70,6 @@
#include <comphelper/types.hxx>
#include <sal/macros.h>
#include <svl/numformat.hxx>
-#include <rtl/math.hxx>
#include <tools/diagnose_ex.h>
#include <svl/zforlist.hxx>
#include <vcl/svapp.hxx>
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index e5a11b57555e..1160b45c1d7c 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -73,7 +73,6 @@
#include <table.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
-#include <vcl/fieldvalues.hxx>
#include <memory>
#include <algorithm>
#include <cstdlib>
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index fa50d4b9a3f3..945dc0cb2490 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -51,7 +51,6 @@
#include <comphelper/threadpool.hxx>
#include <editeng/editobj.hxx>
-#include <tools/cpuid.hxx>
#include <formula/errorcodes.hxx>
#include <svl/intitem.hxx>
#include <svl/numformat.hxx>
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index a42a651cba8e..a9e184aee0ed 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -21,6 +21,7 @@
#include <svx/algitem.hxx>
#include <editeng/brushitem.hxx>
#include <editeng/editobj.hxx>
+#include <svl/itempool.hxx>
#include <svl/srchitem.hxx>
#include <editeng/langitem.hxx>
#include <o3tl/unit_conversion.hxx>
diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx
index fd5c20cad3c3..440553deaedc 100644
--- a/sc/source/core/data/markdata.cxx
+++ b/sc/source/core/data/markdata.cxx
@@ -28,7 +28,6 @@
#include <columnspanset.hxx>
#include <fstalgorithm.hxx>
#include <unordered_map>
-#include <tabview.hxx>
#include <osl/diagnose.h>
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index c92c409804e5..0414b957cada 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -59,7 +59,6 @@
#include <stlsheet.hxx>
#include <stlpool.hxx>
#include <document.hxx>
-#include <global.hxx>
#include <globstr.hrc>
#include <scresid.hxx>
#include <validat.hxx>
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index cc756fbcb6a4..38133b16c48d 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -50,7 +50,6 @@
#include <rowheightcontext.hxx>
#include <listenercontext.hxx>
#include <compressedarray.hxx>
-#include <brdcst.hxx>
#include <refdata.hxx>
#include <docsh.hxx>
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 8c2c298eb2f1..f028a5fd795f 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -19,7 +19,6 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/random.hxx>
-#include <unotools/textsearch.hxx>
#include <svl/numformat.hxx>
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
@@ -45,7 +44,6 @@
#include <rangelst.hxx>
#include <userlist.hxx>
#include <progress.hxx>
-#include <cellform.hxx>
#include <queryparam.hxx>
#include <queryentry.hxx>
#include <subtotalparam.hxx>
@@ -63,7 +61,6 @@
#include <bcaslot.hxx>
#include <reordermap.hxx>
#include <drwlayer.hxx>
-#include <conditio.hxx>
#include <queryevaluator.hxx>
#include <svl/sharedstringpool.hxx>
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 78541960a11c..688007885792 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -32,7 +32,6 @@
#include <basic/sbx.hxx>
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <svl/sharedstringpool.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 2e90271af4c0..5d06319b2538 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -29,6 +29,7 @@
#include <calcconfig.hxx>
#include <token.hxx>
#include <math.hxx>
+#include <kahan.hxx>
#include "parclass.hxx"
#include <map>
diff --git a/sc/source/core/tool/arraysumSSE2.cxx b/sc/source/core/tool/arraysumSSE2.cxx
index 8542e2e2335d..5d962baf9900 100644
--- a/sc/source/core/tool/arraysumSSE2.cxx
+++ b/sc/source/core/tool/arraysumSSE2.cxx
@@ -12,7 +12,6 @@
#include <arraysumfunctor.hxx>
-#include <tools/simd.hxx>
#include <tools/simdsupport.hxx>
#include <stdlib.h>
diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx
index da81abba383c..629491baaa31 100644
--- a/sc/source/core/tool/cellform.cxx
+++ b/sc/source/core/tool/cellform.cxx
@@ -20,7 +20,6 @@
#include <cellform.hxx>
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <svl/sharedstring.hxx>
#include <formulacell.hxx>
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index feb5d4bea33a..30e1548839d6 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -37,7 +37,6 @@
#include <osl/diagnose.h>
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <sfx2/objsh.hxx>
#include <unotools/useroptions.hxx>
#include <unotools/datetime.hxx>
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 8929e0756e90..2ae54b9be00f 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -48,7 +48,6 @@
#include <rtl/math.hxx>
#include <rtl/ustring.hxx>
#include <stdlib.h>
-#include <math.h>
#include <rangenam.hxx>
#include <dbdata.hxx>
#include <document.hxx>
diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx
index bce5a5ac14e1..f19037c9953f 100644
--- a/sc/source/core/tool/ddelink.cxx
+++ b/sc/source/core/tool/ddelink.cxx
@@ -24,7 +24,6 @@
#include <sfx2/linkmgr.hxx>
#include <sfx2/bindings.hxx>
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <svl/sharedstringpool.hxx>
#include <ddelink.hxx>
diff --git a/sc/source/core/tool/detdata.cxx b/sc/source/core/tool/detdata.cxx
index b232a4dddab4..6faa3cb37c0d 100644
--- a/sc/source/core/tool/detdata.cxx
+++ b/sc/source/core/tool/detdata.cxx
@@ -18,7 +18,6 @@
*/
#include <algorithm>
-#include <memory>
#include <detdata.hxx>
#include <refupdat.hxx>
diff --git a/sc/source/core/tool/docoptio.cxx b/sc/source/core/tool/docoptio.cxx
index c3071946d2d1..1f88b07c9bb1 100644
--- a/sc/source/core/tool/docoptio.cxx
+++ b/sc/source/core/tool/docoptio.cxx
@@ -18,8 +18,6 @@
*/
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
-#include <tools/UnitConversion.hxx>
#include <osl/diagnose.h>
#include <com/sun/star/uno/Any.hxx>
diff --git a/sc/source/core/tool/inputopt.cxx b/sc/source/core/tool/inputopt.cxx
index c36fceee499a..7fde948f5ee4 100644
--- a/sc/source/core/tool/inputopt.cxx
+++ b/sc/source/core/tool/inputopt.cxx
@@ -23,7 +23,6 @@
#include <inputopt.hxx>
#include <global.hxx>
-#include <miscuno.hxx>
using namespace utl;
using namespace com::sun::star::uno;
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index 8d7ba5ea4952..25b5f44038f2 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -27,7 +27,6 @@
#include <matrixoperators.hxx>
#include <scmatrix.hxx>
-#include <math.h>
#include <cassert>
#include <memory>
#include <set>
@@ -36,7 +35,6 @@
#include <comphelper/random.hxx>
#include <o3tl/float_int_conversion.hxx>
#include <osl/diagnose.h>
-#include <basegfx/numeric/ftools.hxx>
using ::std::vector;
using namespace formula;
diff --git a/sc/source/core/tool/math.cxx b/sc/source/core/tool/math.cxx
index 3c496f83833c..e61d39386e98 100644
--- a/sc/source/core/tool/math.cxx
+++ b/sc/source/core/tool/math.cxx
@@ -13,6 +13,7 @@
#include <cfenv>
#include <o3tl/float_int_conversion.hxx>
+#include <rtl/math.hxx>
namespace sc
{
diff --git a/sc/source/core/tool/numformat.cxx b/sc/source/core/tool/numformat.cxx
index 2482b49b0638..8240c1ac6e4f 100644
--- a/sc/source/core/tool/numformat.cxx
+++ b/sc/source/core/tool/numformat.cxx
@@ -23,7 +23,6 @@
#include <comphelper/processfactory.hxx>
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
#include <svl/languageoptions.hxx>
diff --git a/sc/source/core/tool/printopt.cxx b/sc/source/core/tool/printopt.cxx
index 930de81d6fa3..e9b3e1516147 100644
--- a/sc/source/core/tool/printopt.cxx
+++ b/sc/source/core/tool/printopt.cxx
@@ -22,7 +22,6 @@
#include <osl/diagnose.h>
#include <printopt.hxx>
-#include <miscuno.hxx>
#include <sc.hrc>
using namespace utl;
diff --git a/sc/source/core/tool/queryparam.cxx b/sc/source/core/tool/queryparam.cxx
index 694f54226b5e..eb479c27bf73 100644
--- a/sc/source/core/tool/queryparam.cxx
+++ b/sc/source/core/tool/queryparam.cxx
@@ -24,7 +24,6 @@
#include <svl/sharedstringpool.hxx>
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <osl/diagnose.h>
#include <algorithm>
diff --git a/sc/source/core/tool/rangeseq.cxx b/sc/source/core/tool/rangeseq.cxx
index 2a7075132a63..978f75b4475a 100644
--- a/sc/source/core/tool/rangeseq.cxx
+++ b/sc/source/core/tool/rangeseq.cxx
@@ -18,7 +18,6 @@
*/
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <rtl/math.hxx>
#include <o3tl/float_int_conversion.hxx>
#include <osl/diagnose.h>
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index 7cebca6b2728..cb04dd31570e 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -39,7 +39,7 @@
#include <limits>
#include <mdds/multi_type_matrix.hpp>
-#include <mdds/multi_type_vector_types.hpp>
+#include <mdds/multi_type_vector/types.hpp>
#if DEBUG_MATRIX
#include <iostream>
diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx
index ed222fdb5852..8dc8e49d7506 100644
--- a/sc/source/filter/dif/difimp.cxx
+++ b/sc/source/filter/dif/difimp.cxx
@@ -18,7 +18,6 @@
*/
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <tools/stream.hxx>
#include <osl/diagnose.h>
#include <dif.hxx>
diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx
index 570167b8014b..b175445bc388 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -23,7 +23,6 @@
#include <filter/msfilter/countryid.hxx>
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <sal/log.hxx>
#include <sax/fastattribs.hxx>
diff --git a/sc/source/filter/excel/fontbuff.cxx b/sc/source/filter/excel/fontbuff.cxx
index 2a23cee21f61..40e04fcb06ea 100644
--- a/sc/source/filter/excel/fontbuff.cxx
+++ b/sc/source/filter/excel/fontbuff.cxx
@@ -26,8 +26,6 @@
#include <osl/diagnose.h>
#include <svl/itemset.hxx>
-#include <global.hxx>
-
void LotusFontBuffer::Fill( const sal_uInt8 nIndex, SfxItemSet& rItemSet )
{
sal_uInt8 nIntIndex = nIndex & 0x07;
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index c23f8f164309..5bfc7a5193bb 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -28,7 +28,6 @@
#include <sfx2/docfile.hxx>
#include <svx/svxids.hrc>
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <unotools/configmgr.hxx>
#include <sal/log.hxx>
diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index 0460ca371c1b..dd82fe980dc9 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -54,7 +54,6 @@
#include <com/sun/star/chart2/TickmarkStyle.hpp>
#include <tools/gen.hxx>
-#include <vcl/outdev.hxx>
#include <filter/msfilter/escherex.hxx>
#include <document.hxx>
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index a109f7b9c6db..d166b172a974 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -20,7 +20,6 @@
#include <xeescher.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/form/FormComponentType.hpp>
#include <com/sun/star/awt/VisualEffect.hpp>
#include <com/sun/star/awt/ScrollBarOrientation.hpp>
@@ -57,7 +56,6 @@
#include <userdat.hxx>
#include <drwlayer.hxx>
#include <svl/itemset.hxx>
-#include <svx/unoapi.hxx>
#include <svx/sdtaitm.hxx>
#include <document.hxx>
#include <svx/xfillit0.hxx>
diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx
index e4e3ec402e89..9b318ff3726b 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -34,7 +34,6 @@
#include <xltools.hxx>
#include <o3tl/safeint.hxx>
#include <sal/log.hxx>
-#include <basegfx/numeric/ftools.hxx>
using namespace ::formula;
diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx
index b0ac71643674..3bb35d301934 100644
--- a/sc/source/filter/excel/xeroot.cxx
+++ b/sc/source/filter/excel/xeroot.cxx
@@ -23,7 +23,6 @@
#include <sfx2/docfile.hxx>
#include <sfx2/frame.hxx>
#include <sfx2/sfxsids.hrc>
-#include <unotools/saveopt.hxx>
#include <svl/itemset.hxx>
#include <svl/stritem.hxx>
#include <xecontent.hxx>
@@ -47,7 +46,6 @@
#include <formulabase.hxx>
#include <com/sun/star/sheet/FormulaOpCodeMapEntry.hpp>
-#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
using namespace ::com::sun::star;
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index a65cd90c20d4..74c0f9514831 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -23,6 +23,7 @@
#include <filter/msfilter/util.hxx>
#include <o3tl/safeint.hxx>
+#include <osl/diagnose.h>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/random.h>
@@ -40,7 +41,8 @@
#include <xlstring.hxx>
#include <xltools.hxx>
#include <xeroot.hxx>
-#include <xcl97rec.hxx>
+#include <xestring.hxx>
+#include <xlstyle.hxx>
#include <rangelst.hxx>
#include <compiler.hxx>
#include <formulacell.hxx>
@@ -58,6 +60,7 @@
#include <oox/token/tokens.hxx>
#include <oox/token/relationship.hxx>
+#include <oox/export/drawingml.hxx>
#include <oox/export/utils.hxx>
#include <formula/grammar.hxx>
#include <oox/ole/vbaexport.hxx>
diff --git a/sc/source/filter/excel/xlpage.cxx b/sc/source/filter/excel/xlpage.cxx
index 06da2e5e026e..937aa9427f31 100644
--- a/sc/source/filter/excel/xlpage.cxx
+++ b/sc/source/filter/excel/xlpage.cxx
@@ -23,8 +23,6 @@
#include <o3tl/unit_conversion.hxx>
#include <sal/macros.h>
#include <editeng/brushitem.hxx>
-#include <global.hxx>
-#include <xlconst.hxx>
namespace{
diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx
index 3c6989af81fd..c08fd2beea8f 100644
--- a/sc/source/filter/excel/xltools.cxx
+++ b/sc/source/filter/excel/xltools.cxx
@@ -29,7 +29,6 @@
#include <unotools/fontdefs.hxx>
#include <filter/msfilter/msvbahelper.hxx>
#include <xestream.hxx>
-#include <global.hxx>
#include <formula/errorcodes.hxx>
#include <globstr.hrc>
#include <scresid.hxx>
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index e3dfffac0c0c..dc1c8eed1388 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -24,7 +24,6 @@
#include <scitems.hxx>
-#include <svtools/htmlcfg.hxx>
#include <editeng/colritem.hxx>
#include <editeng/brushitem.hxx>
#include <editeng/editeng.hxx>
diff --git a/sc/source/filter/inc/excdefs.hxx b/sc/source/filter/inc/excdefs.hxx
index fc0c891e2c08..149993e1ee6e 100644
--- a/sc/source/filter/inc/excdefs.hxx
+++ b/sc/source/filter/inc/excdefs.hxx
@@ -20,6 +20,7 @@
#pragma once
#include <sal/types.h>
+#include <rtl/ustring.hxx>
// (0x009B, 0x009D, 0x009E) AUTOFILTER ========================================
diff --git a/sc/source/filter/inc/sheetdatabuffer.hxx b/sc/source/filter/inc/sheetdatabuffer.hxx
index 17add16e6234..a673f91b66ec 100644
--- a/sc/source/filter/inc/sheetdatabuffer.hxx
+++ b/sc/source/filter/inc/sheetdatabuffer.hxx
@@ -21,7 +21,6 @@
#include <vector>
#include <map>
-#include <set>
#include <o3tl/sorted_vector.hxx>
#include "richstring.hxx"
diff --git a/sc/source/filter/inc/xlcontent.hxx b/sc/source/filter/inc/xlcontent.hxx
index 61c457694068..4feb47d8435f 100644
--- a/sc/source/filter/inc/xlcontent.hxx
+++ b/sc/source/filter/inc/xlcontent.hxx
@@ -20,6 +20,7 @@
#pragma once
#include <sal/types.h>
+#include <rtl/ustring.hxx>
// Constants ==================================================================
diff --git a/sc/source/filter/inc/xlstring.hxx b/sc/source/filter/inc/xlstring.hxx
index 64e5f265ffc8..b346953bacf1 100644
--- a/sc/source/filter/inc/xlstring.hxx
+++ b/sc/source/filter/inc/xlstring.hxx
@@ -20,6 +20,7 @@
#pragma once
#include <vector>
+#include <sal/types.h>
#include <o3tl/typed_flags_set.hxx>
// Constants and enumerations =================================================
diff --git a/sc/source/filter/oox/autofilterbuffer.cxx b/sc/source/filter/oox/autofilterbuffer.cxx
index 6bffe8e53b25..1f1c920fc3f1 100644
--- a/sc/source/filter/oox/autofilterbuffer.cxx
+++ b/sc/source/filter/oox/autofilterbuffer.cxx
@@ -30,12 +30,10 @@
#include <com/sun/star/table/CellAddress.hpp>
#include <comphelper/sequence.hxx>
-#include <editeng/colritem.hxx>
#include <editeng/brushitem.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
#include <oox/helper/attributelist.hxx>
-#include <oox/helper/containerhelper.hxx>
#include <oox/helper/propertyset.hxx>
#include <oox/helper/binaryinputstream.hxx>
#include <oox/token/namespaces.hxx>
diff --git a/sc/source/filter/oox/biffhelper.cxx b/sc/source/filter/oox/biffhelper.cxx
index dadfd2014bea..20a088fc73fc 100644
--- a/sc/source/filter/oox/biffhelper.cxx
+++ b/sc/source/filter/oox/biffhelper.cxx
@@ -19,7 +19,6 @@
#include <biffhelper.hxx>
-#include <rtl/math.hxx>
#include <osl/diagnose.h>
#include <oox/helper/binaryinputstream.hxx>
diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx
index fa895f1dcb1a..5ce7b2d21ce5 100644
--- a/sc/source/filter/oox/drawingfragment.cxx
+++ b/sc/source/filter/oox/drawingfragment.cxx
@@ -22,7 +22,6 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <comphelper/propertyvalue.hxx>
-#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
@@ -35,7 +34,6 @@
#include <rtl/strbuf.hxx>
#include <svx/svdobj.hxx>
#include <drwlayer.hxx>
-#include <userdat.hxx>
#include <oox/core/filterbase.hxx>
#include <oox/drawingml/connectorshapecontext.hxx>
#include <oox/drawingml/graphicshapecontext.hxx>
@@ -50,7 +48,6 @@
#include <formulaparser.hxx>
#include <stylesbuffer.hxx>
#include <themebuffer.hxx>
-#include <unitconverter.hxx>
#include <worksheetbuffer.hxx>
namespace oox::xls {
diff --git a/sc/source/filter/oox/externallinkbuffer.cxx b/sc/source/filter/oox/externallinkbuffer.cxx
index 9c09580f096e..595d6e3dd766 100644
--- a/sc/source/filter/oox/externallinkbuffer.cxx
+++ b/sc/source/filter/oox/externallinkbuffer.cxx
@@ -19,8 +19,8 @@
#include <externallinkbuffer.hxx>
#include <externalrefmgr.hxx>
+#include <compiler.hxx>
#include <tokenarray.hxx>
-#include <tokenstringcontext.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/sheet/DDELinkInfo.hpp>
diff --git a/sc/source/filter/oox/pagesettings.cxx b/sc/source/filter/oox/pagesettings.cxx
index 984bc0c50ebd..8946ea2d4d3d 100644
--- a/sc/source/filter/oox/pagesettings.cxx
+++ b/sc/source/filter/oox/pagesettings.cxx
@@ -46,7 +46,6 @@
#include <oox/core/filterbase.hxx>
#include <oox/core/relations.hxx>
#include <stylesbuffer.hxx>
-#include <unitconverter.hxx>
#include <document.hxx>
#include <biffhelper.hxx>
#include <filter/msfilter/util.hxx>
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index ad17e1db9f4e..962de02ae409 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -80,9 +80,7 @@
#include <attrib.hxx>
#include <globstr.hrc>
#include <scresid.hxx>
-#include <xlconst.hxx>
#include <documentimport.hxx>
-#include <numformat.hxx>
#include <patattr.hxx>
#include <stlsheet.hxx>
#include <biffhelper.hxx>
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index f2f4c2005d98..3de0547393ca 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -75,7 +75,6 @@
#include <editeng/eeitem.hxx>
#include <editeng/editobj.hxx>
#include <editeng/flditem.hxx>
-#include <tools/UnitConversion.hxx>
namespace oox::xls {
diff --git a/sc/source/filter/qpro/qprostyle.cxx b/sc/source/filter/qpro/qprostyle.cxx
index 2303d29e53ba..a23187c477b2 100644
--- a/sc/source/filter/qpro/qprostyle.cxx
+++ b/sc/source/filter/qpro/qprostyle.cxx
@@ -31,7 +31,6 @@
#include <editeng/justifyitem.hxx>
#include <attrib.hxx>
-#include <global.hxx>
#include <docpool.hxx>
#include <patattr.hxx>
#include <document.hxx>
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index 59b491d26c57..2768d054b9a4 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -27,7 +27,6 @@
#include <o3tl/unit_conversion.hxx>
#include <svx/svdograf.hxx>
#include <svx/svdpage.hxx>
-#include <svtools/htmlcfg.hxx>
#include <sfx2/sfxhtml.hxx>
#include <svl/numformat.hxx>
#include <svl/zforlist.hxx>
diff --git a/sc/source/filter/rtf/rtfparse.cxx b/sc/source/filter/rtf/rtfparse.cxx
index 6820db9d4dc2..b2d2b8c2521f 100644
--- a/sc/source/filter/rtf/rtfparse.cxx
+++ b/sc/source/filter/rtf/rtfparse.cxx
@@ -24,7 +24,6 @@
#include <editeng/editids.hrc>
#include <editeng/fhgtitem.hxx>
#include <editeng/svxrtf.hxx>
-#include <vcl/outdev.hxx>
#include <svtools/rtftoken.h>
#include <osl/diagnose.h>
#include <svl/itempool.hxx>
diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx
index db0c7159000a..d1bb478429c8 100644
--- a/sc/source/filter/xcl97/xcl97esc.cxx
+++ b/sc/source/filter/xcl97/xcl97esc.cxx
@@ -29,7 +29,6 @@
#include <svx/svdotext.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdoole2.hxx>
-#include <svx/unoapi.hxx>
#include <unotools/tempfile.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <svx/sdasitm.hxx>
diff --git a/sc/source/filter/xml/XMLCellRangeSourceContext.cxx b/sc/source/filter/xml/XMLCellRangeSourceContext.cxx
index 21774de12bb0..6453f81a5ddf 100644
--- a/sc/source/filter/xml/XMLCellRangeSourceContext.cxx
+++ b/sc/source/filter/xml/XMLCellRangeSourceContext.cxx
@@ -23,7 +23,7 @@
#include "xmlimprt.hxx"
#include <xmloff/xmlnamespace.hxx>
-#include <xmloff/xmltkmap.hxx>
+#include <xmloff/xmltoken.hxx>
using namespace ::com::sun::star;
using namespace xmloff::token;
diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
index 51b35a2d70a4..f4a27c152a5a 100644
--- a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
+++ b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
@@ -25,11 +25,10 @@
#include <userdat.hxx>
#include <docuno.hxx>
#include <sheetdata.hxx>
-#include <xmloff/namespacemap.hxx>
+#include <comphelper/servicehelper.hxx>
#include <xmloff/xmlnamespace.hxx>
#include <xmloff/xmluconv.hxx>
#include <xmloff/xmltoken.hxx>
-#include <svx/unoshape.hxx>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
diff --git a/sc/source/filter/xml/XMLTableShapesContext.hxx b/sc/source/filter/xml/XMLTableShapesContext.hxx
index 814ddaea67af..649fef106da4 100644
--- a/sc/source/filter/xml/XMLTableShapesContext.hxx
+++ b/sc/source/filter/xml/XMLTableShapesContext.hxx
@@ -19,7 +19,6 @@
#pragma once
-#include <xmloff/xmlictxt.hxx>
#include "importcontext.hxx"
class ScXMLImport;
diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.cxx b/sc/source/filter/xml/XMLTrackedChangesContext.cxx
index 9ffa419965ad..5ce9452ae0cb 100644
--- a/sc/source/filter/xml/XMLTrackedChangesContext.cxx
+++ b/sc/source/filter/xml/XMLTrackedChangesContext.cxx
@@ -28,7 +28,6 @@
#include <document.hxx>
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlnamespace.hxx>
-#include <xmloff/namespacemap.hxx>
#include <xmloff/xmluconv.hxx>
#include <sax/tools/converter.hxx>
#include <svl/sharedstringpool.hxx>
diff --git a/sc/source/filter/xml/celltextparacontext.cxx b/sc/source/filter/xml/celltextparacontext.cxx
index e2668dea28a5..5bbe5f20dea2 100644
--- a/sc/source/filter/xml/celltextparacontext.cxx
+++ b/sc/source/filter/xml/celltextparacontext.cxx
@@ -13,7 +13,7 @@
#include <comphelper/string.hxx>
#include <xmloff/xmlnamespace.hxx>
-#include <xmloff/xmltkmap.hxx>
+#include <xmloff/xmltoken.hxx>
using namespace com::sun::star;
using namespace xmloff::token;
diff --git a/sc/source/filter/xml/xmlannoi.cxx b/sc/source/filter/xml/xmlannoi.cxx
index 5ce2980fbeaf..db12eb148464 100644
--- a/sc/source/filter/xml/xmlannoi.cxx
+++ b/sc/source/filter/xml/xmlannoi.cxx
@@ -22,8 +22,6 @@
#include "xmlconti.hxx"
#include "XMLTableShapeImportHelper.hxx"
-#include <xmloff/xmltkmap.hxx>
-#include <xmloff/namespacemap.hxx>
#include <xmloff/xmlnamespace.hxx>
#include <xmloff/xmltoken.hxx>
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index e4dbc07a9e6b..55116658215d 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -51,7 +51,6 @@
#include <externalrefmgr.hxx>
#include <xmloff/maptype.hxx>
-#include <xmloff/xmltkmap.hxx>
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlprmap.hxx>
#include <xmloff/xmluconv.hxx>
@@ -82,7 +81,6 @@
#include <editeng/escapementitem.hxx>
#include <editeng/emphasismarkitem.hxx>
#include <editeng/langitem.hxx>
-#include <svx/unoapi.hxx>
#include <svl/sharedstringpool.hxx>
#include <sax/tools/converter.hxx>
#include <sax/fastattribs.hxx>
diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx
index 996032f03498..77280be47e21 100644
--- a/sc/source/filter/xml/xmlcondformat.cxx
+++ b/sc/source/filter/xml/xmlcondformat.cxx
@@ -11,8 +11,8 @@
#include "xmlcondformat.hxx"
#include "xmlimprt.hxx"
#include <xmloff/xmlnamespace.hxx>
-#include <xmloff/xmltkmap.hxx>
#include <xmloff/xmlictxt.hxx>
+#include <xmloff/xmltoken.hxx>
#include <sal/log.hxx>
#include <compiler.hxx>
diff --git a/sc/source/filter/xml/xmlconti.cxx b/sc/source/filter/xml/xmlconti.cxx
index 532354f28bf2..18adc82ffd70 100644
--- a/sc/source/filter/xml/xmlconti.cxx
+++ b/sc/source/filter/xml/xmlconti.cxx
@@ -20,7 +20,6 @@
#include "xmlconti.hxx"
#include "xmlimprt.hxx"
-#include <xmloff/namespacemap.hxx>
#include <xmloff/xmlnamespace.hxx>
#include <xmloff/xmltoken.hxx>
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 85ce9ec601e9..ab1ba651823d 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -112,16 +112,12 @@
#include <rtl/math.hxx>
#include <svl/numformat.hxx>
#include <svl/zforlist.hxx>
-#include <svx/unoshape.hxx>
#include <comphelper/base64.hxx>
#include <comphelper/extract.hxx>
#include <svx/svdoashp.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdocapt.hxx>
#include <vcl/svapp.hxx>
-#include <svx/unoapi.hxx>
-#include <basegfx/polygon/b2dpolypolygon.hxx>
-#include <basegfx/matrix/b2dhommatrix.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 093e19ba319a..41078e47e6be 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -22,11 +22,9 @@
#include <osl/diagnose.h>
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <xmloff/namespacemap.hxx>
#include <xmloff/xmlnamespace.hxx>
-#include <xmloff/xmltkmap.hxx>
#include <xmloff/xmlictxt.hxx>
#include <xmloff/xmlmetai.hxx>
#include <sfx2/objsh.hxx>
diff --git a/sc/source/filter/xml/xmlnexpi.cxx b/sc/source/filter/xml/xmlnexpi.cxx
index 0f07ea5defa6..cf2878032be3 100644
--- a/sc/source/filter/xml/xmlnexpi.cxx
+++ b/sc/source/filter/xml/xmlnexpi.cxx
@@ -22,7 +22,7 @@
#include <document.hxx>
#include <xmloff/xmlnamespace.hxx>
-#include <xmloff/xmltkmap.hxx>
+#include <xmloff/xmltoken.hxx>
using namespace com::sun::star;
using namespace xmloff::token;
diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx
index 8016264bc72d..0120501b46ec 100644
--- a/sc/source/filter/xml/xmlsubti.cxx
+++ b/sc/source/filter/xml/xmlsubti.cxx
@@ -38,8 +38,6 @@
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
-#include <memory>
-
using namespace com::sun::star;
ScXMLTabProtectionData::ScXMLTabProtectionData() :
diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx
index ddec732b01c0..dd1baf299d86 100644
--- a/sc/source/filter/xml/xmltabi.cxx
+++ b/sc/source/filter/xml/xmltabi.cxx
@@ -35,7 +35,6 @@
#include <sheetdata.hxx>
#include "xmlcondformat.hxx"
-#include <xmloff/xmltkmap.hxx>
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlnamespace.hxx>
#include <xmloff/XMLEventsImportContext.hxx>
diff --git a/sc/source/filter/xml/xmltabi.hxx b/sc/source/filter/xml/xmltabi.hxx
index 84548d6be66f..524a4e87a6f7 100644
--- a/sc/source/filter/xml/xmltabi.hxx
+++ b/sc/source/filter/xml/xmltabi.hxx
@@ -21,7 +21,6 @@
#include <externalrefmgr.hxx>
#include "importcontext.hxx"
-#include <xmloff/xmlictxt.hxx>
#include <memory>
namespace sax_fastparser { class FastAttributeList; }
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 557fe1d3ae82..1d19f18be4b3 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -59,7 +59,6 @@
#include <xmloff/shapeexport.hxx>
#include <svx/xmleohlp.hxx>
#include <sal/log.hxx>
-#include <unotools/saveopt.hxx>
#include <tools/diagnose_ex.h>
#include <document.hxx>
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 913a2984421f..c619bc4c44c2 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -55,7 +55,6 @@
#include <comphelper/sequence.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/docfile.hxx>
-#include <svx/unoshape.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
#include <toolkit/helper/convert.hxx>
#include <vcl/svapp.hxx>
@@ -69,7 +68,6 @@
#include <algorithm>
-#include <svx/unoapi.hxx>
#include <scmod.hxx>
#ifdef indices
diff --git a/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx b/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx
index 24b455e30408..c181656fe14b 100644
--- a/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx
+++ b/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx
@@ -21,7 +21,6 @@
#include <svx/svdmodel.hxx>
#include <svx/unomod.hxx>
#include <svx/svdobj.hxx>
-#include <tools/diagnose_ex.h>
using namespace ::com::sun::star;
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index c2810113f9c8..aae96bbf281d 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -44,7 +44,6 @@
#include <svl/stritem.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weldutils.hxx>
-#include <vcl/virdev.hxx>
#include <unotools/charclass.hxx>
#include <inputwin.hxx>
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index a941076cfef7..a3ecb34b5f7d 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -33,12 +33,9 @@
#include <comphelper/lok.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <tools/json_writer.hxx>
-#include <sfx2/viewsh.hxx>
#include <svl/numformat.hxx>
-#include <vcl/jsdialog/executor.hxx>
#include <document.hxx>
-#include <docsh.hxx>
#include <viewdata.hxx>
using namespace com::sun::star;
diff --git a/sc/source/ui/dataprovider/sqldataprovider.cxx b/sc/source/ui/dataprovider/sqldataprovider.cxx
index c8ffd0d7aa29..a7d27dfa9426 100644
--- a/sc/source/ui/dataprovider/sqldataprovider.cxx
+++ b/sc/source/ui/dataprovider/sqldataprovider.cxx
@@ -20,7 +20,6 @@
#include <datamapper.hxx>
#include <vcl/svapp.hxx>
#include <comphelper/processfactory.hxx>
-#include <osl/diagnose.h>
#include <tools/diagnose_ex.h>
using namespace css;
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index aa6acd6ba9b2..6752fcb78a3d 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -46,6 +46,7 @@
#include <editeng/wghtitem.hxx>
#include <editeng/postitem.hxx>
#include <editeng/langitem.hxx>
+#include <svl/itempool.hxx>
#include <svl/itemset.hxx>
#include <editutil.hxx>
// *** edit engine ***
diff --git a/sc/source/ui/dbgui/dapidata.cxx b/sc/source/ui/dbgui/dapidata.cxx
index 43b8f296e072..198d82783df6 100644
--- a/sc/source/ui/dbgui/dapidata.cxx
+++ b/sc/source/ui/dbgui/dapidata.cxx
@@ -20,7 +20,6 @@
#undef SC_DLLIMPLEMENTATION
#include <comphelper/processfactory.hxx>
-#include <osl/diagnose.h>
#include <tools/diagnose_ex.h>
#include <com/sun/star/sheet/DataImportMode.hpp>
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index 6c9ba66db23a..ea948fb827b9 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -34,13 +34,13 @@
#include <strings.hrc>
#include <filtdlg.hxx>
+#include <svx/colorwindow.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <vcl/virdev.hxx>
#include <vcl/weld.hxx>
#include <svl/numformat.hxx>
#include <svl/sharedstringpool.hxx>
-#include <toolkit/helper/vclunohelper.hxx>
#include <limits>
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 8995aceafdff..d30d4b89f236 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -29,6 +29,7 @@
#include <comphelper/propertyvalue.hxx>
#include <formula/errorcodes.hxx>
#include <vcl/stdtext.hxx>
+#include <vcl/syswin.hxx>
#include <vcl/svapp.hxx>
#include <vcl/virdev.hxx>
#include <vcl/weld.hxx>
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index a3a0a9abb20a..be66c6625401 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -43,7 +43,6 @@
#include <tabvwsh.hxx>
#include <document.hxx>
#include <drwlayer.hxx>
-#include <userdat.hxx>
#include <drtxtob.hxx>
#include <gridwin.hxx>
#include <svx/svdoole2.hxx>
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index d7c3ee434e0d..82559462c040 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -44,7 +44,6 @@
#include <docsh.hxx>
#include <undotab.hxx>
#include <drwlayer.hxx>
-#include <userdat.hxx>
#include <drtxtob.hxx>
#include <memory>
diff --git a/sc/source/ui/drawfunc/fuconcustomshape.cxx b/sc/source/ui/drawfunc/fuconcustomshape.cxx
index ed4522fb85e8..ec2e7f0836b7 100644
--- a/sc/source/ui/drawfunc/fuconcustomshape.cxx
+++ b/sc/source/ui/drawfunc/fuconcustomshape.cxx
@@ -33,8 +33,6 @@
#include <drawview.hxx>
#include <editeng/adjustitem.hxx>
-#include <math.h>
-
using namespace com::sun::star;
FuConstCustomShape::FuConstCustomShape(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* pViewP, SdrModel* pDoc, const SfxRequest& rReq )
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index df7a0c37d474..62cd366da38f 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -51,7 +51,6 @@
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
-#include <com/sun/star/ui/dialogs/XDialogClosedListener.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
diff --git a/sc/source/ui/drawfunc/mediash.cxx b/sc/source/ui/drawfunc/mediash.cxx
index b203cfeb7fd4..f5b3350ba6a6 100644
--- a/sc/source/ui/drawfunc/mediash.cxx
+++ b/sc/source/ui/drawfunc/mediash.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <memory>
#include <sfx2/objface.hxx>
#include <vcl/EnumContext.hxx>
#include <svx/MediaShellHelpers.hxx>
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 883b6a063baf..031b6b23f4a3 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -23,7 +23,6 @@
#include <sfx2/docfile.hxx>
#include <sfx2/objsh.hxx>
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <svl/stritem.hxx>
#include <sfx2/viewfrm.hxx>
#include <tools/urlobj.hxx>
diff --git a/sc/source/ui/inc/FilterListBox.hxx b/sc/source/ui/inc/FilterListBox.hxx
index f29641165235..a17a1694a89e 100644
--- a/sc/source/ui/inc/FilterListBox.hxx
+++ b/sc/source/ui/inc/FilterListBox.hxx
@@ -21,9 +21,11 @@
#include <types.hxx>
+#include <tools/solar.h>
#include <vcl/weld.hxx>
class ScGridWindow;
+struct ImplSVEvent;
enum class ScFilterBoxMode
{
diff --git a/sc/source/ui/inc/areasave.hxx b/sc/source/ui/inc/areasave.hxx
index b4392b3ecbeb..0b317c6eed1f 100644
--- a/sc/source/ui/inc/areasave.hxx
+++ b/sc/source/ui/inc/areasave.hxx
@@ -20,7 +20,6 @@
#pragma once
#include <address.hxx>
-#include <tools/solar.h>
#include <memory>
#include <vector>
diff --git a/sc/source/ui/inc/cellsh.hxx b/sc/source/ui/inc/cellsh.hxx
index e3f75c036ebd..023d5160848a 100644
--- a/sc/source/ui/inc/cellsh.hxx
+++ b/sc/source/ui/inc/cellsh.hxx
@@ -29,7 +29,6 @@
#include <sot/formats.hxx>
#include <vcl/vclptr.hxx>
#include <vcl/window.hxx>
-#include <tools/solar.h>
class SvxClipboardFormatItem;
class TransferableDataHelper;
diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx
index 31d5a5b97fde..55525bac96f0 100644
--- a/sc/source/ui/inc/checklistmenu.hxx
+++ b/sc/source/ui/inc/checklistmenu.hxx
@@ -9,7 +9,6 @@
#pragma once
-#include <vcl/dockwin.hxx>
#include <vcl/timer.hxx>
#include <vcl/virdev.hxx>
#include <vcl/weld.hxx>
@@ -22,6 +21,7 @@
class ScCheckListMenuControl;
class ScViewData;
struct ScCheckListMember;
+struct ImplSVEvent;
struct ScCheckListMember
{
diff --git a/sc/source/ui/inc/filtdlg.hxx b/sc/source/ui/inc/filtdlg.hxx
index ca43ed8bb01f..cac9bc71ee26 100644
--- a/sc/source/ui/inc/filtdlg.hxx
+++ b/sc/source/ui/inc/filtdlg.hxx
@@ -25,8 +25,6 @@
#include <filterentries.hxx>
#include <queryentry.hxx>
-#include <svx/colorbox.hxx>
-
#include <memory>
#include <deque>
#include <vector>
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 0aa1d55272c9..5acb900dca6f 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -26,6 +26,7 @@
#include "checklistmenu.hxx"
#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
#include <o3tl/deleter.hxx>
+#include <vcl/window.hxx>
#include <memory>
#include <vector>
diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx
index 031a0ca3c571..aafeb00c9a0c 100644
--- a/sc/source/ui/inc/impex.hxx
+++ b/sc/source/ui/inc/impex.hxx
@@ -24,6 +24,8 @@
#include <address.hxx>
#include <tools/stream.hxx>
+#include <com/sun/star/uno/Any.hxx>
+
class ScDocShell;
class ScDocument;
class ScAsciiOptions;
diff --git a/sc/source/ui/inc/linkarea.hxx b/sc/source/ui/inc/linkarea.hxx
index 1214e5a8f640..54829050f984 100644
--- a/sc/source/ui/inc/linkarea.hxx
+++ b/sc/source/ui/inc/linkarea.hxx
@@ -20,7 +20,6 @@
#pragma once
#include <sfx2/objsh.hxx>
-#include <tools/solar.h>
#include <vcl/weld.hxx>
namespace sfx2 { class DocumentInserter; }
diff --git a/sc/source/ui/inc/tphfedit.hxx b/sc/source/ui/inc/tphfedit.hxx
index 24ea708cf7c8..4247f2ad9807 100644
--- a/sc/source/ui/inc/tphfedit.hxx
+++ b/sc/source/ui/inc/tphfedit.hxx
@@ -21,7 +21,6 @@
#include <scdllapi.h>
#include <editutil.hxx>
-#include <cppuhelper/weakref.hxx>
#include <svx/weldeditview.hxx>
#include <editeng/svxenum.hxx>
#include <unotools/weakref.hxx>
diff --git a/sc/source/ui/inc/tpsubt.hxx b/sc/source/ui/inc/tpsubt.hxx
index ef1c69ea010f..76846f194bc4 100644
--- a/sc/source/ui/inc/tpsubt.hxx
+++ b/sc/source/ui/inc/tpsubt.hxx
@@ -21,7 +21,6 @@
#include <sfx2/tabdlg.hxx>
#include <global.hxx>
-#include <sheetlimits.hxx>
class ScViewData;
class ScDocument;
diff --git a/sc/source/ui/inc/uiobject.hxx b/sc/source/ui/inc/uiobject.hxx
index 01ebdcdc6e89..4545c50e79e2 100644
--- a/sc/source/ui/inc/uiobject.hxx
+++ b/sc/source/ui/inc/uiobject.hxx
@@ -8,7 +8,6 @@
*/
#include "gridwin.hxx"
-#include "navipi.hxx"
#include <memory>
#include <vcl/uitest/uiobject.hxx>
diff --git a/sc/source/ui/inc/undostyl.hxx b/sc/source/ui/inc/undostyl.hxx
index a4b3a7f44f76..6c169c43e32b 100644
--- a/sc/source/ui/inc/undostyl.hxx
+++ b/sc/source/ui/inc/undostyl.hxx
@@ -19,7 +19,6 @@
#pragma once
-#include <memory>
#include <optional>
#include <svl/style.hxx>
#include <svl/itemset.hxx>
diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx
index 598a9b29e4c1..93ca94034434 100644
--- a/sc/source/ui/miscdlgs/autofmt.cxx
+++ b/sc/source/ui/miscdlgs/autofmt.cxx
@@ -33,7 +33,6 @@
#include <o3tl/unit_conversion.hxx>
#include <osl/diagnose.h>
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <svtools/scriptedtext.hxx>
#include <svx/framelink.hxx>
#include <vcl/settings.hxx>
diff --git a/sc/source/ui/miscdlgs/filldlg.cxx b/sc/source/ui/miscdlgs/filldlg.cxx
index 2d1f0fd56ddb..c72201d26fb5 100644
--- a/sc/source/ui/miscdlgs/filldlg.cxx
+++ b/sc/source/ui/miscdlgs/filldlg.cxx
@@ -20,7 +20,6 @@
#undef SC_DLLIMPLEMENTATION
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx
index 25dbd47d13e9..947b983eccf2 100644
--- a/sc/source/ui/miscdlgs/instbdlg.cxx
+++ b/sc/source/ui/miscdlgs/instbdlg.cxx
@@ -27,7 +27,6 @@
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
-#include <global.hxx>
#include <docsh.hxx>
#include <viewdata.hxx>
#include <globstr.hrc>
diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx
index 195b64156e08..0294752a5b1e 100644
--- a/sc/source/ui/miscdlgs/linkarea.cxx
+++ b/sc/source/ui/miscdlgs/linkarea.cxx
@@ -29,7 +29,6 @@
#include <svtools/sfxecode.hxx>
#include <linkarea.hxx>
-#include <rangeutl.hxx>
#include <docsh.hxx>
#include <tablink.hxx>
#include <scresid.hxx>
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index 0905e67f91af..f0f5eb30c5d7 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -20,7 +20,6 @@
#include <rangelst.hxx>
#include <sfx2/bindings.hxx>
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <vcl/commandinfoprovider.hxx>
#include <vcl/weld.hxx>
#include <vcl/svapp.hxx>
diff --git a/sc/source/ui/miscdlgs/solvrdlg.cxx b/sc/source/ui/miscdlgs/solvrdlg.cxx
index c55e81e86856..f7cd8e27b695 100644
--- a/sc/source/ui/miscdlgs/solvrdlg.cxx
+++ b/sc/source/ui/miscdlgs/solvrdlg.cxx
@@ -20,7 +20,6 @@
#include <scitems.hxx>
#include <sfx2/dispatch.hxx>
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index ca3956ad8cd4..7d42d988140b 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -24,7 +24,6 @@
#include <sfx2/navigat.hxx>
#include <svl/stritem.hxx>
#include <unotools/charclass.hxx>
-#include <uiobject.hxx>
#include <viewdata.hxx>
#include <tabvwsh.hxx>
diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx
index 341fd764fe3d..3bbc6309ccd5 100644
--- a/sc/source/ui/navipi/scenwnd.cxx
+++ b/sc/source/ui/navipi/scenwnd.cxx
@@ -31,7 +31,6 @@
#include <globstr.hrc>
#include <scresid.hxx>
#include <helpids.h>
-#include <global.hxx>
// class ScScenarioWindow ------------------------------------------------
diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx
index a7cc06088376..4974dcb3a519 100644
--- a/sc/source/ui/optdlg/tpcalc.cxx
+++ b/sc/source/ui/optdlg/tpcalc.cxx
@@ -22,7 +22,6 @@
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <globstr.hrc>
#include <scresid.hxx>
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index 8c3cf35c9038..55351cdcf8fc 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -25,7 +25,6 @@
#include <vcl/weld.hxx>
#include <osl/diagnose.h>
-#include <global.hxx>
#include <document.hxx>
#include <tabvwsh.hxx>
#include <viewdata.hxx>
diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx
index 80a5db3027a9..ddec413e9dc9 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ b/sc/source/ui/pagedlg/scuitphfedit.cxx
@@ -31,7 +31,6 @@
#include <unotools/useroptions.hxx>
#include <editutil.hxx>
-#include <global.hxx>
#include <attrib.hxx>
#include <patattr.hxx>
diff --git a/sc/source/ui/uitest/uiobject.cxx b/sc/source/ui/uitest/uiobject.cxx
index d1f3592cecf3..58722b50e831 100644
--- a/sc/source/ui/uitest/uiobject.cxx
+++ b/sc/source/ui/uitest/uiobject.cxx
@@ -18,7 +18,6 @@
#include <dbfunc.hxx>
#include <tabvwsh.hxx>
#include <drwlayer.hxx>
-#include <navipi.hxx>
#include <sfx2/sidebar/Sidebar.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/dispatch.hxx>
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 9ebad7062809..27a3dc4c7917 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -21,7 +21,6 @@
#include <svl/hint.hxx>
#include <svl/numformat.hxx>
-#include <svl/zforlist.hxx>
#include <svl/sharedstringpool.hxx>
#include <vcl/svapp.hxx>
#include <unotools/charclass.hxx>
diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx
index c3c555636167..e19324cc37e7 100644
--- a/sc/source/ui/unoobj/defltuno.cxx
+++ b/sc/source/ui/unoobj/defltuno.cxx
@@ -20,7 +20,6 @@
#include <editeng/memberids.h>
#include <svl/hint.hxx>
#include <svl/itemprop.hxx>
-#include <tools/UnitConversion.hxx>
#include <vcl/svapp.hxx>
#include <i18nlangtag/languagetag.hxx>
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 563d34b3c2c2..33f5a7d617fa 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -25,6 +25,7 @@
#include <comphelper/sequence.hxx>
#include <editeng/brushitem.hxx>
#include <editeng/editview.hxx>
+#include <editeng/memberids.h>
#include <editeng/outliner.hxx>
#include <o3tl/any.hxx>
#include <o3tl/safeint.hxx>
@@ -32,7 +33,6 @@
#include <svx/svditer.hxx>
#include <svx/svdpage.hxx>
#include <svx/svxids.hrc>
-#include <svx/unoshape.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <comphelper/propertysequence.hxx>
@@ -52,7 +52,6 @@
#include <tools/multisel.hxx>
#include <tools/UnitConversion.hxx>
#include <toolkit/awt/vclxdevice.hxx>
-#include <unotools/saveopt.hxx>
#include <float.h>
diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index b5a50798b171..e5fc5848e1f0 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -29,7 +29,6 @@
#include <sfx2/docfile.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/fcontnr.hxx>
-#include <tools/solar.h>
using namespace ::com::sun::star;
using utl::MediaDescriptor;
diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx
index d3e1c86747d4..accef3fd990d 100644
--- a/sc/source/ui/unoobj/shapeuno.cxx
+++ b/sc/source/ui/unoobj/shapeuno.cxx
@@ -27,7 +27,6 @@
#include <svx/ImageMapInfo.hxx>
#include <vcl/svapp.hxx>
#include <sfx2/event.hxx>
-#include <svx/unoshape.hxx>
#include <editeng/unofield.hxx>
#include <toolkit/helper/convert.hxx>
#include <cppuhelper/implbase.hxx>
diff --git a/sc/source/ui/unoobj/targuno.cxx b/sc/source/ui/unoobj/targuno.cxx
index 8bf699b09ed3..9d3ca299872b 100644
--- a/sc/source/ui/unoobj/targuno.cxx
+++ b/sc/source/ui/unoobj/targuno.cxx
@@ -19,8 +19,6 @@
#include <sal/config.h>
-#include <string_view>
-
#include <toolkit/helper/vclunohelper.hxx>
#include <svl/itemprop.hxx>
#include <svl/hint.hxx>
diff --git a/sc/source/ui/vba/excelvbahelper.hxx b/sc/source/ui/vba/excelvbahelper.hxx
index 3d3cf42b95aa..0b72481e31ed 100644
--- a/sc/source/ui/vba/excelvbahelper.hxx
+++ b/sc/source/ui/vba/excelvbahelper.hxx
@@ -22,7 +22,6 @@
#include <comphelper/servicehelper.hxx>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <vector>
#include <global.hxx>
diff --git a/sc/source/ui/view/auditsh.cxx b/sc/source/ui/view/auditsh.cxx
index a76267071bd5..1caea374fb71 100644
--- a/sc/source/ui/view/auditsh.cxx
+++ b/sc/source/ui/view/auditsh.cxx
@@ -22,7 +22,6 @@
#include <sfx2/objsh.hxx>
#include <sfx2/request.hxx>
#include <vcl/EnumContext.hxx>
-#include <osl/diagnose.h>
#include <auditsh.hxx>
#include <tabvwsh.hxx>
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index f24c06e9a0d2..b373fd4561bd 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -26,7 +26,6 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/request.hxx>
#include <svl/stritem.hxx>
-#include <tools/UnitConversion.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <globstr.hrc>
diff --git a/sc/source/ui/view/drawutil.cxx b/sc/source/ui/view/drawutil.cxx
index cfc60ff23505..9658fa7ff20b 100644
--- a/sc/source/ui/view/drawutil.cxx
+++ b/sc/source/ui/view/drawutil.cxx
@@ -24,7 +24,6 @@
#include <drawutil.hxx>
#include <document.hxx>
-#include <global.hxx>
#include <viewdata.hxx>
void ScDrawUtil::CalcScale( const ScDocument& rDoc, SCTAB nTab,
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 80cbf4e3728a..ab24d8cd5371 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -51,7 +51,6 @@
#include <sot/formats.hxx>
#include <comphelper/classids.hxx>
-#include <svx/drawitem.hxx>
#include <svx/svdview.hxx>
#include <svx/svdocapt.hxx>
#include <svx/svdpagv.hxx>
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 17c4057e8337..c5e97a2ffdf5 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -79,9 +79,6 @@
#include <vcl/virdev.hxx>
#include <svx/sdrpaintwindow.hxx>
#include <drwlayer.hxx>
-#include <columnspanset.hxx>
-#include <docfunc.hxx>
-#include <printfun.hxx>
static void lcl_LimitRect( tools::Rectangle& rRect, const tools::Rectangle& rVisible )
{
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index 032d84a3c230..c20663ecf775 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -40,7 +40,6 @@
#include <chgtrack.hxx>
#include <chgviset.hxx>
#include <dbfunc.hxx>
-#include <userdat.hxx>
#include <postit.hxx>
#include <global.hxx>
diff --git a/sc/source/ui/view/olinewin.cxx b/sc/source/ui/view/olinewin.cxx
index e4c138055bbe..dcfbccb6c1fa 100644
--- a/sc/source/ui/view/olinewin.cxx
+++ b/sc/source/ui/view/olinewin.cxx
@@ -19,11 +19,10 @@
#include <sal/config.h>
-#include <string_view>
-
#include <vcl/image.hxx>
#include <vcl/taskpanelist.hxx>
#include <vcl/settings.hxx>
+#include <vcl/syswin.hxx>
#include <osl/diagnose.h>
#include <olinewin.hxx>
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index ecadef053c19..5109b710b5fc 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -28,7 +28,6 @@
#include <sfx2/bindings.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/dispatch.hxx>
-#include <svtools/accessibilityoptions.hxx>
#include <svl/itemset.hxx>
#include <tools/multisel.hxx>
#include <vcl/commandevent.hxx>
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index 5e6d7be6d392..d83d4206198d 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -53,7 +53,6 @@
#include <comphelper/lok.hxx>
#include <officecfg/Office/Calc.hxx>
-#include <LibreOfficeKit/LibreOfficeKitEnums.h>
using namespace com::sun::star;
diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index f61b8652064b..36b4a2cb9d6e 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -22,9 +22,7 @@
#include <sfx2/viewfrm.hxx>
#include <svl/whiter.hxx>
#include <unotools/moduleoptions.hxx>
-#include <svl/languageoptions.hxx>
#include <svl/cjkoptions.hxx>
-#include <svl/ctloptions.hxx>
#include <sfx2/dispatch.hxx>
#include <tools/UnitConversion.hxx>
diff --git a/sc/source/ui/view/tabvwsh5.cxx b/sc/source/ui/view/tabvwsh5.cxx
index 0758a9fe3724..ae0b86f86541 100644
--- a/sc/source/ui/view/tabvwsh5.cxx
+++ b/sc/source/ui/view/tabvwsh5.cxx
@@ -19,7 +19,6 @@
#include <svl/hint.hxx>
#include <comphelper/lok.hxx>
-#include <svl/zforlist.hxx>
#include <svx/numfmtsh.hxx>
#include <svx/numinf.hxx>
#include <svx/svxids.hrc>
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index f0d5e5f7d272..e6de1564995e 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -26,7 +26,6 @@
#include <sfx2/viewfrm.hxx>
#include <basic/sbstar.hxx>
#include <basic/sberrors.hxx>
-#include <svl/languageoptions.hxx>
#include <svl/ctloptions.hxx>
#include <svl/stritem.hxx>
#include <svl/whiter.hxx>
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index a9a2b36d6349..26aa7907779a 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -32,7 +32,6 @@
#include <svl/numformat.hxx>
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
-#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <vcl/virdev.hxx>
#include <stdlib.h>
@@ -48,7 +47,6 @@
#include <patattr.hxx>
#include <docpool.hxx>
#include <sc.hrc>
-#include <strings.hrc>
#include <undocell.hxx>
#include <undoblk.hxx>
#include <refundo.hxx>
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index ad6b770eca03..902c8c0a0bec 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -15,7 +15,6 @@
#include <reffact.hxx>
#include <tabvwsh.hxx>
-#include <unotools/pathoptions.hxx>
#include <tools/urlobj.hxx>
#include <sfx2/filedlghelper.hxx>
#include <sfx2/objsh.hxx>
diff --git a/sccomp/source/solver/CoinMPSolver.cxx b/sccomp/source/solver/CoinMPSolver.cxx
index 2dd896e82bb1..35ebf1fd19b2 100644
--- a/sccomp/source/solver/CoinMPSolver.cxx
+++ b/sccomp/source/solver/CoinMPSolver.cxx
@@ -25,7 +25,6 @@
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/table/CellAddress.hpp>
-#include <unotools/resmgr.hxx>
#include <rtl/math.hxx>
#include <stdexcept>
diff --git a/sccomp/source/solver/LpsolveSolver.cxx b/sccomp/source/solver/LpsolveSolver.cxx
index 1053f53fa0ee..270840453c9e 100644
--- a/sccomp/source/solver/LpsolveSolver.cxx
+++ b/sccomp/source/solver/LpsolveSolver.cxx
@@ -56,7 +56,6 @@
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/table/CellAddress.hpp>
-#include <unotools/resmgr.hxx>
#include <rtl/math.hxx>
#include <algorithm>
#include <memory>
diff --git a/scripting/source/provider/URIHelper.cxx b/scripting/source/provider/URIHelper.cxx
index 3fa98db81355..481a5b2f6e4e 100644
--- a/scripting/source/provider/URIHelper.cxx
+++ b/scripting/source/provider/URIHelper.cxx
@@ -23,7 +23,6 @@
#include <com/sun/star/uri/XVndSunStarScriptUrl.hpp>
#include <com/sun/star/uri/UriReferenceFactory.hpp>
#include <cppuhelper/supportsservice.hxx>
-#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
#include "URIHelper.hxx"