summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Kelemen <kelemen.gabor2@nisz.hu>2020-11-18 16:36:42 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-11-27 11:08:09 +0100
commitf3fc16f444f84a269df9bd2f2c3d2a47cf49d057 (patch)
treed2b2369d720e1640878642f3c15f8bcfb4ad71ca
parentb8404ae521a9c2d183d4e076a7884627ba353e4b (diff)
tdf#42949 Fix new IWYU warnings in directory sc/
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I217817e2e4a42b096f5a7fb6344568c10d69aab2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106078 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--sc/IwyuFilter_sc.yaml207
-rw-r--r--sc/inc/NumberFormatControl.hxx1
-rw-r--r--sc/inc/dpdimsave.hxx2
-rw-r--r--sc/inc/dpfilteredcache.hxx1
-rw-r--r--sc/inc/dpoutput.hxx2
-rw-r--r--sc/inc/dpresfilter.hxx1
-rw-r--r--sc/inc/formularesult.hxx1
-rw-r--r--sc/inc/global.hxx2
-rw-r--r--sc/inc/inputopt.hxx1
-rw-r--r--sc/inc/rechead.hxx1
-rw-r--r--sc/inc/sc.hrc1
-rw-r--r--sc/inc/scmod.hxx1
-rw-r--r--sc/inc/sheetlimits.hxx1
-rw-r--r--sc/inc/userdat.hxx1
-rw-r--r--sc/qa/extras/anchor.cxx1
-rw-r--r--sc/qa/unit/copy_paste_test.cxx1
-rw-r--r--sc/qa/unit/filters-test.cxx1
-rw-r--r--sc/qa/unit/helper/debughelper.hxx2
-rw-r--r--sc/qa/unit/jumbosheets-test.cxx2
-rw-r--r--sc/qa/unit/scshapetest.cxx3
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx3
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx2
-rw-r--r--sc/qa/unit/tiledrendering/tiledrendering.cxx4
-rw-r--r--sc/qa/unit/ucalc_sort.cxx1
-rw-r--r--sc/qa/unit/uicalc/uicalc.cxx7
-rw-r--r--sc/source/core/data/column2.cxx1
-rw-r--r--sc/source/core/data/docpool.cxx1
-rw-r--r--sc/source/core/data/documen2.cxx1
-rw-r--r--sc/source/core/data/documen3.cxx1
-rw-r--r--sc/source/core/data/documen7.cxx1
-rw-r--r--sc/source/core/data/documen8.cxx2
-rw-r--r--sc/source/core/data/document.cxx6
-rw-r--r--sc/source/core/data/document10.cxx1
-rw-r--r--sc/source/core/data/dptabsrc.cxx2
-rw-r--r--sc/source/core/data/drwlayer.cxx2
-rw-r--r--sc/source/core/data/formulacell.cxx1
-rw-r--r--sc/source/core/data/markarr.cxx3
-rw-r--r--sc/source/core/data/markmulti.cxx2
-rw-r--r--sc/source/core/data/poolhelp.cxx1
-rw-r--r--sc/source/core/data/segmenttree.cxx1
-rw-r--r--sc/source/core/data/table4.cxx1
-rw-r--r--sc/source/core/data/validat.cxx2
-rw-r--r--sc/source/core/inc/arraysumfunctor.hxx4
-rw-r--r--sc/source/core/inc/grouptokenconverter.hxx1
-rw-r--r--sc/source/core/inc/interpre.hxx1
-rw-r--r--sc/source/core/opencl/opinlinefun_math.hxx2
-rw-r--r--sc/source/core/tool/addincol.cxx4
-rw-r--r--sc/source/core/tool/addinhelpid.cxx1
-rw-r--r--sc/source/core/tool/addinlis.cxx1
-rw-r--r--sc/source/core/tool/adiasync.cxx2
-rw-r--r--sc/source/core/tool/appoptio.cxx4
-rw-r--r--sc/source/core/tool/autoform.cxx9
-rw-r--r--sc/source/core/tool/calcconfig.cxx5
-rw-r--r--sc/source/core/tool/callform.cxx3
-rw-r--r--sc/source/core/tool/cellform.cxx2
-rw-r--r--sc/source/core/tool/cellkeytranslator.cxx1
-rw-r--r--sc/source/core/tool/chartarr.cxx4
-rw-r--r--sc/source/core/tool/chartlock.cxx1
-rw-r--r--sc/source/core/tool/chartpos.cxx1
-rw-r--r--sc/source/core/tool/chgtrack.cxx8
-rw-r--r--sc/source/core/tool/chgviset.cxx1
-rw-r--r--sc/source/core/tool/compiler.cxx4
-rw-r--r--sc/source/core/tool/consoli.cxx1
-rw-r--r--sc/source/core/tool/dbdata.cxx1
-rw-r--r--sc/source/core/tool/defaultsoptions.cxx4
-rw-r--r--sc/source/core/tool/detdata.cxx1
-rw-r--r--sc/source/core/tool/detfunc.cxx7
-rw-r--r--sc/source/core/tool/docoptio.cxx3
-rw-r--r--sc/source/core/tool/doubleref.cxx1
-rw-r--r--sc/source/core/tool/editutil.cxx4
-rw-r--r--sc/source/core/tool/formulagroup.cxx8
-rw-r--r--sc/source/core/tool/formulaopt.cxx1
-rw-r--r--sc/source/core/tool/inputopt.cxx2
-rw-r--r--sc/source/core/tool/interpr1.cxx5
-rw-r--r--sc/source/core/tool/interpr2.cxx10
-rw-r--r--sc/source/core/tool/interpr3.cxx3
-rw-r--r--sc/source/core/tool/interpr4.cxx8
-rw-r--r--sc/source/core/tool/interpr5.cxx1
-rw-r--r--sc/source/core/tool/interpr6.cxx2
-rw-r--r--sc/source/core/tool/interpr7.cxx4
-rw-r--r--sc/source/core/tool/interpr8.cxx4
-rw-r--r--sc/source/core/tool/jumpmatrix.cxx1
-rw-r--r--sc/source/core/tool/matrixoperators.cxx1
-rw-r--r--sc/source/core/tool/numformat.cxx2
-rw-r--r--sc/source/core/tool/optutil.cxx2
-rw-r--r--sc/source/core/tool/parclass.cxx4
-rw-r--r--sc/source/core/tool/prnsave.cxx1
-rw-r--r--sc/source/core/tool/progress.cxx1
-rw-r--r--sc/source/core/tool/rangelst.cxx2
-rw-r--r--sc/source/core/tool/rangenam.cxx3
-rw-r--r--sc/source/core/tool/refupdat.cxx3
-rw-r--r--sc/source/core/tool/scmatrix.cxx6
-rw-r--r--sc/source/core/tool/scopetools.cxx1
-rw-r--r--sc/source/core/tool/stringutil.cxx1
-rw-r--r--sc/source/core/tool/stylehelper.cxx1
-rw-r--r--sc/source/core/tool/subtotal.cxx2
-rw-r--r--sc/source/core/tool/token.cxx8
-rw-r--r--sc/source/core/tool/unitconv.cxx2
-rw-r--r--sc/source/core/tool/userlist.cxx2
-rw-r--r--sc/source/core/tool/viewopti.cxx4
-rw-r--r--sc/source/core/tool/webservicelink.cxx6
-rw-r--r--sc/source/core/tool/zforauto.cxx1
-rw-r--r--sc/source/filter/excel/xeextlst.cxx3
-rw-r--r--sc/source/filter/excel/xestream.cxx1
-rw-r--r--sc/source/filter/excel/xlchart.cxx2
-rw-r--r--sc/source/filter/ftools/ftools.cxx1
-rw-r--r--sc/source/filter/html/htmlexp.cxx1
-rw-r--r--sc/source/filter/html/htmlpars.cxx1
-rw-r--r--sc/source/filter/inc/condformatbuffer.hxx1
-rw-r--r--sc/source/filter/inc/eeparser.hxx1
-rw-r--r--sc/source/filter/inc/exp_op.hxx1
-rw-r--r--sc/source/filter/inc/lotrange.hxx2
-rw-r--r--sc/source/filter/inc/root.hxx1
-rw-r--r--sc/source/filter/inc/scfobj.hxx2
-rw-r--r--sc/source/filter/inc/sharedformulagroups.hxx1
-rw-r--r--sc/source/filter/inc/tool.h2
-rw-r--r--sc/source/filter/inc/xehelper.hxx1
-rw-r--r--sc/source/filter/inc/xerecord.hxx1
-rw-r--r--sc/source/filter/inc/xestring.hxx1
-rw-r--r--sc/source/filter/inc/xestyle.hxx1
-rw-r--r--sc/source/filter/inc/xetable.hxx1
-rw-r--r--sc/source/filter/inc/xltools.hxx2
-rw-r--r--sc/source/filter/lotus/lotattr.cxx1
-rw-r--r--sc/source/filter/lotus/lotform.cxx1
-rw-r--r--sc/source/filter/lotus/lotimpop.cxx3
-rw-r--r--sc/source/filter/lotus/lotread.cxx1
-rw-r--r--sc/source/filter/lotus/lotus.cxx1
-rw-r--r--sc/source/filter/lotus/op.cxx1
-rw-r--r--sc/source/filter/lotus/tool.cxx1
-rw-r--r--sc/source/filter/oox/commentsbuffer.cxx7
-rw-r--r--sc/source/filter/oox/stylesbuffer.cxx1
-rw-r--r--sc/source/filter/oox/viewsettings.cxx1
-rw-r--r--sc/source/filter/oox/workbookhelper.cxx1
-rw-r--r--sc/source/filter/orcus/orcusfiltersimpl.cxx1
-rw-r--r--sc/source/filter/qpro/qproform.cxx1
-rw-r--r--sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx3
-rw-r--r--sc/source/filter/xml/XMLStylesImportHelper.hxx2
-rw-r--r--sc/source/filter/xml/XMLTableHeaderFooterContext.cxx1
-rw-r--r--sc/source/filter/xml/xmlcvali.cxx1
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx1
-rw-r--r--sc/source/filter/xml/xmlstyle.cxx1
-rw-r--r--sc/source/filter/xml/xmlstyli.cxx1
-rw-r--r--sc/source/filter/xml/xmltabi.cxx1
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx1
-rw-r--r--sc/source/ui/Accessibility/DrawModelBroadcaster.cxx1
-rw-r--r--sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx10
-rw-r--r--sc/source/ui/app/client.cxx1
-rw-r--r--sc/source/ui/app/inputhdl.cxx1
-rw-r--r--sc/source/ui/app/inputwin.cxx2
-rw-r--r--sc/source/ui/app/scdll.cxx9
-rw-r--r--sc/source/ui/app/scmod.cxx1
-rw-r--r--sc/source/ui/attrdlg/attrdlg.cxx2
-rw-r--r--sc/source/ui/attrdlg/scabstdlg.cxx1
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx2
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx1
-rw-r--r--sc/source/ui/cctrl/checklistmenu.cxx3
-rw-r--r--sc/source/ui/cctrl/tbzoomsliderctrl.cxx2
-rw-r--r--sc/source/ui/condformat/condformatdlg.cxx3
-rw-r--r--sc/source/ui/condformat/condformatdlgentry.cxx3
-rw-r--r--sc/source/ui/condformat/condformatmgr.cxx2
-rw-r--r--sc/source/ui/dataprovider/sqldataprovider.cxx1
-rw-r--r--sc/source/ui/dbgui/PivotLayoutDialog.cxx1
-rw-r--r--sc/source/ui/dbgui/csvtablebox.cxx2
-rw-r--r--sc/source/ui/dbgui/dapidata.cxx1
-rw-r--r--sc/source/ui/dbgui/scuiasciiopt.cxx1
-rw-r--r--sc/source/ui/dbgui/sfiltdlg.cxx1
-rw-r--r--sc/source/ui/dbgui/validate.cxx3
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx1
-rw-r--r--sc/source/ui/docshell/docsh3.cxx1
-rw-r--r--sc/source/ui/docshell/docsh4.cxx1
-rw-r--r--sc/source/ui/docshell/docsh5.cxx1
-rw-r--r--sc/source/ui/docshell/docsh8.cxx1
-rw-r--r--sc/source/ui/drawfunc/drawsh.cxx1
-rw-r--r--sc/source/ui/drawfunc/drawsh2.cxx4
-rw-r--r--sc/source/ui/drawfunc/fudraw.cxx1
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx4
-rw-r--r--sc/source/ui/inc/AccessibleCsvControl.hxx3
-rw-r--r--sc/source/ui/inc/ChildWindowWrapper.hxx1
-rw-r--r--sc/source/ui/inc/FilterListBox.hxx2
-rw-r--r--sc/source/ui/inc/PivotLayoutTreeList.hxx1
-rw-r--r--sc/source/ui/inc/PivotLayoutTreeListData.hxx1
-rw-r--r--sc/source/ui/inc/RegressionDialog.hxx1
-rw-r--r--sc/source/ui/inc/TableFillingAndNavigationTools.hxx1
-rw-r--r--sc/source/ui/inc/acredlin.hxx2
-rw-r--r--sc/source/ui/inc/anyrefdg.hxx2
-rw-r--r--sc/source/ui/inc/areasave.hxx1
-rw-r--r--sc/source/ui/inc/autostyl.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/condformatmgr.hxx2
-rw-r--r--sc/source/ui/inc/csvcontrol.hxx1
-rw-r--r--sc/source/ui/inc/csvruler.hxx1
-rw-r--r--sc/source/ui/inc/dataprovider.hxx2
-rw-r--r--sc/source/ui/inc/datatableview.hxx1
-rw-r--r--sc/source/ui/inc/foptmgr.hxx2
-rw-r--r--sc/source/ui/inc/formula.hxx1
-rw-r--r--sc/source/ui/inc/fuinsert.hxx2
-rw-r--r--sc/source/ui/inc/gridmerg.hxx3
-rw-r--r--sc/source/ui/inc/hdrcont.hxx1
-rw-r--r--sc/source/ui/inc/inputwin.hxx2
-rw-r--r--sc/source/ui/inc/instbdlg.hxx1
-rw-r--r--sc/source/ui/inc/optsolver.hxx1
-rw-r--r--sc/source/ui/inc/protectiondlg.hxx1
-rw-r--r--sc/source/ui/inc/scuiasciiopt.hxx1
-rw-r--r--sc/source/ui/inc/scuiautofmt.hxx1
-rw-r--r--sc/source/ui/inc/scuitphfedit.hxx1
-rw-r--r--sc/source/ui/inc/sharedocdlg.hxx1
-rw-r--r--sc/source/ui/inc/sizedev.hxx1
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx3
-rw-r--r--sc/source/ui/inc/tphfedit.hxx2
-rw-r--r--sc/source/ui/inc/uiobject.hxx2
-rw-r--r--sc/source/ui/inc/undoolk.hxx2
-rw-r--r--sc/source/ui/inc/validate.hxx1
-rw-r--r--sc/source/ui/inc/xmlsourcedlg.hxx1
-rw-r--r--sc/source/ui/miscdlgs/datafdlg.cxx1
-rw-r--r--sc/source/ui/namedlg/namedefdlg.cxx1
-rw-r--r--sc/source/ui/namedlg/namedlg.cxx1
-rw-r--r--sc/source/ui/navipi/content.cxx1
-rw-r--r--sc/source/ui/navipi/scenwnd.cxx1
-rw-r--r--sc/source/ui/pagedlg/tphf.cxx1
-rw-r--r--sc/source/ui/pagedlg/tphfedit.cxx4
-rw-r--r--sc/source/ui/pagedlg/tptable.cxx2
-rw-r--r--sc/source/ui/sidebar/AlignmentPropertyPanel.cxx5
-rw-r--r--sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx4
-rw-r--r--sc/source/ui/sidebar/CellBorderStyleControl.cxx1
-rw-r--r--sc/source/ui/sidebar/CellLineStyleControl.cxx1
-rw-r--r--sc/source/ui/styleui/styledlg.cxx1
-rw-r--r--sc/source/ui/undo/undoblk.cxx3
-rw-r--r--sc/source/ui/unoobj/afmtuno.cxx3
-rw-r--r--sc/source/ui/unoobj/appluno.cxx2
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx2
-rw-r--r--sc/source/ui/unoobj/defltuno.cxx1
-rw-r--r--sc/source/ui/unoobj/docuno.cxx2
-rw-r--r--sc/source/ui/unoobj/notesuno.cxx1
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx2
-rw-r--r--sc/source/ui/unoobj/unodoc.cxx3
-rw-r--r--sc/source/ui/vba/vbafiledialog.hxx2
-rw-r--r--sc/source/ui/vba/vbafont.cxx1
-rw-r--r--sc/source/ui/view/cellsh2.cxx2
-rw-r--r--sc/source/ui/view/cellsh3.cxx1
-rw-r--r--sc/source/ui/view/dbfunc3.cxx1
-rw-r--r--sc/source/ui/view/formatsh.cxx1
-rw-r--r--sc/source/ui/view/gridwin.cxx6
-rw-r--r--sc/source/ui/view/output.cxx1
-rw-r--r--sc/source/ui/view/output2.cxx1
-rw-r--r--sc/source/ui/view/overlayobject.cxx1
-rw-r--r--sc/source/ui/view/preview.cxx2
-rw-r--r--sc/source/ui/view/prevwsh.cxx2
-rw-r--r--sc/source/ui/view/spellcheckcontext.cxx3
-rw-r--r--sc/source/ui/view/tabview.cxx1
-rw-r--r--sc/source/ui/view/tabview4.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx3
-rw-r--r--sc/source/ui/view/tabvwsh9.cxx2
-rw-r--r--sc/source/ui/view/tabvwsha.cxx2
-rw-r--r--sc/source/ui/view/tabvwshe.cxx3
-rw-r--r--sc/source/ui/view/viewfun4.cxx1
-rw-r--r--sc/source/ui/view/viewfun5.cxx1
-rw-r--r--sc/source/ui/view/viewfunc.cxx1
258 files changed, 289 insertions, 441 deletions
diff --git a/sc/IwyuFilter_sc.yaml b/sc/IwyuFilter_sc.yaml
index 3510a5f15b57..514c2c313824 100644
--- a/sc/IwyuFilter_sc.yaml
+++ b/sc/IwyuFilter_sc.yaml
@@ -1,6 +1,15 @@
---
assumeFilename: sc/source/core/data/document.cxx
excludelist:
+ sc/sdi/scslots.hrc:
+ # Needed for sdi files to compile
+ - sfx2/sfxsids.hrc
+ - svx/svxids.hrc
+ - svx/unomid.hxx
+ - editeng/editids.hrc
+ - editeng/memberids.h
+ - sc.hrc
+ - mid.h
sc/inc/addruno.hxx:
# base class has to be a complete type
- com/sun/star/beans/XPropertySet.hpp
@@ -64,8 +73,6 @@ excludelist:
sc/inc/conditio.hxx:
# base class has to be a complete type
- tools/link.hxx
- # Used as type for a boost::optional variable
- - tools/color.hxx
sc/inc/dapiuno.hxx:
# base class has to be a complete type
- com/sun/star/container/XEnumerationAccess.hpp
@@ -351,10 +358,24 @@ excludelist:
sc/qa/unit/functions_test.hxx:
# Needed for css shortcut
- sal/types.h
+ sc/qa/unit/screenshots/screenshots.cxx:
+ # Needed for template
+ - sfx2/sfxdlg.hxx
+ sc/qa/unit/subsequent_filters-test.cxx:
+ # Actually used
+ - comphelper/scopeguard.hxx
+ sc/qa/unit/subsequent_export-test.cxx:
+ # Actually used
+ - comphelper/scopeguard.hxx
+ # Needed for namespace shortcuts
+ - helper/debughelper.hxx
sc/source/core/inc/addinlis.hxx:
# base class has to be a complete type
- com/sun/star/lang/XServiceInfo.hpp
- com/sun/star/sheet/XResultListener.hpp
+ sc/source/core/inc/arraysumfunctor.hxx:
+ # Needed for uintptr_t
+ - cstdint
sc/source/core/opencl/formulagroupcl.cxx:
# Needed for implicit dtor in inverseMatrix()
- scmatrix.hxx
@@ -555,8 +576,6 @@ excludelist:
sc/source/ui/vba/vbafiledialog.hxx:
# base class has to be a complete type
- ooo/vba/excel/XFileDialog.hpp
- # FIXME IWYU segfaults after removing this
- - vbahelper/vbacollectionimpl.hxx
sc/source/ui/vba/vbafiledialogitems.hxx:
# base class has to be a complete type
- ooo/vba/excel/XFileDialogSelectedItems.hpp
@@ -667,9 +686,18 @@ excludelist:
sc/source/core/data/documentimport.cxx:
# Needed for member access in assert()
- stringutil.hxx
+ sc/source/core/data/dpresfilter.cxx:
+ # Actually used
+ - com/sun/star/uno/Sequence.hxx
+ sc/source/core/data/dpoutputgeometry.cxx:
+ # Actually used
+ - vector
sc/source/core/data/dptabres.cxx:
# Used in #if DUMP_PIVOT_TABLE
- document.hxx
+ sc/source/core/data/dptabsrc.cxx:
+ # Actually used
+ - com/sun/star/sheet/DataPilotFieldFilter.hpp
sc/source/core/data/formulacell.cxx:
# Used in #if DBG_UTIL
- com/sun/star/sheet/FormulaLanguage.hpp
@@ -682,6 +710,27 @@ excludelist:
sc/source/core/data/types.cxx:
# Complete type is needed for complex data type
- scmatrix.hxx
+ sc/source/core/data/tabprotection.cxx:
+ # Actually used
+ - vector
+ sc/source/core/tool/addincol.cxx:
+ # Needed for template
+ - com/sun/star/frame/XModel.hpp
+ sc/source/core/tool/autoform.cxx:
+ # Don't propose hxx -> h in URE headers
+ - osl/thread.hxx
+ sc/source/core/tool/cellkeytranslator.cxx:
+ # Needed for localized keywords
+ - cellkeywords.inl
+ sc/source/core/tool/formularesult.cxx:
+ # Complete type needed for boost::intrusive_ptr
+ - scmatrix.hxx
+ sc/source/core/tool/formulaparserpool.cxx:
+ # Needed for template
+ - com/sun/star/frame/XModel.hpp
+ sc/source/core/tool/interpr4.cxx:
+ # Needed for template
+ - com/sun/star/script/XInvocation.hpp
sc/source/filter/xml/XMLCodeNameProvider.hxx:
# base class has to be a complete type
- com/sun/star/container/XNameAccess.hpp
@@ -691,13 +740,24 @@ excludelist:
sc/source/filter/ftools/sharedformulagroups.cxx:
# Needed for implicit dtor
- tokenarray.hxx
+ sc/source/filter/excel/excdoc.cxx:
+ # Needed for template
+ - com/sun/star/frame/XModel.hpp
sc/source/filter/excel/excimp8.cxx:
# base class has to be a complete type
- com/sun/star/container/XIndexContainer.hpp
+ # Needed for template
+ - com/sun/star/frame/XModel.hpp
+ sc/source/filter/excel/expop2.cxx:
+ # Needed for template
+ - com/sun/star/frame/XModel.hpp
sc/source/filter/excel/xechart.cxx:
# Complex type needs complete type
- com/sun/star/chart2/RelativePosition.hpp
- com/sun/star/chart2/RelativeSize.hpp
+ sc/source/filter/excel/xecontent.cxx:
+ # Needed for template
+ - com/sun/star/frame/XModel.hpp
sc/source/filter/excel/xeescher.cxx:
# base class has to be a complete type
- com/sun/star/chart/XChartDocument.hpp
@@ -714,6 +774,17 @@ excludelist:
sc/source/filter/excel/xistyle.cxx:
# Needed for direct member access
- xladdress.hxx
+ # Needed for template
+ - com/sun/star/frame/XModel.hpp
+ sc/source/filter/excel/xlpage.cxx:
+ # Needed for template
+ - editeng/brushitem.hxx
+ sc/source/filter/excel/xlstyle.cxx:
+ # Needed for template
+ - com/sun/star/awt/FontSlant.hpp
+ sc/source/filter/ftools/fapihelper.cxx:
+ # Needed for template
+ - com/sun/star/frame/XModel.hpp
sc/source/filter/lotus/filter.cxx:
# Needed to avoid loplugin:unreffun error
- filter.hxx
@@ -723,15 +794,62 @@ excludelist:
sc/source/filter/lotus/op.cxx:
# Needed to avoid loplugin:unreffun error
- op.h
+ # Needed for rtl::math::round
+ - rtl/math.hxx
+ sc/source/filter/html/htmlpars.cxx:
+ # Needed for template
+ - com/sun/star/frame/XModel.hpp
+ sc/source/filter/html/htmlexp.cxx:
+ # Needed for template
+ - com/sun/star/frame/XModel.hpp
+ sc/source/filter/oox/defnamesbuffer.cxx:
+ # Needed for template
+ - com/sun/star/sheet/XSpreadsheet.hpp
+ sc/source/filter/oox/externallinkbuffer.cxx:
+ # Needed for template
+ - com/sun/star/sheet/XSpreadsheetDocument.hpp
+ sc/source/filter/oox/numberformatsbuffer.cxx:
+ # Needed for template
+ - com/sun/star/sheet/XSpreadsheetDocument.hpp
sc/source/filter/oox/ooxformulaparser.cxx:
# Needed for direct member access
- com/sun/star/lang/XComponent.hpp
+ sc/source/filter/oox/pagesettings.cxx:
+ # Needed for template
+ - com/sun/star/sheet/XSpreadsheet.hpp
+ sc/source/filter/oox/querytablebuffer.cxx:
+ # Needed for template
+ - com/sun/star/sheet/XSpreadsheetDocument.hpp
sc/source/filter/oox/richstring.cxx:
# Complete type needed for unique_ptr
- editeng/editobj.hxx
+ sc/source/filter/oox/sheetdatabuffer.cxx:
+ # Needed for template
+ - com/sun/star/sheet/XSpreadsheetDocument.hpp
+ - com/sun/star/table/XCell.hpp
+ - com/sun/star/table/XCellRange.hpp
+ sc/source/filter/oox/stylesbuffer.cxx:
+ # Needed for template
+ - com/sun/star/sheet/XSpreadsheetDocument.hpp
+ sc/source/filter/oox/tablebuffer.cxx:
+ # Needed for template
+ - com/sun/star/sheet/XSpreadsheetDocument.hpp
+ sc/source/filter/oox/unitconverter.cxx:
+ # Needed for template
+ - com/sun/star/sheet/XSpreadsheetDocument.hpp
+ sc/source/filter/oox/viewsettings.cxx:
+ # Needed for template
+ - com/sun/star/sheet/XSpreadsheetDocument.hpp
+ - com/sun/star/sheet/XSpreadsheet.hpp
+ sc/source/filter/oox/workbooksettings.cxx:
+ # Needed for template
+ - com/sun/star/sheet/XSpreadsheetDocument.hpp
sc/source/filter/oox/worksheethelper.cxx:
# Needed for implicit dtor
- editeng/editobj.hxx
+ sc/source/filter/oox/worksheetsettings.cxx:
+ # Needed for template
+ - com/sun/star/sheet/XSpreadsheet.hpp
sc/source/filter/orcus/orcusfiltersimpl.cxx:
# Needed for implicit dtor
- tokenarray.hxx
@@ -740,15 +858,51 @@ excludelist:
sc/source/filter/orcus/xmlcontext.cxx:
# Needed for implicit dtor
- tokenarray.hxx
+ sc/source/filter/xcl97/xcl97rec.cxx:
+ # Needed for template
+ - com/sun/star/chart/XChartDocument.hpp
+ - sax/fastattribs.hxx
+ sc/source/filter/xml/XMLCalculationSettingsContext.cxx:
+ # Needed for template
+ - com/sun/star/frame/XModel.hpp
sc/source/filter/xml/XMLExportIterator.cxx:
# Needed for direct member access
- com/sun/star/table/XCellRange.hpp
+ - com/sun/star/sheet/XSpreadsheet.hpp
+ sc/source/filter/xml/XMLExportDatabaseRanges.cxx:
+ # Needed for template
+ - com/sun/star/frame/XModel.hpp
+ sc/source/filter/xml/XMLTableHeaderFooterContext.cxx:
+ # Needed for template
+ - com/sun/star/beans/XPropertySet.hpp
+ - com/sun/star/sheet/XHeaderFooterContent.hpp
+ # Needed for macro XMLOFF_WARN_UNKNOWN
+ - sal/log.hxx
+ sc/source/filter/xml/XMLTableMasterPageExport.cxx:
+ # Needed for template
+ - com/sun/star/text/XText.hpp
+ - com/sun/star/beans/XPropertySet.hpp
+ sc/source/filter/xml/XMLTableShapeResizer.cxx:
+ # Actually used
+ - vector
+ sc/source/filter/xml/XMLTableSourceContext.cxx:
+ # Needed for template
+ - com/sun/star/sheet/XSpreadsheet.hpp
+ sc/source/filter/xml/xmldpimp.cxx:
+ # Actually used
+ - com/sun/star/sheet/DataPilotFieldOrientation.hpp
+ sc/source/filter/xml/xmldrani.cxx:
+ # Actually used
+ - com/sun/star/sheet/DataImportMode.hpp
sc/source/filter/xml/xmlimprt.cxx:
# Needed to avoid loplugin:unreffun error
- appluno.hxx
sc/source/filter/xml/xmlsubti.cxx:
# Needed for direct member access
- com/sun/star/sheet/XSpreadsheet.hpp
+ sc/source/filter/xml/xmltabi.cxx:
+ # Needed for template
+ - com/sun/star/sheet/XSpreadsheet.hpp
sc/source/ui/attrdlg/scdlgfact.cxx:
# Complete type needed for unique_ptr & ScConditionalFormatList
- conditio.hxx
@@ -768,6 +922,7 @@ excludelist:
# Needed for MID* macros
- mid.h
- editeng/memberids.h
+ - svx/unomid.hxx
# Needed by scslots.hxx
- sfx2/msg.hxx
- svl/slstitm.hxx
@@ -846,6 +1001,8 @@ excludelist:
sc/source/ui/docshell/docsh.cxx:
# Needed for method parameter
- ooo/vba/excel/XWorkbook.hpp
+ # Needed for SID* macros in workdir/SdiTarget/sc/sdi/scslots.hxx
+ - sc.hrc
sc/source/ui/docshell/docsh4.cxx:
# Needed on WIN32
- impex.hxx
@@ -864,6 +1021,12 @@ excludelist:
# Complete type is needed
- com/sun/star/sheet/XFormulaParser.hpp
- com/sun/star/sheet/XFormulaOpCodeMapper.hpp
+ sc/source/ui/miscdlgs/solveroptions.cxx:
+ # Needed for template
+ - com/sun/star/sheet/XSolver.hpp
+ sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx:
+ # Needed for rtl::math::round
+ - rtl/math.hxx
sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx:
# Needed for implicit dtor
- editeng/editobj.hxx
@@ -879,12 +1042,48 @@ excludelist:
sc/source/ui/unoobj/notesuno.cxx:
# Needed for macro defines
- editeng/unoprnms.hxx
+ sc/source/ui/unoobj/scdetect.cxx:
+ # Actually used
+ - com/sun/star/beans/PropertyValue.hpp
sc/source/ui/unoobj/textuno.cxx:
# Needed for macro defines
- editeng/unoprnms.hxx
sc/source/ui/view/tabview.cxx:
# Needed for direct member access
- pagedata.hxx
+ sc/source/ui/vba/vbaformatconditions.cxx:
+ # Needed for template
+ - ooo/vba/excel/XRange.hpp
+ sc/source/ui/vba/vbahyperlink.cxx:
+ # Needed for template
+ - com/sun/star/frame/XModel.hpp
+ sc/source/ui/vba/vbaformat.cxx:
+ # Needed for rtl::math::round
+ - rtl/math.hxx
+ sc/source/ui/vba/vbainterior.cxx:
+ # Actually used
+ - com/sun/star/beans/XPropertySet.hpp
+ sc/source/ui/vba/vbanames.cxx:
+ # Actually used
+ - com/sun/star/sheet/XNamedRanges.hpp
+ sc/source/ui/vba/vbapagebreaks.cxx:
+ # Actually used
+ - com/sun/star/uno/XComponentContext.hpp
+ sc/source/ui/vba/vbaworkbooks.cxx:
+ # Actually used
+ - com/sun/star/uno/XComponentContext.hpp
+ sc/source/ui/vba/vbawsfunction.cxx:
+ # Actually used
+ - com/sun/star/beans/XIntrospectionAccess.hpp
+ sc/source/ui/vba/vbarange.cxx:
+ # Actually used
+ - com/sun/star/uno/XComponentContext.hpp
+ sc/source/ui/vba/vbaworksheet.cxx:
+ # Actually used
+ - com/sun/star/beans/XIntrospectionAccess.hpp
sc/source/ui/view/viewfun4.cxx:
# Needed for direct member access
- refundo.hxx
+ sc/source/ui/view/tabvwshc.cxx:
+ # Needed for ScFormulaDlg instantiation for some weird reason
+ - funcdesc.hxx
diff --git a/sc/inc/NumberFormatControl.hxx b/sc/inc/NumberFormatControl.hxx
index 78be6f1a0dc7..77e3843613cd 100644
--- a/sc/inc/NumberFormatControl.hxx
+++ b/sc/inc/NumberFormatControl.hxx
@@ -19,7 +19,6 @@
#pragma once
-#include "scdllapi.h"
#include <sfx2/tbxctrl.hxx>
diff --git a/sc/inc/dpdimsave.hxx b/sc/inc/dpdimsave.hxx
index d8cc13a6bb16..20642f57bcab 100644
--- a/sc/inc/dpdimsave.hxx
+++ b/sc/inc/dpdimsave.hxx
@@ -20,6 +20,8 @@
#ifndef INCLUDED_SC_INC_DPDIMSAVE_HXX
#define INCLUDED_SC_INC_DPDIMSAVE_HXX
+#include <tools/long.hxx>
+
#include <vector>
#include <map>
#include "dpitemdata.hxx"
diff --git a/sc/inc/dpfilteredcache.hxx b/sc/inc/dpfilteredcache.hxx
index aa40da4a11cf..b0503ebd82c3 100644
--- a/sc/inc/dpfilteredcache.hxx
+++ b/sc/inc/dpfilteredcache.hxx
@@ -23,7 +23,6 @@
#include <sal/types.h>
#include "dpitemdata.hxx"
#include "calcmacros.hxx"
-#include "scdllapi.h"
#include "types.hxx"
#include <unordered_set>
diff --git a/sc/inc/dpoutput.hxx b/sc/inc/dpoutput.hxx
index 230b289c00fd..756cccef5725 100644
--- a/sc/inc/dpoutput.hxx
+++ b/sc/inc/dpoutput.hxx
@@ -24,6 +24,8 @@
#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
#include <com/sun/star/uno/Sequence.hxx>
+#include <tools/long.hxx>
+
#include "address.hxx"
#include "dptypes.hxx"
diff --git a/sc/inc/dpresfilter.hxx b/sc/inc/dpresfilter.hxx
index c9f32b99c890..5e6b0a1fa0d3 100644
--- a/sc/inc/dpresfilter.hxx
+++ b/sc/inc/dpresfilter.hxx
@@ -11,7 +11,6 @@
#define INCLUDED_SC_INC_DPRESFILTER_HXX
#include <rtl/ustring.hxx>
-#include <tools/long.hxx>
#include "calcmacros.hxx"
#include <memory>
diff --git a/sc/inc/formularesult.hxx b/sc/inc/formularesult.hxx
index c17f1e083c4c..b79f4cc76a2a 100644
--- a/sc/inc/formularesult.hxx
+++ b/sc/inc/formularesult.hxx
@@ -20,7 +20,6 @@
#ifndef INCLUDED_SC_INC_FORMULARESULT_HXX
#define INCLUDED_SC_INC_FORMULARESULT_HXX
-#include "scdllapi.h"
#include "global.hxx"
#include "calcmacros.hxx"
#include <svl/sharedstring.hxx>
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 3574a0aab0ed..f6b4e83842e7 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -34,7 +34,7 @@
// HACK: <atomic> includes <stdbool.h>, which in some Clang versions does '#define bool bool',
// which confuses clang plugins.
#undef bool
-#include <map>
+
#include <memory>
namespace com::sun::star::uno { template <typename > class Reference; }
diff --git a/sc/inc/inputopt.hxx b/sc/inc/inputopt.hxx
index 52811ee93c5c..9fdce5949557 100644
--- a/sc/inc/inputopt.hxx
+++ b/sc/inc/inputopt.hxx
@@ -20,7 +20,6 @@
#ifndef INCLUDED_SC_INC_INPUTOPT_HXX
#define INCLUDED_SC_INC_INPUTOPT_HXX
-#include "scdllapi.h"
#include <unotools/configitem.hxx>
class ScInputOptions
diff --git a/sc/inc/rechead.hxx b/sc/inc/rechead.hxx
index 53ccca673899..761150eef2b0 100644
--- a/sc/inc/rechead.hxx
+++ b/sc/inc/rechead.hxx
@@ -20,7 +20,6 @@
#ifndef INCLUDED_SC_INC_RECHEAD_HXX
#define INCLUDED_SC_INC_RECHEAD_HXX
-#include <tools/solar.h>
#include <tools/stream.hxx>
#include <memory>
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index e80825624dea..bb8652429b27 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -20,7 +20,6 @@
#ifndef SC_SC_HRC
#define SC_SC_HRC
-#include <sfx2/sfxsids.hrc>
#include <svx/svxids.hrc>
// areas
diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx
index 20dc94e9e9e8..62480e72aa15 100644
--- a/sc/inc/scmod.hxx
+++ b/sc/inc/scmod.hxx
@@ -23,7 +23,6 @@
#include "scdllapi.h"
#include <o3tl/deleter.hxx>
#include <vcl/timer.hxx>
-#include <vcl/idle.hxx>
#include <svl/lstner.hxx>
#include <sfx2/app.hxx>
#include <sfx2/module.hxx>
diff --git a/sc/inc/sheetlimits.hxx b/sc/inc/sheetlimits.hxx
index 31df9d43793b..ab5516845f2c 100644
--- a/sc/inc/sheetlimits.hxx
+++ b/sc/inc/sheetlimits.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SC_INC_SHEETLIMITS_HXX
#include <salhelper/simplereferenceobject.hxx>
+#include "address.hxx"
// Because some stuff needs this info, and those objects lifetimes sometimes exceeds the lifetime
// of the ScDocument.
diff --git a/sc/inc/userdat.hxx b/sc/inc/userdat.hxx
index 769f19bd62cd..11bd7f615e7a 100644
--- a/sc/inc/userdat.hxx
+++ b/sc/inc/userdat.hxx
@@ -21,7 +21,6 @@
#define INCLUDED_SC_INC_USERDAT_HXX
#include <svx/svdobj.hxx>
-#include <vcl/imap.hxx>
#include "address.hxx"
#include "drwlayer.hxx"
diff --git a/sc/qa/extras/anchor.cxx b/sc/qa/extras/anchor.cxx
index 922ef1dbf319..5e96425627b7 100644
--- a/sc/qa/extras/anchor.cxx
+++ b/sc/qa/extras/anchor.cxx
@@ -19,7 +19,6 @@
#include <attrib.hxx>
#include <docsh.hxx>
#include <drwlayer.hxx>
-#include <scitems.hxx>
#include <svx/svdocirc.hxx>
#include <vcl/scheduler.hxx>
#include <tabvwsh.hxx>
diff --git a/sc/qa/unit/copy_paste_test.cxx b/sc/qa/unit/copy_paste_test.cxx
index 6c91afad30ea..2a1a1068e7c3 100644
--- a/sc/qa/unit/copy_paste_test.cxx
+++ b/sc/qa/unit/copy_paste_test.cxx
@@ -16,7 +16,6 @@
#include <cellmergeoption.hxx>
#include <tabvwsh.hxx>
#include <impex.hxx>
-#include <viewfunc.hxx>
#include <scitems.hxx>
#include <attrib.hxx>
#include <userlist.hxx>
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index a994297ff2c0..c52f4f1ddedd 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -31,6 +31,7 @@
#include <svx/svdocapt.hxx>
#include <svx/svdpage.hxx>
+#include <tools/stream.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
diff --git a/sc/qa/unit/helper/debughelper.hxx b/sc/qa/unit/helper/debughelper.hxx
index fedde10dd120..1795c4a16bb9 100644
--- a/sc/qa/unit/helper/debughelper.hxx
+++ b/sc/qa/unit/helper/debughelper.hxx
@@ -26,6 +26,8 @@
#define CALC_DEBUG_OUTPUT 0
#define CALC_TEST_PERF 0
+#include <sal/types.h>
+
using namespace ::com::sun::star;
using ::std::cout;
using ::std::cerr;
diff --git a/sc/qa/unit/jumbosheets-test.cxx b/sc/qa/unit/jumbosheets-test.cxx
index 1c129518008f..d635161e16e5 100644
--- a/sc/qa/unit/jumbosheets-test.cxx
+++ b/sc/qa/unit/jumbosheets-test.cxx
@@ -7,7 +7,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include <memory>
#include <sal/config.h>
#include <unotest/filters-test.hxx>
#include <test/bootstrapfixture.hxx>
@@ -23,7 +22,6 @@
#include <com/sun/star/frame/Desktop.hpp>
#include "helper/qahelper.hxx"
-#include "helper/shared_test_impl.hxx"
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx
index 9362d3d76a87..236cbc0879b4 100644
--- a/sc/qa/unit/scshapetest.cxx
+++ b/sc/qa/unit/scshapetest.cxx
@@ -9,11 +9,8 @@
#include <sal/config.h>
-#include <cstdlib>
-
#include <test/calc_unoapi_test.hxx>
-#include <comphelper/dispatchcommand.hxx>
#include <comphelper/propertyvalue.hxx>
#include <sfx2/dispatch.hxx>
#include <svx/svdoashp.hxx>
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 02b51df285d5..54918a017797 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -11,10 +11,7 @@
#include <sal/config.h>
#include <config_features.h>
-#include <sfx2/docfile.hxx>
#include <sfx2/sfxmodelfactory.hxx>
-#include <sfx2/sfxsids.hrc>
-#include <sfx2/docfilt.hxx>
#include "helper/debughelper.hxx"
#include "helper/qahelper.hxx"
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 8bc5ff722b8b..2323ee50b4c5 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -11,7 +11,6 @@
#include <sal/config.h>
#include <unotest/filters-test.hxx>
#include <test/bootstrapfixture.hxx>
-#include <rtl/strbuf.hxx>
#include <osl/file.hxx>
#include <config_features.h>
@@ -80,7 +79,6 @@
#include <unotools/syslocaleoptions.hxx>
#include "helper/qahelper.hxx"
#include "helper/shared_test_impl.hxx"
-#include <cellsuno.hxx>
namespace com::sun::star::frame { class XModel; }
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index ed6370e1dbe5..2cf0bb5821e9 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -15,9 +15,7 @@
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <com/sun/star/frame/Desktop.hpp>
-#include <com/sun/star/frame/DispatchHelper.hpp>
#include <com/sun/star/datatransfer/clipboard/SystemClipboard.hpp>
-#include <com/sun/star/datatransfer/UnsupportedFlavorException.hpp>
#include <comphelper/dispatchcommand.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/propertysequence.hxx>
@@ -31,11 +29,9 @@
#include <sfx2/childwin.hxx>
#include <sfx2/lokhelper.hxx>
#include <svx/svdpage.hxx>
-#include <vcl/svapp.hxx>
#include <vcl/scheduler.hxx>
#include <vcl/vclevent.hxx>
#include <vcl/virdev.hxx>
-#include <vcl/unohelp2.hxx>
#include <sc.hrc>
#include <comphelper/string.hxx>
#include <tools/json_writer.hxx>
diff --git a/sc/qa/unit/ucalc_sort.cxx b/sc/qa/unit/ucalc_sort.cxx
index 829fa82b56e0..d63bab256367 100644
--- a/sc/qa/unit/ucalc_sort.cxx
+++ b/sc/qa/unit/ucalc_sort.cxx
@@ -29,7 +29,6 @@
#include <sal/config.h>
#include <editeng/wghtitem.hxx>
#include <editeng/postitem.hxx>
-#include <editeng/editobj.hxx>
#include <svx/svdocirc.hxx>
#include <svx/svdpage.hxx>
#include <rtl/math.hxx>
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index a5c9a589023a..d87ca61b6765 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -10,14 +10,17 @@
#include <test/bootstrapfixture.hxx>
#include <unotest/macros_test.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <vcl/keycodes.hxx>
#include <vcl/scheduler.hxx>
#include <comphelper/propertysequence.hxx>
-#include <comphelper/processfactory.hxx>
+#include <com/sun/star/awt/Key.hpp>
#include <com/sun/star/frame/Desktop.hpp>
+#include <dbfunc.hxx>
#include <document.hxx>
#include <docuno.hxx>
-#include <tabvwsh.hxx>
+#include <docsh.hxx>
+#include <viewdata.hxx>
using namespace ::com::sun::star;
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 886dab8f5ab8..d3d9910d9326 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -41,7 +41,6 @@
#include <scmatrix.hxx>
#include <rowheightcontext.hxx>
#include <tokenstringcontext.hxx>
-#include <recursionhelper.hxx>
#include <editeng/eeitem.hxx>
#include <o3tl/safeint.hxx>
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index f49f99bd0c69..011b59613689 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -31,7 +31,6 @@
#include <svl/itemiter.hxx>
#include <svl/stritem.hxx>
#include <svx/algitem.hxx>
-#include <svx/sdangitm.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/lineitem.hxx>
#include <editeng/brushitem.hxx>
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index cd94e819d231..93d958f1b8ea 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -53,7 +53,6 @@
#include <validat.hxx>
#include <detdata.hxx>
#include <defaultsoptions.hxx>
-#include <sc.hrc>
#include <ddelink.hxx>
#include <chgtrack.hxx>
#include <chgviset.hxx>
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 944ca8c75982..4b9e06130f38 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -66,7 +66,6 @@
#include <refupdatecontext.hxx>
#include <scopetools.hxx>
#include <filterentries.hxx>
-#include <docsh.hxx>
#include <queryparam.hxx>
#include <globalnames.hxx>
diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx
index d56cea74f3f5..137aec6947ea 100644
--- a/sc/source/core/data/documen7.cxx
+++ b/sc/source/core/data/documen7.cxx
@@ -30,7 +30,6 @@
#include <sheetevents.hxx>
#include <tokenarray.hxx>
#include <listenercontext.hxx>
-#include <refhint.hxx>
void ScDocument::StartListeningArea(
const ScRange& rRange, bool bGroupListening, SvtListener* pListener )
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index e4cb29e8fae7..03623e1c4c0e 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -23,7 +23,6 @@
#include <comphelper/servicehelper.hxx>
#include <officecfg/Office/Common.hxx>
#include <tools/urlobj.hxx>
-#include <editeng/editobj.hxx>
#include <editeng/frmdiritem.hxx>
#include <editeng/langitem.hxx>
#include <sfx2/linkmgr.hxx>
@@ -80,7 +79,6 @@
#include <globalnames.hxx>
#include <stringutil.hxx>
#include <documentlinkmgr.hxx>
-#include <scopetools.hxx>
#include <tokenarray.hxx>
#include <memory>
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 17d0bf5c9561..8e906940b90b 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -25,7 +25,6 @@
#include <svx/sdrundomanager.hxx>
#include <svx/svditer.hxx>
#include <sfx2/objsh.hxx>
-#include <sfx2/viewsh.hxx>
#include <sfx2/docfile.hxx>
#include <svl/poolcach.hxx>
#include <svl/zforlist.hxx>
@@ -40,6 +39,7 @@
#include <com/sun/star/lang/NotInitializedException.hpp>
#include <document.hxx>
+#include <docuno.hxx>
#include <table.hxx>
#include <column.hxx>
#include <attrib.hxx>
@@ -83,8 +83,6 @@
#include <formulagroup.hxx>
#include <tokenstringcontext.hxx>
#include <compressedarray.hxx>
-#include <docsh.hxx>
-#include <brdcst.hxx>
#include <recursionhelper.hxx>
#include <formula/vectortoken.hxx>
@@ -94,7 +92,7 @@
#include <utility>
#include <comphelper/lok.hxx>
-#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <comphelper/servicehelper.hxx>
#include <vcl/uitest/logger.hxx>
#include <vcl/uitest/eventdescription.hxx>
diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx
index d05e81247645..81f2fe11bc83 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -16,7 +16,6 @@
#include <listenercontext.hxx>
#include <tokenstringcontext.hxx>
#include <poolhelp.hxx>
-#include <bcaslot.hxx>
#include <cellvalues.hxx>
#include <docpool.hxx>
#include <columniterator.hxx>
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index b57bf76dcb96..b74bfd0ba152 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -20,8 +20,6 @@
#include <dptabsrc.hxx>
#include <algorithm>
-#include <set>
-#include <unordered_set>
#include <vector>
#include <comphelper/sequence.hxx>
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 477eefead496..16fbe9c7f51c 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -35,10 +35,8 @@
#include <svx/svdoashp.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdocapt.hxx>
-#include <svx/svdograf.hxx>
#include <svx/svdoole2.hxx>
#include <svx/svdopath.hxx>
-#include <svx/svdtrans.hxx>
#include <svx/svdundo.hxx>
#include <svx/sdsxyitm.hxx>
#include <svx/svxids.hrc>
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 0e2c211f26bf..1d789e04b1bc 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -74,7 +74,6 @@
#include <memory>
#include <map>
#include <vector>
-#include <unordered_set>
using namespace formula;
diff --git a/sc/source/core/data/markarr.cxx b/sc/source/core/data/markarr.cxx
index 3c2083a267f3..9b1d3d834659 100644
--- a/sc/source/core/data/markarr.cxx
+++ b/sc/source/core/data/markarr.cxx
@@ -19,12 +19,9 @@
#include <markarr.hxx>
#include <address.hxx>
-#include <rangelst.hxx>
#include <sheetlimits.hxx>
#include <vector>
-#include <osl/diagnose.h>
-
ScMarkArray::ScMarkArray(const ScSheetLimits& rLimits) :
mrSheetLimits(rLimits)
{
diff --git a/sc/source/core/data/markmulti.cxx b/sc/source/core/data/markmulti.cxx
index e0296a8808d7..3a41f8c51b17 100644
--- a/sc/source/core/data/markmulti.cxx
+++ b/sc/source/core/data/markmulti.cxx
@@ -22,8 +22,6 @@
#include <rangelst.hxx>
#include <segmenttree.hxx>
#include <sheetlimits.hxx>
-#include <sal/log.hxx>
-#include <o3tl/sorted_vector.hxx>
#include <algorithm>
diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx
index dc7e5e6a7cbf..37b64c622d19 100644
--- a/sc/source/core/data/poolhelp.cxx
+++ b/sc/source/core/data/poolhelp.cxx
@@ -20,7 +20,6 @@
#include <comphelper/processfactory.hxx>
#include <svl/zforlist.hxx>
#include <editeng/editeng.hxx>
-#include <osl/diagnose.h>
#include <poolhelp.hxx>
#include <document.hxx>
diff --git a/sc/source/core/data/segmenttree.cxx b/sc/source/core/data/segmenttree.cxx
index 00033438e0f8..4ccf146a01c3 100644
--- a/sc/source/core/data/segmenttree.cxx
+++ b/sc/source/core/data/segmenttree.cxx
@@ -23,7 +23,6 @@
#include <sal/log.hxx>
#include <algorithm>
#include <limits>
-#include <address.hxx>
using ::std::numeric_limits;
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index d95ae658456b..d878070f64ea 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -20,7 +20,6 @@
#include <scitems.hxx>
#include <comphelper/string.hxx>
#include <editeng/boxitem.hxx>
-#include <editeng/editobj.hxx>
#include <editeng/editeng.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/escapementitem.hxx>
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 7ed29dd577bc..0a79b37612d8 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -24,6 +24,7 @@
#include <sfx2/app.hxx>
#include <sfx2/objsh.hxx>
+#include <sfx2/viewsh.hxx>
#include <basic/sbmeth.hxx>
#include <basic/sbmod.hxx>
#include <basic/sbstar.hxx>
@@ -50,7 +51,6 @@
#include <scmatrix.hxx>
#include <cellvalue.hxx>
#include <comphelper/lok.hxx>
-#include <sfx2/lokhelper.hxx>
#include <math.h>
#include <memory>
diff --git a/sc/source/core/inc/arraysumfunctor.hxx b/sc/source/core/inc/arraysumfunctor.hxx
index eb046fa9b293..fc198190860f 100644
--- a/sc/source/core/inc/arraysumfunctor.hxx
+++ b/sc/source/core/inc/arraysumfunctor.hxx
@@ -12,8 +12,10 @@
#define INCLUDED_SC_SOURCE_CORE_INC_ARRAYSUMFUNCTOR_HXX
#include <cstdint>
-#include <rtl/math.hxx>
+#include <cmath>
+#include <sal/mathconf.h>
+#include <sal/types.h>
#include <tools/simd.hxx>
#include <tools/cpuid.hxx>
diff --git a/sc/source/core/inc/grouptokenconverter.hxx b/sc/source/core/inc/grouptokenconverter.hxx
index 6f43f9b14cdf..499ced08cd79 100644
--- a/sc/source/core/inc/grouptokenconverter.hxx
+++ b/sc/source/core/inc/grouptokenconverter.hxx
@@ -10,7 +10,6 @@
#ifndef INCLUDED_SC_SOURCE_CORE_INC_GROUPTOKENCONVERTER_HXX
#define INCLUDED_SC_SOURCE_CORE_INC_GROUPTOKENCONVERTER_HXX
-#include <scdllapi.h>
#include <types.hxx>
#include <formulalogger.hxx>
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 4e986daf8453..18ed429aab99 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -25,7 +25,6 @@
#include <unotools/textsearch.hxx>
#include <formula/errorcodes.hxx>
#include <formula/tokenarray.hxx>
-#include <scdllapi.h>
#include <types.hxx>
#include <externalrefmgr.hxx>
#include <calcconfig.hxx>
diff --git a/sc/source/core/opencl/opinlinefun_math.hxx b/sc/source/core/opencl/opinlinefun_math.hxx
index ab9dc02efa67..9c53b9f38ca4 100644
--- a/sc/source/core/opencl/opinlinefun_math.hxx
+++ b/sc/source/core/opencl/opinlinefun_math.hxx
@@ -10,6 +10,8 @@
#ifndef INCLUDED_SC_SOURCE_CORE_OPENCL_OPINLINEFUN_MATH_HXX
#define INCLUDED_SC_SOURCE_CORE_OPENCL_OPINLINEFUN_MATH_HXX
+#include <string>
+
std::string Math_Intg_Str=
"\ndouble Intg(double n)\n\
{\n\
diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx
index aa6e15111808..df68a6ffe8da 100644
--- a/sc/source/core/tool/addincol.cxx
+++ b/sc/source/core/tool/addincol.cxx
@@ -29,6 +29,7 @@
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XSingleComponentFactory.hpp>
@@ -47,12 +48,9 @@
#include <addincol.hxx>
#include <addinhelpid.hxx>
-#include <compiler.hxx>
#include <scmatrix.hxx>
-#include <addinlis.hxx>
#include <formula/errorcodes.hxx>
#include <formula/funcvarargs.h>
-#include <sc.hrc>
#include <optutil.hxx>
#include <addincfg.hxx>
#include <scmod.hxx>
diff --git a/sc/source/core/tool/addinhelpid.cxx b/sc/source/core/tool/addinhelpid.cxx
index 832ce509197d..cad2ca675c87 100644
--- a/sc/source/core/tool/addinhelpid.cxx
+++ b/sc/source/core/tool/addinhelpid.cxx
@@ -18,7 +18,6 @@
*/
#include <addinhelpid.hxx>
-#include <sc.hrc>
#include <helpids.h>
// A struct containing the built-in function name and the built-in help ID.
diff --git a/sc/source/core/tool/addinlis.cxx b/sc/source/core/tool/addinlis.cxx
index f4ff197f9209..7a9f5d49fd64 100644
--- a/sc/source/core/tool/addinlis.cxx
+++ b/sc/source/core/tool/addinlis.cxx
@@ -24,7 +24,6 @@
#include <miscuno.hxx>
#include <document.hxx>
#include <brdcst.hxx>
-#include <sc.hrc>
#include <com/sun/star/sheet/XVolatileResult.hpp>
diff --git a/sc/source/core/tool/adiasync.cxx b/sc/source/core/tool/adiasync.cxx
index 8f8ded6d06f3..d8086e30c50d 100644
--- a/sc/source/core/tool/adiasync.cxx
+++ b/sc/source/core/tool/adiasync.cxx
@@ -25,9 +25,7 @@
#include <adiasync.hxx>
#include <brdcst.hxx>
-#include <global.hxx>
#include <document.hxx>
-#include <sc.hrc>
#include <osl/diagnose.h>
#include <osl/thread.h>
diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx
index d3b56af9679f..d71d59a3b66b 100644
--- a/sc/source/core/tool/appoptio.cxx
+++ b/sc/source/core/tool/appoptio.cxx
@@ -17,15 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <vcl/svapp.hxx>
-
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <appoptio.hxx>
-#include <rechead.hxx>
#include <global.hxx>
#include <userlist.hxx>
-#include <sc.hrc>
#include <formula/compiler.hxx>
#include <miscuno.hxx>
#include <memory>
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index 05c76541ae11..22d32a82597a 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -20,18 +20,14 @@
#include <memory>
#include <autoform.hxx>
-#include <sfx2/app.hxx>
#include <sfx2/docfile.hxx>
#include <unotools/pathoptions.hxx>
#include <svl/intitem.hxx>
#include <svl/itemset.hxx>
-#include <vcl/svapp.hxx>
#include <vcl/outdev.hxx>
#include <svx/algitem.hxx>
#include <svx/dialmgr.hxx>
-#include <svx/dialogs.hrc>
#include <svx/rotmodit.hxx>
-#include <svx/svxids.hrc>
#include <svx/strings.hrc>
#include <editeng/adjustitem.hxx>
#include <editeng/borderline.hxx>
@@ -55,6 +51,7 @@
#include <unotools/transliterationwrapper.hxx>
#include <tools/tenccvt.hxx>
#include <osl/diagnose.h>
+#include <osl/thread.hxx>
#include <attrib.hxx>
#include <globstr.hrc>
@@ -62,10 +59,6 @@
#include <scresid.hxx>
#include <document.hxx>
-#include <svl/legacyitem.hxx>
-#include <editeng/legacyitem.hxx>
-#include <svx/legacyitem.hxx>
-
/*
* XXX: BIG RED NOTICE! Changes MUST be binary file format compatible and MUST
* be synchronized with Writer's SwTableAutoFmtTbl sw/source/core/doc/tblafmt.cxx
diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx
index 9ef2ccf13098..4a8fb73b7dd9 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -8,22 +8,17 @@
*/
#include <ostream>
-#include <set>
#include <formula/FormulaCompiler.hxx>
#include <formula/grammar.hxx>
#include <formula/opcode.hxx>
#include <rtl/ustring.hxx>
#include <sal/log.hxx>
-#include <sfx2/objsh.hxx>
#include <unotools/configmgr.hxx>
#include <calcconfig.hxx>
-#include <compiler.hxx>
-#include <docsh.hxx>
#include <comphelper/configurationlistener.hxx>
-#include <com/sun/star/datatransfer/XTransferable2.hpp>
using comphelper::ConfigurationListener;
diff --git a/sc/source/core/tool/callform.cxx b/sc/source/core/tool/callform.cxx
index cbf8ae73a69f..07b07a46e005 100644
--- a/sc/source/core/tool/callform.cxx
+++ b/sc/source/core/tool/callform.cxx
@@ -22,8 +22,7 @@
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <osl/module.hxx>
-#include <osl/file.hxx>
-#include <unotools/transliterationwrapper.hxx>
+#include <i18nlangtag/languagetag.hxx>
#include <memory>
#include <callform.hxx>
diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx
index 315bc9ca2a2a..0f2daec655b1 100644
--- a/sc/source/core/tool/cellform.cxx
+++ b/sc/source/core/tool/cellform.cxx
@@ -19,7 +19,6 @@
#include <cellform.hxx>
-#include <sfx2/objsh.hxx>
#include <svl/zforlist.hxx>
#include <svl/sharedstring.hxx>
@@ -27,7 +26,6 @@
#include <document.hxx>
#include <cellvalue.hxx>
#include <formula/errorcodes.hxx>
-#include <sc.hrc>
#include <editutil.hxx>
void ScCellFormat::GetString( const ScRefCellValue& rCell, sal_uInt32 nFormat, OUString& rString,
diff --git a/sc/source/core/tool/cellkeytranslator.cxx b/sc/source/core/tool/cellkeytranslator.cxx
index 381a48a7e5c2..833f57d45aff 100644
--- a/sc/source/core/tool/cellkeytranslator.cxx
+++ b/sc/source/core/tool/cellkeytranslator.cxx
@@ -21,7 +21,6 @@
#include <global.hxx>
#include <cellkeytranslator.hxx>
#include <comphelper/processfactory.hxx>
-#include <i18nlangtag/mslangid.hxx>
#include <i18nlangtag/lang.h>
#include <i18nutil/transliteration.hxx>
#include <rtl/ustring.hxx>
diff --git a/sc/source/core/tool/chartarr.cxx b/sc/source/core/tool/chartarr.cxx
index 7b4637bc5b6e..21be72e4d37c 100644
--- a/sc/source/core/tool/chartarr.cxx
+++ b/sc/source/core/tool/chartarr.cxx
@@ -17,15 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <scitems.hxx>
-#include <svl/intitem.hxx>
-#include <svl/zforlist.hxx>
#include <float.h>
#include <chartarr.hxx>
#include <cellvalue.hxx>
#include <document.hxx>
-#include <rechead.hxx>
#include <globstr.hrc>
#include <scresid.hxx>
#include <formulacell.hxx>
diff --git a/sc/source/core/tool/chartlock.cxx b/sc/source/core/tool/chartlock.cxx
index f1ecef38df5e..2ac1a3759ad7 100644
--- a/sc/source/core/tool/chartlock.cxx
+++ b/sc/source/core/tool/chartlock.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <vcl/svapp.hxx>
#include <svx/svditer.hxx>
#include <svx/svdoole2.hxx>
#include <svx/svdpage.hxx>
diff --git a/sc/source/core/tool/chartpos.cxx b/sc/source/core/tool/chartpos.cxx
index 1d2cdc53f018..48e734ec2454 100644
--- a/sc/source/core/tool/chartpos.cxx
+++ b/sc/source/core/tool/chartpos.cxx
@@ -19,7 +19,6 @@
#include <chartpos.hxx>
#include <document.hxx>
-#include <rechead.hxx>
#include <osl/diagnose.h>
#include <memory>
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index bd40a24b3eb5..86be82346c47 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -23,8 +23,6 @@
#include <document.hxx>
#include <dociter.hxx>
#include <global.hxx>
-#include <rechead.hxx>
-#include <scerrors.hxx>
#include <scmod.hxx>
#include <inputopt.hxx>
#include <patattr.hxx>
@@ -39,18 +37,12 @@
#include <osl/diagnose.h>
#include <svl/zforlist.hxx>
-#include <svl/itemset.hxx>
-#include <svl/isethint.hxx>
-#include <svl/itempool.hxx>
-#include <sfx2/app.hxx>
#include <sfx2/objsh.hxx>
#include <unotools/useroptions.hxx>
#include <unotools/datetime.hxx>
-#include <sfx2/sfxsids.hrc>
#include <tools/json_writer.hxx>
#include <algorithm>
#include <memory>
-#include <boost/property_tree/json_parser.hpp>
ScChangeAction::ScChangeAction( ScChangeActionType eTypeP, const ScRange& rRange )
:
diff --git a/sc/source/core/tool/chgviset.cxx b/sc/source/core/tool/chgviset.cxx
index 8913e14c53ef..0baf60a334a2 100644
--- a/sc/source/core/tool/chgviset.cxx
+++ b/sc/source/core/tool/chgviset.cxx
@@ -20,7 +20,6 @@
#include <unotools/textsearch.hxx>
#include <chgviset.hxx>
-#include <rechead.hxx>
#include <chgtrack.hxx>
#include <document.hxx>
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index e4fdbba4aae1..c35f809197c2 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -29,12 +29,10 @@
#include <basic/sbstar.hxx>
#include <svl/zforlist.hxx>
#include <svl/sharedstringpool.hxx>
-#include <sal/macros.h>
#include <sal/log.hxx>
#include <o3tl/safeint.hxx>
#include <osl/diagnose.h>
#include <rtl/character.hxx>
-#include <tools/solar.h>
#include <unotools/charclass.hxx>
#include <unotools/configmgr.hxx>
#include <com/sun/star/lang/Locale.hpp>
@@ -49,7 +47,6 @@
#include <rtl/math.hxx>
#include <rtl/ustring.hxx>
#include <stdlib.h>
-#include <string.h>
#include <math.h>
#include <rangenam.hxx>
#include <dbdata.hxx>
@@ -57,7 +54,6 @@
#include <callform.hxx>
#include <addincol.hxx>
#include <refupdat.hxx>
-#include <sc.hrc>
#include <globstr.hrc>
#include <scresid.hxx>
#include <formulacell.hxx>
diff --git a/sc/source/core/tool/consoli.cxx b/sc/source/core/tool/consoli.cxx
index 7b02c05c2fb5..be29bbb4a7f9 100644
--- a/sc/source/core/tool/consoli.cxx
+++ b/sc/source/core/tool/consoli.cxx
@@ -27,7 +27,6 @@
#include <osl/diagnose.h>
#include <refdata.hxx>
-#include <math.h>
#include <string.h>
#include <memory>
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 5a6a28448579..9f8b68215856 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -27,7 +27,6 @@
#include <dbdata.hxx>
#include <globalnames.hxx>
#include <refupdat.hxx>
-#include <rechead.hxx>
#include <document.hxx>
#include <queryparam.hxx>
#include <queryentry.hxx>
diff --git a/sc/source/core/tool/defaultsoptions.cxx b/sc/source/core/tool/defaultsoptions.cxx
index b82197471c4c..75636dc36408 100644
--- a/sc/source/core/tool/defaultsoptions.cxx
+++ b/sc/source/core/tool/defaultsoptions.cxx
@@ -11,10 +11,6 @@
#include <osl/diagnose.h>
#include <defaultsoptions.hxx>
-#include <miscuno.hxx>
-#include <global.hxx>
-#include <attrib.hxx>
-#include <scitems.hxx>
#include <globstr.hrc>
#include <scresid.hxx>
#include <sc.hrc>
diff --git a/sc/source/core/tool/detdata.cxx b/sc/source/core/tool/detdata.cxx
index f64dc49d66fd..feacceca6e28 100644
--- a/sc/source/core/tool/detdata.cxx
+++ b/sc/source/core/tool/detdata.cxx
@@ -21,7 +21,6 @@
#include <memory>
#include <detdata.hxx>
#include <refupdat.hxx>
-#include <rechead.hxx>
ScDetOpList::ScDetOpList(const ScDetOpList& rList) :
bHasAddError( false )
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index 1fa94abe635c..3db72b4d6f71 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -20,7 +20,6 @@
#include <scitems.hxx>
#include <svtools/colorcfg.hxx>
#include <editeng/eeitem.hxx>
-#include <editeng/outlobj.hxx>
#include <formula/errorcodes.hxx>
#include <svx/sdshitm.hxx>
#include <svx/sdsxyitm.hxx>
@@ -42,13 +41,9 @@
#include <svx/xlnstit.hxx>
#include <svx/xlnstwit.hxx>
#include <svx/xlnwtit.hxx>
-#include <svx/xtable.hxx>
#include <svx/sdtagitm.hxx>
-#include <editeng/outliner.hxx>
-#include <editeng/editobj.hxx>
#include <svx/sxcecitm.hxx>
#include <svl/whiter.hxx>
-#include <editeng/writingmodeitem.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
@@ -63,10 +58,8 @@
#include <formulacell.hxx>
#include <docpool.hxx>
#include <patattr.hxx>
-#include <attrib.hxx>
#include <scmod.hxx>
#include <postit.hxx>
-#include <rangelst.hxx>
#include <reftokenhelper.hxx>
#include <formulaiter.hxx>
#include <cellvalue.hxx>
diff --git a/sc/source/core/tool/docoptio.cxx b/sc/source/core/tool/docoptio.cxx
index 5d289f416631..a93d114ff797 100644
--- a/sc/source/core/tool/docoptio.cxx
+++ b/sc/source/core/tool/docoptio.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <vcl/svapp.hxx>
#include <svl/zforlist.hxx>
#include <osl/diagnose.h>
@@ -25,8 +24,6 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <docoptio.hxx>
-#include <rechead.hxx>
-#include <sc.hrc>
#include <miscuno.hxx>
#include <global.hxx>
diff --git a/sc/source/core/tool/doubleref.cxx b/sc/source/core/tool/doubleref.cxx
index 267f762dd311..a6c439c1c934 100644
--- a/sc/source/core/tool/doubleref.cxx
+++ b/sc/source/core/tool/doubleref.cxx
@@ -18,7 +18,6 @@
*/
#include <doubleref.hxx>
-#include <formulacell.hxx>
#include <global.hxx>
#include <document.hxx>
#include <queryparam.hxx>
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index d415e0806511..523c92e275d2 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -23,17 +23,13 @@
#include <svx/algitem.hxx>
#include <svtools/colorcfg.hxx>
-#include <editeng/editview.hxx>
#include <editeng/editstat.hxx>
-#include <editeng/escapementitem.hxx>
#include <editeng/flditem.hxx>
#include <editeng/numitem.hxx>
#include <editeng/justifyitem.hxx>
#include <editeng/editobj.hxx>
-#include <vcl/svapp.hxx>
#include <vcl/outdev.hxx>
#include <svl/inethist.hxx>
-#include <unotools/syslocale.hxx>
#include <sfx2/objsh.hxx>
#include <osl/diagnose.h>
diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx
index 76b29ea9ca3b..dacf97899839 100644
--- a/sc/source/core/tool/formulagroup.cxx
+++ b/sc/source/core/tool/formulagroup.cxx
@@ -13,21 +13,13 @@
#include <formulagroupcl.hxx>
#include <document.hxx>
#include <formulacell.hxx>
-#include <tokenarray.hxx>
-#include <compiler.hxx>
#include <interpre.hxx>
-#include <scmatrix.hxx>
#include <globalnames.hxx>
-#include <comphelper/threadpool.hxx>
-#include <tools/cpuid.hxx>
-#include <formula/vectortoken.hxx>
#include <officecfg/Office/Common.hxx>
-#include <officecfg/Office/Calc.hxx>
#if HAVE_FEATURE_OPENCL
#include <opencl/platforminfo.hxx>
#endif
-#include <rtl/bootstrap.hxx>
#include <sal/log.hxx>
#include <cstdio>
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx
index 60b3bde9f176..7305c3d550e6 100644
--- a/sc/source/core/tool/formulaopt.cxx
+++ b/sc/source/core/tool/formulaopt.cxx
@@ -13,7 +13,6 @@
#include <sal/log.hxx>
#include <unotools/localedatawrapper.hxx>
#include <formulaopt.hxx>
-#include <miscuno.hxx>
#include <global.hxx>
#include <formulagroup.hxx>
#include <sc.hrc>
diff --git a/sc/source/core/tool/inputopt.cxx b/sc/source/core/tool/inputopt.cxx
index 380c4391f307..d54ab975b14c 100644
--- a/sc/source/core/tool/inputopt.cxx
+++ b/sc/source/core/tool/inputopt.cxx
@@ -22,9 +22,7 @@
#include <osl/diagnose.h>
#include <inputopt.hxx>
-#include <rechead.hxx>
#include <global.hxx>
-#include <sc.hrc>
#include <miscuno.hxx>
using namespace utl;
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 507a7aeb2eef..95185b71aa19 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -24,7 +24,6 @@
#include <editeng/justifyitem.hxx>
#include <o3tl/safeint.hxx>
#include <osl/thread.h>
-#include <svx/algitem.hxx>
#include <unotools/textsearch.hxx>
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
@@ -57,22 +56,18 @@
#include <rangeutl.hxx>
#include <compiler.hxx>
#include <externalrefmgr.hxx>
-#include <basic/sbstar.hxx>
#include <doubleref.hxx>
#include <queryparam.hxx>
#include <queryentry.hxx>
#include <tokenarray.hxx>
#include <compare.hxx>
-#include <com/sun/star/util/SearchResult.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/random.hxx>
#include <comphelper/string.hxx>
#include <svl/sharedstringpool.hxx>
#include <stdlib.h>
-#include <string.h>
-#include <math.h>
#include <vector>
#include <memory>
#include <limits>
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index f917e40acae2..2effe4baee9a 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -22,28 +22,22 @@
#include <comphelper/string.hxx>
#include <o3tl/float_int_conversion.hxx>
+#include <sfx2/bindings.hxx>
#include <sfx2/linkmgr.hxx>
-#include <sfx2/dispatch.hxx>
#include <sfx2/objsh.hxx>
-#include <svl/stritem.hxx>
#include <svl/zforlist.hxx>
-#include <svl/sharedstringpool.hxx>
#include <sal/macros.h>
#include <osl/diagnose.h>
-#include <attrib.hxx>
#include <sc.hrc>
#include <ddelink.hxx>
#include <scmatrix.hxx>
-#include <compiler.hxx>
#include <formulacell.hxx>
#include <document.hxx>
#include <dociter.hxx>
-#include <docoptio.hxx>
#include <unitconv.hxx>
#include <hints.hxx>
#include <dpobject.hxx>
-#include <postit.hxx>
#include <tokenarray.hxx>
#include <globalnames.hxx>
#include <stlsheet.hxx>
@@ -51,9 +45,7 @@
#include <com/sun/star/sheet/DataPilotFieldFilter.hpp>
-#include <limits>
#include <string.h>
-#include <math.h>
using ::std::vector;
using namespace com::sun::star;
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index f17e72ae0287..ebf77f67a353 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -19,12 +19,9 @@
#include <tools/solar.h>
#include <stdlib.h>
-#include <string.h>
#include <interpre.hxx>
#include <global.hxx>
-#include <compiler.hxx>
-#include <formulacell.hxx>
#include <document.hxx>
#include <dociter.hxx>
#include <matrixoperators.hxx>
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index b9d34cd080a6..32dbd589e3ae 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -21,13 +21,10 @@
#include <interpre.hxx>
-#include <rangelst.hxx>
#include <o3tl/safeint.hxx>
#include <rtl/math.hxx>
#include <sfx2/app.hxx>
-#include <sfx2/docfile.hxx>
#include <sfx2/objsh.hxx>
-#include <sfx2/docfilt.hxx>
#include <basic/sbmeth.hxx>
#include <basic/sbmod.hxx>
#include <basic/sbstar.hxx>
@@ -39,7 +36,6 @@
#include <unotools/charclass.hxx>
#include <stdlib.h>
#include <string.h>
-#include <signal.h>
#include <com/sun/star/table/XCellRange.hpp>
#include <com/sun/star/script/XInvocation.hpp>
@@ -55,7 +51,6 @@
#include <docoptio.hxx>
#include <scmatrix.hxx>
#include <adiasync.hxx>
-#include <sc.hrc>
#include <cellsuno.hxx>
#include <optuno.hxx>
#include <rangeseq.hxx>
@@ -70,14 +65,11 @@
#include <tokenarray.hxx>
#include <compiler.hxx>
-#include <math.h>
-#include <float.h>
#include <map>
#include <algorithm>
#include <basic/basmgr.hxx>
#include <vbahelper/vbaaccesshelper.hxx>
#include <memory>
-#include <stack>
using namespace com::sun::star;
using namespace formula;
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index 3930de33ba2e..08bd2fcfc998 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -30,7 +30,6 @@
#include <interpre.hxx>
#include <global.hxx>
-#include <compiler.hxx>
#include <formulacell.hxx>
#include <document.hxx>
#include <dociter.hxx>
diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx
index 57c0a89fb84d..f506b9f04753 100644
--- a/sc/source/core/tool/interpr6.cxx
+++ b/sc/source/core/tool/interpr6.cxx
@@ -23,7 +23,7 @@
#include <document.hxx>
#include <cellvalue.hxx>
#include <dociter.hxx>
-#include <mtvcellfunc.hxx>
+#include <mtvfunctions.hxx>
#include <scmatrix.hxx>
#include <arraysumfunctor.hxx>
diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx
index fbc403db56a7..acdea080b7b0 100644
--- a/sc/source/core/tool/interpr7.cxx
+++ b/sc/source/core/tool/interpr7.cxx
@@ -18,10 +18,6 @@
#include <sfx2/linkmgr.hxx>
#include <tools/urlobj.hxx>
-#include <com/sun/star/ucb/XSimpleFileAccess3.hpp>
-#include <com/sun/star/ucb/SimpleFileAccess.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-
#include <officecfg/Office/Common.hxx>
#include <libxml/xpath.h>
#include <datastreamgettime.hxx>
diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index 19cdd7eac3cb..98a0551c5261 100644
--- a/sc/source/core/tool/interpr8.cxx
+++ b/sc/source/core/tool/interpr8.cxx
@@ -9,14 +9,12 @@
*/
#include <interpre.hxx>
-#include <global.hxx>
-#include <dociter.hxx>
+#include <cellvalue.hxx>
#include <scmatrix.hxx>
#include <comphelper/random.hxx>
#include <formula/token.hxx>
#include <sal/log.hxx>
-#include <stack>
#include <cmath>
#include <memory>
#include <vector>
diff --git a/sc/source/core/tool/jumpmatrix.cxx b/sc/source/core/tool/jumpmatrix.cxx
index e06cfcad900b..868d5da655f9 100644
--- a/sc/source/core/tool/jumpmatrix.cxx
+++ b/sc/source/core/tool/jumpmatrix.cxx
@@ -19,7 +19,6 @@
#include <jumpmatrix.hxx>
#include <scmatrix.hxx>
-#include <tools/solar.h>
#include <osl/diagnose.h>
namespace {
diff --git a/sc/source/core/tool/matrixoperators.cxx b/sc/source/core/tool/matrixoperators.cxx
index c42062b932a2..31cf6d96b2df 100644
--- a/sc/source/core/tool/matrixoperators.cxx
+++ b/sc/source/core/tool/matrixoperators.cxx
@@ -7,7 +7,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include <functional>
#include <matrixoperators.hxx>
diff --git a/sc/source/core/tool/numformat.cxx b/sc/source/core/tool/numformat.cxx
index ce3df323f80d..4a5403a7185e 100644
--- a/sc/source/core/tool/numformat.cxx
+++ b/sc/source/core/tool/numformat.cxx
@@ -19,13 +19,11 @@
#include <numformat.hxx>
#include <patattr.hxx>
-#include <scitems.hxx>
#include <document.hxx>
#include <comphelper/processfactory.hxx>
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
-#include <svl/intitem.hxx>
#include <svl/languageoptions.hxx>
namespace sc {
diff --git a/sc/source/core/tool/optutil.cxx b/sc/source/core/tool/optutil.cxx
index f445c20a9c06..71ae002b6d95 100644
--- a/sc/source/core/tool/optutil.cxx
+++ b/sc/source/core/tool/optutil.cxx
@@ -17,11 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <vcl/svapp.hxx>
#include <optutil.hxx>
#include <global.hxx>
#include <unotools/configmgr.hxx>
-#include <unotools/syslocale.hxx>
#include <unotools/localedatawrapper.hxx>
bool ScOptionsUtil::IsMetricSystem()
diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx
index 9764141a08db..8dd39016cb48 100644
--- a/sc/source/core/tool/parclass.cxx
+++ b/sc/source/core/tool/parclass.cxx
@@ -18,14 +18,12 @@
*/
#include <parclass.hxx>
-#include <token.hxx>
#include <global.hxx>
#include <callform.hxx>
#include <addincol.hxx>
-#include <funcdesc.hxx>
+#include <formula/token.hxx>
#include <unotools/charclass.hxx>
#include <osl/diagnose.h>
-#include <sal/macros.h>
#include <sal/log.hxx>
#include <string.h>
diff --git a/sc/source/core/tool/prnsave.cxx b/sc/source/core/tool/prnsave.cxx
index c07eda00f9ed..d6df22d5ce6a 100644
--- a/sc/source/core/tool/prnsave.cxx
+++ b/sc/source/core/tool/prnsave.cxx
@@ -18,7 +18,6 @@
*/
#include <prnsave.hxx>
-#include <global.hxx>
#include <address.hxx>
#include <osl/diagnose.h>
diff --git a/sc/source/core/tool/progress.cxx b/sc/source/core/tool/progress.cxx
index ae1c96cab5e3..2a187f8aa603 100644
--- a/sc/source/core/tool/progress.cxx
+++ b/sc/source/core/tool/progress.cxx
@@ -31,7 +31,6 @@
#define SC_PROGRESS_CXX
#include <progress.hxx>
#include <document.hxx>
-#include <global.hxx>
#include <globstr.hrc>
#include <scresid.hxx>
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index c49e9694c0c8..f87b5027319a 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -19,13 +19,11 @@
#include <stdlib.h>
#include <unotools/collatorwrapper.hxx>
-#include <osl/diagnose.h>
#include <sal/log.hxx>
#include <rangelst.hxx>
#include <document.hxx>
#include <refupdat.hxx>
-#include <rechead.hxx>
#include <compiler.hxx>
#include <algorithm>
#include <memory>
diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx
index 314a899098fc..6779ffa023b9 100644
--- a/sc/source/core/tool/rangenam.cxx
+++ b/sc/source/core/tool/rangenam.cxx
@@ -20,7 +20,6 @@
#include <string.h>
#include <memory>
#include <unotools/collatorwrapper.hxx>
-#include <unotools/transliterationwrapper.hxx>
#include <unotools/charclass.hxx>
#include <com/sun/star/sheet/NamedRangeFlag.hpp>
#include <osl/diagnose.h>
@@ -30,8 +29,6 @@
#include <rangenam.hxx>
#include <global.hxx>
#include <compiler.hxx>
-#include <rangeutl.hxx>
-#include <rechead.hxx>
#include <refupdat.hxx>
#include <document.hxx>
#include <refupdatecontext.hxx>
diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx
index 3a1693edebfc..9b587ef5732d 100644
--- a/sc/source/core/tool/refupdat.cxx
+++ b/sc/source/core/tool/refupdat.cxx
@@ -19,9 +19,8 @@
#include <refupdat.hxx>
#include <document.hxx>
-#include <compiler.hxx>
#include <bigrange.hxx>
-#include <chgtrack.hxx>
+#include <refdata.hxx>
#include <osl/diagnose.h>
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index eb392609a806..a8874824da2f 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -17,12 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <arraysumfunctor.hxx>
#include <scmatrix.hxx>
#include <global.hxx>
#include <address.hxx>
#include <formula/errorcodes.hxx>
-#include <formula/vectortoken.hxx>
#include <interpre.hxx>
#include <mtvelements.hxx>
#include <compare.hxx>
@@ -31,20 +29,16 @@
#include <svl/zforlist.hxx>
#include <svl/sharedstring.hxx>
-#include <tools/stream.hxx>
#include <rtl/math.hxx>
#include <sal/log.hxx>
#include <osl/diagnose.h>
-#include <math.h>
-
#include <memory>
#include <vector>
#include <limits>
#include <mdds/multi_type_matrix.hpp>
#include <mdds/multi_type_vector_types.hpp>
-#include <mdds/multi_type_vector_trait.hpp>
#if DEBUG_MATRIX
#include <iostream>
diff --git a/sc/source/core/tool/scopetools.cxx b/sc/source/core/tool/scopetools.cxx
index 0da9d1061ce8..679e613730cb 100644
--- a/sc/source/core/tool/scopetools.cxx
+++ b/sc/source/core/tool/scopetools.cxx
@@ -10,7 +10,6 @@
#include <scopetools.hxx>
#include <document.hxx>
#include <column.hxx>
-#include <vcl/window.hxx>
namespace sc {
diff --git a/sc/source/core/tool/stringutil.cxx b/sc/source/core/tool/stringutil.cxx
index 685793b3a18a..1a96df899b69 100644
--- a/sc/source/core/tool/stringutil.cxx
+++ b/sc/source/core/tool/stringutil.cxx
@@ -18,7 +18,6 @@
*/
#include <stringutil.hxx>
-#include <global.hxx>
#include <svl/zforlist.hxx>
#include <rtl/ustrbuf.hxx>
diff --git a/sc/source/core/tool/stylehelper.cxx b/sc/source/core/tool/stylehelper.cxx
index 36a1ae8ddebd..88a7c77f7f5c 100644
--- a/sc/source/core/tool/stylehelper.cxx
+++ b/sc/source/core/tool/stylehelper.cxx
@@ -21,7 +21,6 @@
#include <osl/diagnose.h>
#include <stylehelper.hxx>
-#include <global.hxx>
#include <globstr.hrc>
#include <scresid.hxx>
diff --git a/sc/source/core/tool/subtotal.cxx b/sc/source/core/tool/subtotal.cxx
index 9676553a8e28..4c213893b14d 100644
--- a/sc/source/core/tool/subtotal.cxx
+++ b/sc/source/core/tool/subtotal.cxx
@@ -18,7 +18,7 @@
*/
#include <subtotal.hxx>
-#include <interpre.hxx>
+#include <sal/mathconf.h>
#include <cfloat>
bool SubTotal::SafePlus(double& fVal1, double fVal2)
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 859b44327a78..df968b26a4fb 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -17,15 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <cstddef>
-#include <cstdio>
#include <functional>
#include <string.h>
#include <osl/diagnose.h>
#include <sal/log.hxx>
-#include <sfx2/docfile.hxx>
-#include <officecfg/Office/Calc.hxx>
#include <token.hxx>
#include <tokenarray.hxx>
@@ -35,11 +31,7 @@
#include <interpre.hxx>
#include <formula/FormulaCompiler.hxx>
#include <formula/compiler.hxx>
-#include <formula/grammar.hxx>
#include <formula/opcode.hxx>
-#include <formulagroup.hxx>
-#include <rechead.hxx>
-#include <parclass.hxx>
#include <jumpmatrix.hxx>
#include <rangeseq.hxx>
#include <externalrefmgr.hxx>
diff --git a/sc/source/core/tool/unitconv.cxx b/sc/source/core/tool/unitconv.cxx
index 4068fcb14bbd..41d3d4f82586 100644
--- a/sc/source/core/tool/unitconv.cxx
+++ b/sc/source/core/tool/unitconv.cxx
@@ -21,7 +21,7 @@
#include <unitconv.hxx>
#include <global.hxx>
-#include <viewopti.hxx>
+#include <optutil.hxx>
using namespace utl;
using namespace com::sun::star::uno;
diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx
index 4facfde96b8f..01815baacce2 100644
--- a/sc/source/core/tool/userlist.cxx
+++ b/sc/source/core/tool/userlist.cxx
@@ -23,8 +23,8 @@
#include <global.hxx>
#include <userlist.hxx>
#include <unotools/localedatawrapper.hxx>
-#include <unotools/calendarwrapper.hxx>
#include <unotools/transliterationwrapper.hxx>
+#include <com/sun/star/i18n/Calendar2.hpp>
#include <algorithm>
diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx
index 6db6e9b73d9b..3678e1866a17 100644
--- a/sc/source/core/tool/viewopti.cxx
+++ b/sc/source/core/tool/viewopti.cxx
@@ -17,17 +17,13 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <vcl/svapp.hxx>
#include <osl/diagnose.h>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <global.hxx>
-#include <globstr.hrc>
-#include <scresid.hxx>
#include <viewopti.hxx>
-#include <rechead.hxx>
#include <sc.hrc>
#include <miscuno.hxx>
diff --git a/sc/source/core/tool/webservicelink.cxx b/sc/source/core/tool/webservicelink.cxx
index f5e621867d16..12fe4785ebca 100644
--- a/sc/source/core/tool/webservicelink.cxx
+++ b/sc/source/core/tool/webservicelink.cxx
@@ -8,7 +8,6 @@
*/
#include <comphelper/processfactory.hxx>
-#include <osl/thread.h>
#include <sfx2/linkmgr.hxx>
#include <sfx2/bindings.hxx>
@@ -19,12 +18,7 @@
#include <webservicelink.hxx>
#include <brdcst.hxx>
#include <document.hxx>
-#include <scmatrix.hxx>
-#include <patattr.hxx>
-#include <rechead.hxx>
-#include <rangeseq.hxx>
#include <sc.hrc>
-#include <hints.hxx>
ScWebServiceLink::ScWebServiceLink(ScDocument* pD, const OUString& rURL)
: ::sfx2::SvBaseLink(SfxLinkUpdateMode::ALWAYS, SotClipboardFormatId::STRING)
diff --git a/sc/source/core/tool/zforauto.cxx b/sc/source/core/tool/zforauto.cxx
index 00691f6c6059..dec49451be22 100644
--- a/sc/source/core/tool/zforauto.cxx
+++ b/sc/source/core/tool/zforauto.cxx
@@ -24,7 +24,6 @@
#include <osl/diagnose.h>
#include <zforauto.hxx>
-#include <global.hxx>
#include <tools/stream.hxx>
ScNumFormatAbbrev::ScNumFormatAbbrev() :
diff --git a/sc/source/filter/excel/xeextlst.cxx b/sc/source/filter/excel/xeextlst.cxx
index cca940350173..35afd9570853 100644
--- a/sc/source/filter/excel/xeextlst.cxx
+++ b/sc/source/filter/excel/xeextlst.cxx
@@ -9,8 +9,6 @@
#include <xeextlst.hxx>
#include <xeroot.hxx>
-#include <stlsheet.hxx>
-#include <ftools.hxx>
#include <xestyle.hxx>
#include <stlpool.hxx>
#include <scitems.hxx>
@@ -19,7 +17,6 @@
#include <oox/export/utils.hxx>
#include <oox/token/namespaces.hxx>
-#include <comphelper/processfactory.hxx>
using namespace ::oox;
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index a43c612e3e23..b0ea61b1fc36 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <utility>
diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx
index b55a446b08a5..0355a56afafd 100644
--- a/sc/source/filter/excel/xlchart.cxx
+++ b/sc/source/filter/excel/xlchart.cxx
@@ -37,8 +37,8 @@
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <rtl/math.hxx>
#include <sal/macros.h>
+#include <sal/mathconf.h>
#include <svl/itemset.hxx>
#include <svx/xfillit0.hxx>
#include <svx/xflclit.hxx>
diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx
index e1813a10d82a..17027dd11756 100644
--- a/sc/source/filter/ftools/ftools.cxx
+++ b/sc/source/filter/ftools/ftools.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <memory>
#include <ftools.hxx>
#include <osl/diagnose.h>
#include <osl/thread.h>
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 3984d7f393fd..d66f9e3bdd69 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -37,7 +37,6 @@
#include <sfx2/docfile.hxx>
#include <sfx2/frmhtmlw.hxx>
#include <sfx2/objsh.hxx>
-#include <svl/stritem.hxx>
#include <svl/urihelper.hxx>
#include <svtools/htmlkywd.hxx>
#include <svtools/htmlout.hxx>
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index 315d180b82af..0fa8aa59caac 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -37,7 +37,6 @@
#include <editeng/boxitem.hxx>
#include <editeng/justifyitem.hxx>
#include <sfx2/objsh.hxx>
-#include <svl/eitem.hxx>
#include <svl/intitem.hxx>
#include <vcl/graphicfilter.hxx>
#include <svtools/parhtml.hxx>
diff --git a/sc/source/filter/inc/condformatbuffer.hxx b/sc/source/filter/inc/condformatbuffer.hxx
index 6ce5b7f654c2..d8c60dad324d 100644
--- a/sc/source/filter/inc/condformatbuffer.hxx
+++ b/sc/source/filter/inc/condformatbuffer.hxx
@@ -22,6 +22,7 @@
#include "worksheethelper.hxx"
#include <tools/color.hxx>
+#include <colorscale.hxx>
#include <conditio.hxx>
#include <rangelst.hxx>
diff --git a/sc/source/filter/inc/eeparser.hxx b/sc/source/filter/inc/eeparser.hxx
index 68183e84b2f7..bb330b86be38 100644
--- a/sc/source/filter/inc/eeparser.hxx
+++ b/sc/source/filter/inc/eeparser.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SC_SOURCE_FILTER_INC_EEPARSER_HXX
#include <tools/gen.hxx>
+#include <vcl/errcode.hxx>
#include <vcl/graph.hxx>
#include <svl/itemset.hxx>
#include <editeng/editdata.hxx>
diff --git a/sc/source/filter/inc/exp_op.hxx b/sc/source/filter/inc/exp_op.hxx
index 9273e749264c..8c7444a8ee48 100644
--- a/sc/source/filter/inc/exp_op.hxx
+++ b/sc/source/filter/inc/exp_op.hxx
@@ -20,6 +20,7 @@
#ifndef INCLUDED_SC_SOURCE_FILTER_INC_EXP_OP_HXX
#define INCLUDED_SC_SOURCE_FILTER_INC_EXP_OP_HXX
+#include <tools/stream.hxx>
#include <memory>
#include "xeroot.hxx"
diff --git a/sc/source/filter/inc/lotrange.hxx b/sc/source/filter/inc/lotrange.hxx
index 2e73f43a192c..345ad3635bc4 100644
--- a/sc/source/filter/inc/lotrange.hxx
+++ b/sc/source/filter/inc/lotrange.hxx
@@ -23,6 +23,8 @@
#include <refdata.hxx>
#include <types.hxx>
+#include <memory>
+
typedef sal_uInt16 LR_ID;
#define ID_FAIL 0xFFFF
diff --git a/sc/source/filter/inc/root.hxx b/sc/source/filter/inc/root.hxx
index a41b22b2128b..8de0c80475f4 100644
--- a/sc/source/filter/inc/root.hxx
+++ b/sc/source/filter/inc/root.hxx
@@ -20,7 +20,6 @@
#ifndef INCLUDED_SC_SOURCE_FILTER_INC_ROOT_HXX
#define INCLUDED_SC_SOURCE_FILTER_INC_ROOT_HXX
-#include <address.hxx>
#include "flttypes.hxx"
#include <memory>
diff --git a/sc/source/filter/inc/scfobj.hxx b/sc/source/filter/inc/scfobj.hxx
index 84824ae4b741..0dbcb045110c 100644
--- a/sc/source/filter/inc/scfobj.hxx
+++ b/sc/source/filter/inc/scfobj.hxx
@@ -20,6 +20,8 @@
#ifndef INCLUDED_SC_SOURCE_FILTER_INC_SCFOBJ_HXX
#define INCLUDED_SC_SOURCE_FILTER_INC_SCFOBJ_HXX
+#include <types.hxx>
+
class ScDocument;
namespace tools { class Rectangle; }
diff --git a/sc/source/filter/inc/sharedformulagroups.hxx b/sc/source/filter/inc/sharedformulagroups.hxx
index ae45f07a53e2..fde70b0ac7b6 100644
--- a/sc/source/filter/inc/sharedformulagroups.hxx
+++ b/sc/source/filter/inc/sharedformulagroups.hxx
@@ -11,6 +11,7 @@
#define INCLUDED_SC_SOURCE_FILTER_INC_SHAREDFORMULAGROUPS_HXX
#include <address.hxx>
+#include <tokenarray.hxx>
#include <memory>
#include <map>
class ScTokenArray;
diff --git a/sc/source/filter/inc/tool.h b/sc/source/filter/inc/tool.h
index 1d9559d73b2e..7c5f2b3f88f0 100644
--- a/sc/source/filter/inc/tool.h
+++ b/sc/source/filter/inc/tool.h
@@ -20,6 +20,8 @@
#ifndef INCLUDED_SC_SOURCE_FILTER_INC_TOOL_H
#define INCLUDED_SC_SOURCE_FILTER_INC_TOOL_H
+#include <document.hxx>
+
#include <i18nlangtag/lang.h>
#include <svl/intitem.hxx>
#include <types.hxx>
diff --git a/sc/source/filter/inc/xehelper.hxx b/sc/source/filter/inc/xehelper.hxx
index a92c1a8e65bd..7369b9925643 100644
--- a/sc/source/filter/inc/xehelper.hxx
+++ b/sc/source/filter/inc/xehelper.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SC_SOURCE_FILTER_INC_XEHELPER_HXX
#include <memory>
+#include "ftools.hxx"
#include <rangelst.hxx>
#include "xladdress.hxx"
#include "xeroot.hxx"
diff --git a/sc/source/filter/inc/xerecord.hxx b/sc/source/filter/inc/xerecord.hxx
index b18fa735d258..3cf57b25b2d7 100644
--- a/sc/source/filter/inc/xerecord.hxx
+++ b/sc/source/filter/inc/xerecord.hxx
@@ -25,7 +25,6 @@
#include "xlstream.hxx"
#include <salhelper/simplereferenceobject.hxx>
#include <rtl/ref.hxx>
-#include <type_traits>
// Base classes to export Excel records =======================================
diff --git a/sc/source/filter/inc/xestring.hxx b/sc/source/filter/inc/xestring.hxx
index fd0d9fadaac1..9dfbe4be2b90 100644
--- a/sc/source/filter/inc/xestring.hxx
+++ b/sc/source/filter/inc/xestring.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SC_SOURCE_FILTER_INC_XESTRING_HXX
#include "xlstring.hxx"
+#include "ftools.hxx"
class XclExpStream;
class XclExpXmlStream;
diff --git a/sc/source/filter/inc/xestyle.hxx b/sc/source/filter/inc/xestyle.hxx
index de6bd2cb9b78..088f2760e092 100644
--- a/sc/source/filter/inc/xestyle.hxx
+++ b/sc/source/filter/inc/xestyle.hxx
@@ -30,7 +30,6 @@
#include <fonthelper.hxx>
#include <memory>
#include <vector>
-#include <o3tl/sorted_vector.hxx>
/* ============================================================================
- Buffers for style records (PALETTE, FONT, FORMAT, XF, STYLE).
diff --git a/sc/source/filter/inc/xetable.hxx b/sc/source/filter/inc/xetable.hxx
index e5414a361d5e..6f4ba57848ab 100644
--- a/sc/source/filter/inc/xetable.hxx
+++ b/sc/source/filter/inc/xetable.hxx
@@ -24,6 +24,7 @@
#include <vector>
#include "xladdress.hxx"
+#include "xecontent.hxx"
#include "xerecord.hxx"
#include "xestyle.hxx"
#include "xlformula.hxx"
diff --git a/sc/source/filter/inc/xltools.hxx b/sc/source/filter/inc/xltools.hxx
index 0b58753bc0b9..51f86fe8c44b 100644
--- a/sc/source/filter/inc/xltools.hxx
+++ b/sc/source/filter/inc/xltools.hxx
@@ -23,6 +23,8 @@
#include <types.hxx>
#include "ftools.hxx"
+#include <tools/long.hxx>
+
class SfxObjectShell;
enum class FormulaError : sal_uInt16;
diff --git a/sc/source/filter/lotus/lotattr.cxx b/sc/source/filter/lotus/lotattr.cxx
index 5054e8c36fcc..0fae3b719162 100644
--- a/sc/source/filter/lotus/lotattr.cxx
+++ b/sc/source/filter/lotus/lotattr.cxx
@@ -32,7 +32,6 @@
#include <lotfntbf.hxx>
#include "lotfilter.hxx"
#include <patattr.hxx>
-#include <root.hxx>
#include <scitems.hxx>
using namespace ::com::sun::star;
diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx
index facccd1755a3..1013bdeb73bd 100644
--- a/sc/source/filter/lotus/lotform.cxx
+++ b/sc/source/filter/lotus/lotform.cxx
@@ -22,7 +22,6 @@
#include "lotfilter.hxx"
#include <lotrange.hxx>
#include <namebuff.hxx>
-#include <root.hxx>
#include <ftools.hxx>
#include <tool.h>
#include <document.hxx>
diff --git a/sc/source/filter/lotus/lotimpop.cxx b/sc/source/filter/lotus/lotimpop.cxx
index 159b13786f6b..78ff31f824ef 100644
--- a/sc/source/filter/lotus/lotimpop.cxx
+++ b/sc/source/filter/lotus/lotimpop.cxx
@@ -26,7 +26,6 @@
#include <formulacell.hxx>
#include <global.hxx>
-#include <root.hxx>
#include <lotfntbf.hxx>
#include <lotform.hxx>
#include <tool.h>
@@ -35,8 +34,6 @@
#include <stringutil.hxx>
#include <config_fuzzers.h>
-#include <unotools/configmgr.hxx>
-
static osl::Mutex aLotImpSemaphore;
diff --git a/sc/source/filter/lotus/lotread.cxx b/sc/source/filter/lotus/lotread.cxx
index 4092e2f8c90f..f28a783849fb 100644
--- a/sc/source/filter/lotus/lotread.cxx
+++ b/sc/source/filter/lotus/lotread.cxx
@@ -22,7 +22,6 @@
#include <scdll.hxx>
#include <scerrors.hxx>
-#include <root.hxx>
#include "lotfilter.hxx"
#include <lotimpop.hxx>
#include <lotattr.hxx>
diff --git a/sc/source/filter/lotus/lotus.cxx b/sc/source/filter/lotus/lotus.cxx
index dbb8c6730851..291471e1b880 100644
--- a/sc/source/filter/lotus/lotus.cxx
+++ b/sc/source/filter/lotus/lotus.cxx
@@ -24,7 +24,6 @@
#include <tools/urlobj.hxx>
#include <scerrors.hxx>
-#include <root.hxx>
#include <filtopt.hxx>
#include <ftools.hxx>
diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx
index ea34c537e970..040cf761600c 100644
--- a/sc/source/filter/lotus/op.cxx
+++ b/sc/source/filter/lotus/op.cxx
@@ -41,7 +41,6 @@
#include "lotfilter.hxx"
#include <lotform.hxx>
#include <lotrange.hxx>
-#include <root.hxx>
#include <ftools.hxx>
#include <vector>
diff --git a/sc/source/filter/lotus/tool.cxx b/sc/source/filter/lotus/tool.cxx
index eff0740d41de..fb711db71c5b 100644
--- a/sc/source/filter/lotus/tool.cxx
+++ b/sc/source/filter/lotus/tool.cxx
@@ -26,7 +26,6 @@
#include <document.hxx>
#include <tool.h>
-#include <root.hxx>
#include <lotrange.hxx>
#include <namebuff.hxx>
#include <stringutil.hxx>
diff --git a/sc/source/filter/oox/commentsbuffer.cxx b/sc/source/filter/oox/commentsbuffer.cxx
index 3a85f8a6482f..d2d1ca2ccad6 100644
--- a/sc/source/filter/oox/commentsbuffer.cxx
+++ b/sc/source/filter/oox/commentsbuffer.cxx
@@ -17,17 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <oox/token/properties.hxx>
#include <oox/token/tokens.hxx>
#include <commentsbuffer.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
-#include <com/sun/star/sheet/XSheetAnnotationAnchor.hpp>
-#include <com/sun/star/sheet/XSheetAnnotationShapeSupplier.hpp>
-#include <com/sun/star/sheet/XSheetAnnotations.hpp>
-#include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp>
#include <com/sun/star/text/XText.hpp>
#include <osl/diagnose.h>
#include <oox/helper/attributelist.hxx>
@@ -36,7 +30,6 @@
#include <drawingfragment.hxx>
#include <svx/sdtaitm.hxx>
#include <svx/svdocapt.hxx>
-#include <svx/unoshape.hxx>
#include <tools/diagnose_ex.h>
#include <document.hxx>
#include <drwlayer.hxx>
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index c7baa9b976ba..21fef5944e61 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -30,7 +30,6 @@
#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/awt/XFont2.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
diff --git a/sc/source/filter/oox/viewsettings.cxx b/sc/source/filter/oox/viewsettings.cxx
index 64f20e23a07a..0e66409f725c 100644
--- a/sc/source/filter/oox/viewsettings.cxx
+++ b/sc/source/filter/oox/viewsettings.cxx
@@ -28,7 +28,6 @@
#include <com/sun/star/document/NamedPropertyValues.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
-#include <com/sun/star/table/XCellRange.hpp>
#include <osl/diagnose.h>
#include <unotools/mediadescriptor.hxx>
#include <oox/core/filterbase.hxx>
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index 8214ccb0cf4e..b15a94a40919 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -20,7 +20,6 @@
#include <workbookhelper.hxx>
#include <com/sun/star/container/XIndexAccess.hpp>
-#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <com/sun/star/sheet/XDatabaseRanges.hpp>
diff --git a/sc/source/filter/orcus/orcusfiltersimpl.cxx b/sc/source/filter/orcus/orcusfiltersimpl.cxx
index ce90954388ea..d3211c6dfa2b 100644
--- a/sc/source/filter/orcus/orcusfiltersimpl.cxx
+++ b/sc/source/filter/orcus/orcusfiltersimpl.cxx
@@ -11,7 +11,6 @@
#include <orcusinterface.hxx>
#include <tokenarray.hxx>
-#include <tools/urlobj.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/frame.hxx>
#include <sfx2/sfxsids.hrc>
diff --git a/sc/source/filter/qpro/qproform.cxx b/sc/source/filter/qpro/qproform.cxx
index 6f0b6b8ea7a1..34613ad9ff94 100644
--- a/sc/source/filter/qpro/qproform.cxx
+++ b/sc/source/filter/qpro/qproform.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <rtl/strbuf.hxx>
#include <sal/config.h>
#include <sal/macros.h>
#include <sal/log.hxx>
diff --git a/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx b/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx
index 86f4c8065262..fa7c3a941176 100644
--- a/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx
+++ b/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx
@@ -21,9 +21,6 @@
#define INCLUDED_SC_SOURCE_FILTER_XML_XMLCHANGETRACKINGEXPORTHELPER_HXX
#include <xmloff/xmltoken.hxx>
-#include <map>
-#include <memory>
-#include <tools/solar.h>
namespace com::sun::star::text
{
diff --git a/sc/source/filter/xml/XMLStylesImportHelper.hxx b/sc/source/filter/xml/XMLStylesImportHelper.hxx
index e0d5bedc79f9..a4fa8d8ea7ca 100644
--- a/sc/source/filter/xml/XMLStylesImportHelper.hxx
+++ b/sc/source/filter/xml/XMLStylesImportHelper.hxx
@@ -22,9 +22,7 @@
#include <rangelst.hxx>
#include <rtl/ustring.hxx>
-#include <tools/ref.hxx>
-#include <list>
#include <memory>
#include <set>
#include <map>
diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
index a728b6427a70..3d3d77d83627 100644
--- a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
+++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
@@ -20,7 +20,6 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/sheet/XHeaderFooterContent.hpp>
-#include <xmloff/namespacemap.hxx>
#include <xmloff/xmlnamespace.hxx>
#include <xmloff/xmlimp.hxx>
#include "XMLTableHeaderFooterContext.hxx"
diff --git a/sc/source/filter/xml/xmlcvali.cxx b/sc/source/filter/xml/xmlcvali.cxx
index 164c36e77718..b5b6972ff0dc 100644
--- a/sc/source/filter/xml/xmlcvali.cxx
+++ b/sc/source/filter/xml/xmlcvali.cxx
@@ -23,7 +23,6 @@
#include <document.hxx>
#include "XMLConverter.hxx"
-#include <xmloff/xmltkmap.hxx>
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlnamespace.hxx>
#include <xmloff/XMLEventsImportContext.hxx>
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 41218fe5c227..da8f7ce9c38a 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -138,7 +138,6 @@
#include <com/sun/star/sheet/XSheetCellRanges.hpp>
#include <com/sun/star/sheet/XSheetLinkable.hpp>
#include <com/sun/star/sheet/GlobalSheetSettings.hpp>
-#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/table/XColumnRowRange.hpp>
#include <com/sun/star/util/XProtectable.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx
index d4579a3c5215..75d8fa6b2003 100644
--- a/sc/source/filter/xml/xmlstyle.cxx
+++ b/sc/source/filter/xml/xmlstyle.cxx
@@ -39,7 +39,6 @@
#include <com/sun/star/sheet/XSheetConditionalEntry.hpp>
#include <com/sun/star/sheet/XSheetCondition.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <comphelper/extract.hxx>
diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx
index 29d97922ca31..20ea0dffaa75 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -18,7 +18,6 @@
*/
#include "xmlstyli.hxx"
-#include <xmloff/namespacemap.hxx>
#include <xmloff/xmlnamespace.hxx>
#include <xmloff/xmlimppr.hxx>
#include <xmloff/families.hxx>
diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx
index 55394c370fe8..7ef701f1baa9 100644
--- a/sc/source/filter/xml/xmltabi.cxx
+++ b/sc/source/filter/xml/xmltabi.cxx
@@ -39,7 +39,6 @@
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlnamespace.hxx>
#include <xmloff/XMLEventsImportContext.hxx>
-#include <sal/log.hxx>
#include <tools/urlobj.hxx>
#include <sax/fastattribs.hxx>
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index c55c8d811d8f..5442788aa1f5 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -35,7 +35,6 @@
#include <sfx2/sfxsids.hrc>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
-#include <com/sun/star/frame/XTransientDocumentsDocumentContentFactory.hpp>
#include <com/sun/star/xml/sax/InputSource.hpp>
#include <com/sun/star/xml/sax/Parser.hpp>
#include <com/sun/star/xml/sax/XFastParser.hpp>
diff --git a/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx b/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx
index c4b40df72df9..aa1df4d8dd94 100644
--- a/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx
+++ b/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx
@@ -18,7 +18,6 @@
*/
#include <DrawModelBroadcaster.hxx>
-#include <sal/log.hxx>
#include <svx/svdmodel.hxx>
#include <svx/unomod.hxx>
#include <svx/svdobj.hxx>
diff --git a/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx b/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx
index 59d9556be773..88e7fef5d1d8 100644
--- a/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx
@@ -8,18 +8,8 @@
*
*/
-#include <sfx2/dispatch.hxx>
-#include <svl/zforlist.hxx>
-#include <svl/undo.hxx>
-
-#include <formulacell.hxx>
-#include <rangelst.hxx>
-#include <scitems.hxx>
#include <docsh.hxx>
-#include <document.hxx>
-#include <uiitems.hxx>
#include <reffact.hxx>
-#include <docfunc.hxx>
#include <TableFillingAndNavigationTools.hxx>
#include <FourierAnalysisDialog.hxx>
#include <scresid.hxx>
diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx
index ac6b0e12086b..50cbadc567fa 100644
--- a/sc/source/ui/app/client.cxx
+++ b/sc/source/ui/app/client.cxx
@@ -18,7 +18,6 @@
*/
#include <com/sun/star/embed/XEmbeddedObject.hpp>
-#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/diagnose_ex.h>
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 7027f8317535..b5f43ace6d15 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -26,7 +26,6 @@
#include <editeng/eeitem.hxx>
#include <sfx2/app.hxx>
-#include <sfx2/lokhelper.hxx>
#include <editeng/acorrcfg.hxx>
#include <formula/errorcodes.hxx>
#include <editeng/adjustitem.hxx>
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 3d37feb48538..90ef42a0be39 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -32,7 +32,6 @@
#include <editeng/postitem.hxx>
#include <editeng/langitem.hxx>
#include <sfx2/bindings.hxx>
-#include <sfx2/lokhelper.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/event.hxx>
@@ -43,7 +42,6 @@
#include <vcl/settings.hxx>
#include <svl/stritem.hxx>
#include <vcl/svapp.hxx>
-#include <vcl/weldutils.hxx>
#include <unotools/charclass.hxx>
#include <inputwin.hxx>
diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index 2d254dbe1bac..c675ef07b792 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -26,9 +26,6 @@
#include <sfx2/sidebar/SidebarChildWindow.hxx>
#include <sfx2/app.hxx>
#include <avmedia/mediatoolbox.hxx>
-#include <svx/ParaLineSpacingPopup.hxx>
-#include <svx/TextCharacterSpacingPopup.hxx>
-#include <svx/TextUnderlinePopup.hxx>
#include <NumberFormatControl.hxx>
#include <unotools/resmgr.hxx>
@@ -62,7 +59,7 @@
#include <svx/tbxctl.hxx>
#include <svx/fillctrl.hxx>
#include <svx/linectrl.hxx>
-#include <svx/tbcontrl.hxx>
+//#include <svx/tbcontrl.hxx>
#include <svx/selctrl.hxx>
#include <svx/insctrl.hxx>
#include <svx/zoomctrl.hxx>
@@ -70,13 +67,9 @@
#include <svx/pszctrl.hxx>
#include <svx/grafctrl.hxx>
#include <svx/clipboardctl.hxx>
-#include <svx/lboxctrl.hxx>
-#include <svx/verttexttbxctrl.hxx>
#include <svx/formatpaintbrushctrl.hxx>
#include <tbzoomsliderctrl.hxx>
#include <svx/zoomsliderctrl.hxx>
-#include <sfx2/emojipopup.hxx>
-#include <sfx2/charmappopup.hxx>
#include <svx/xmlsecctrl.hxx>
// Child windows
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index f0a992e774bf..b268e9d6d47e 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -81,7 +81,6 @@
#include <inputhdl.hxx>
#include <inputwin.hxx>
#include <msgpool.hxx>
-#include <formdata.hxx>
#include <detfunc.hxx>
#include <preview.hxx>
#include <dragdata.hxx>
diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx
index 6c3f1fa8f16c..f37a72461b86 100644
--- a/sc/source/ui/attrdlg/attrdlg.cxx
+++ b/sc/source/ui/attrdlg/attrdlg.cxx
@@ -27,7 +27,7 @@
#include <tabpages.hxx>
#include <attrdlg.hxx>
#include <svx/dialogs.hrc>
-#include <svx/svxids.hrc>
+#include <editeng/editids.hrc>
#include <editeng/flstitem.hxx>
#include <osl/diagnose.h>
diff --git a/sc/source/ui/attrdlg/scabstdlg.cxx b/sc/source/ui/attrdlg/scabstdlg.cxx
index d81e26dbb0fa..a8a457c5c985 100644
--- a/sc/source/ui/attrdlg/scabstdlg.cxx
+++ b/sc/source/ui/attrdlg/scabstdlg.cxx
@@ -21,7 +21,6 @@
#include <osl/module.hxx>
#include <tools/svlibrary.h>
-#include <rtl/ustrbuf.hxx>
typedef ScAbstractDialogFactory* (*ScFuncPtrCreateDialogFactory)();
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index 40dc203d56c1..73d4bc163a82 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -70,6 +70,8 @@
#include <sfx2/sfxdlg.hxx>
#include <conditio.hxx>
+#include <vcl/virdev.hxx>
+
short AbstractScImportAsciiDlg_Impl::Execute()
{
return m_xDlg->run();
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 1e3be87c34cc..666a36dda855 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -21,7 +21,6 @@
#include <scabstdlg.hxx>
#include <sfx2/sfxdlg.hxx>
-#include <vcl/virdev.hxx>
#include <corodlg.hxx>
#include <condformatmgr.hxx>
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 3c3b1752d5d8..319d2ef9089c 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -20,8 +20,6 @@
#include <checklistmenu.hxx>
#include <globstr.hrc>
#include <scresid.hxx>
-#include <strings.hrc>
-#include <bitmaps.hlst>
#include <vcl/decoview.hxx>
#include <vcl/event.hxx>
@@ -30,7 +28,6 @@
#include <vcl/svapp.hxx>
#include <vcl/virdev.hxx>
#include <rtl/math.hxx>
-#include <tools/wintypes.hxx>
#include <unotools/charclass.hxx>
#include <comphelper/lok.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
index 12d12c19beda..ca7133167308 100644
--- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
+++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
@@ -22,8 +22,6 @@
#include <vcl/image.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/virdev.hxx>
-#include <vcl/gradient.hxx>
-#include <vcl/settings.hxx>
#include <svx/zoomslideritem.hxx>
#include <iterator>
#include <set>
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 09432d8f6454..7a4631289f01 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -7,12 +7,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include <comphelper/lok.hxx>
#include <condformatdlg.hxx>
#include <sfx2/dispatch.hxx>
-#include <sfx2/lokhelper.hxx>
-#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
#include <anyrefdg.hxx>
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index 8a9fe98c5242..d997a91fd429 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -20,11 +20,9 @@
#include <svl/style.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/frame.hxx>
-#include <sfx2/lokhelper.hxx>
#include <svl/stritem.hxx>
#include <svl/intitem.hxx>
#include <svx/colorbox.hxx>
-#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
#include <formula/token.hxx>
#include <formula/errorcodes.hxx>
@@ -32,7 +30,6 @@
#include <stlpool.hxx>
#include <tabvwsh.hxx>
#include <unotools/charclass.hxx>
-#include <comphelper/lok.hxx>
#include <colorformat.hxx>
#include <scresid.hxx>
diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx
index 4e9e3224ab94..03530ccc42fb 100644
--- a/sc/source/ui/condformat/condformatmgr.cxx
+++ b/sc/source/ui/condformat/condformatmgr.cxx
@@ -9,8 +9,6 @@
#include <condformatmgr.hxx>
#include <condformathelper.hxx>
-#include <globstr.hrc>
-#include <scresid.hxx>
#include <condformatdlg.hxx>
#include <document.hxx>
#include <conditio.hxx>
diff --git a/sc/source/ui/dataprovider/sqldataprovider.cxx b/sc/source/ui/dataprovider/sqldataprovider.cxx
index 3267822b0b93..05472865fbb7 100644
--- a/sc/source/ui/dataprovider/sqldataprovider.cxx
+++ b/sc/source/ui/dataprovider/sqldataprovider.cxx
@@ -16,7 +16,6 @@
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
-#include <miscuno.hxx>
#include <dbdocutl.hxx>
#include <datamapper.hxx>
#include <vcl/svapp.hxx>
diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index 604d94d36363..700f189e19ef 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -19,6 +19,7 @@
#include <dbdocfun.hxx>
#include <dpsave.hxx>
#include <dpshttab.hxx>
+#include <scmod.hxx>
#include <memory>
#include <vector>
diff --git a/sc/source/ui/dbgui/csvtablebox.cxx b/sc/source/ui/dbgui/csvtablebox.cxx
index 908a6ea61bad..ec2a11c5b739 100644
--- a/sc/source/ui/dbgui/csvtablebox.cxx
+++ b/sc/source/ui/dbgui/csvtablebox.cxx
@@ -18,9 +18,7 @@
*/
#include <csvtablebox.hxx>
-#include <vcl/event.hxx>
#include <vcl/settings.hxx>
-#include <AccessibleCsvControl.hxx>
ScCsvTableBox::ScCsvTableBox(weld::Builder& rBuilder)
: mxRuler(new ScCsvRuler(maData, this))
diff --git a/sc/source/ui/dbgui/dapidata.cxx b/sc/source/ui/dbgui/dapidata.cxx
index 75e895f25a5f..8e97a1d93465 100644
--- a/sc/source/ui/dbgui/dapidata.cxx
+++ b/sc/source/ui/dbgui/dapidata.cxx
@@ -32,7 +32,6 @@
using namespace com::sun::star;
#include <dapidata.hxx>
-#include <miscuno.hxx>
#include <dpsdbtab.hxx>
// entries in the "type" ListBox
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index be524ab15437..40d86b908de0 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -37,7 +37,6 @@
#include <miscuno.hxx>
#include <osl/diagnose.h>
-#include <unicode/uclean.h>
#include <unicode/ucsdet.h>
//! TODO make dynamic
diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx
index 836767891b08..4f47e4e940a1 100644
--- a/sc/source/ui/dbgui/sfiltdlg.cxx
+++ b/sc/source/ui/dbgui/sfiltdlg.cxx
@@ -33,7 +33,6 @@
#include <strings.hrc>
#include <filtdlg.hxx>
-#include <vcl/idle.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index e4f9e93cd617..3d73a72f99af 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -23,8 +23,6 @@
#include <com/sun/star/sheet/TableValidationVisibility.hpp>
#include <comphelper/string.hxx>
-#include <vcl/svapp.hxx>
-#include <svl/aeitem.hxx>
#include <svl/stritem.hxx>
#include <svl/eitem.hxx>
#include <svl/intitem.hxx>
@@ -45,7 +43,6 @@
#include <sfx2/childwin.hxx>
#include <reffact.hxx>
#include <comphelper/lok.hxx>
-#include <sfx2/lokhelper.hxx>
#define IS_MOBILE (comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current() && SfxViewShell::Current()->isLOKMobilePhone())
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index e15282480fc0..5da81c91acce 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -56,7 +56,6 @@
#include <chartlis.hxx>
#include <ChartTools.hxx>
-#include <set>
#include <memory>
using namespace ::com::sun::star;
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 42f952f5c1a8..a31d73e5802c 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -69,7 +69,6 @@
#include <formulaopt.hxx>
#include <comphelper/lok.hxx>
-#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <sfx2/lokhelper.hxx>
// Redraw - Notifications
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 50a1ef3ecda3..7c1c3d430686 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -87,7 +87,6 @@ using namespace ::com::sun::star;
#include <reffact.hxx>
#include <chartlis.hxx>
#include <chartpos.hxx>
-#include <waitoff.hxx>
#include <tablink.hxx>
#include <drwlayer.hxx>
#include <docoptio.hxx>
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index 85e620227705..464173db7876 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -51,7 +51,6 @@
#include <docpool.hxx>
#include <uiitems.hxx>
#include <sc.hrc>
-#include <waitoff.hxx>
#include <sizedev.hxx>
#include <clipparam.hxx>
#include <rowheightcontext.hxx>
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index cb2f0586e5ab..f6f0fe459c7b 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -39,7 +39,6 @@
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/SQLException.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
-#include <com/sun/star/sdbc/XDriverAccess.hpp>
#include <com/sun/star/sdbc/DriverManager.hpp>
#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 76470eb90caa..3bfa5bbdc1e8 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -58,7 +58,6 @@
#include <svx/xlnclit.hxx>
#include <svx/xflclit.hxx>
#include <svx/xflgrit.hxx>
-#include <editeng/colritem.hxx>
SFX_IMPL_INTERFACE(ScDrawShell, SfxShell)
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index 916e756bc613..ca3713ef46f8 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -47,8 +47,6 @@
#include <drtxtob.hxx>
#include <gridwin.hxx>
#include <svx/svdoole2.hxx>
-#include <svx/svdocapt.hxx>
-#include <svx/xfillit0.hxx>
#include <svx/xflgrit.hxx>
#include <comphelper/lok.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
@@ -57,8 +55,6 @@
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <sfx2/ipclient.hxx>
-#include <com/sun/star/drawing/FillStyle.hpp>
-
using namespace com::sun::star::drawing;
using namespace com::sun::star;
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index d71e2ebcf671..3d3201bd6c17 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -25,7 +25,6 @@
#include <svx/ImageMapInfo.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
-#include <sfx2/lokhelper.hxx>
#include <vcl/uitest/logger.hxx>
#include <vcl/uitest/eventdescription.hxx>
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 4188e78f1fe0..ebbbbca891c3 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -46,13 +46,11 @@
#include <comphelper/lok.hxx>
#include <comphelper/storagehelper.hxx>
#include <comphelper/propertysequence.hxx>
-#include <sfx2/lokhelper.hxx>
#include <com/sun/star/embed/EmbedVerbs.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
-#include <com/sun/star/ui/dialogs/ExecutableDialogResults.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>
diff --git a/sc/source/ui/inc/AccessibleCsvControl.hxx b/sc/source/ui/inc/AccessibleCsvControl.hxx
index 808368cd3c42..975698d94dde 100644
--- a/sc/source/ui/inc/AccessibleCsvControl.hxx
+++ b/sc/source/ui/inc/AccessibleCsvControl.hxx
@@ -27,6 +27,7 @@
#include <com/sun/star/accessibility/XAccessibleTable.hpp>
#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
#include <tools/gen.hxx>
+#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
#include <comphelper/accessiblecomponenthelper.hxx>
#include <cppuhelper/implbase1.hxx>
@@ -34,8 +35,6 @@
#include <cppuhelper/implbase3.hxx>
#include <editeng/AccessibleStaticTextBase.hxx>
#include <comphelper/uno3.hxx>
-#include <vcl/vclptr.hxx>
-#include "AccessibleContextBase.hxx"
#include <map>
class ScCsvControl;
diff --git a/sc/source/ui/inc/ChildWindowWrapper.hxx b/sc/source/ui/inc/ChildWindowWrapper.hxx
index dad043e22143..f88c49f5e904 100644
--- a/sc/source/ui/inc/ChildWindowWrapper.hxx
+++ b/sc/source/ui/inc/ChildWindowWrapper.hxx
@@ -11,7 +11,6 @@
#ifndef INCLUDED_SC_SOURCE_UI_INC_CHILDWINDOWWRAPPER_HXX
#define INCLUDED_SC_SOURCE_UI_INC_CHILDWINDOWWRAPPER_HXX
-#include <sfx2/basedlgs.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/childwin.hxx>
diff --git a/sc/source/ui/inc/FilterListBox.hxx b/sc/source/ui/inc/FilterListBox.hxx
index 1a4685ff5656..0177bb4691a5 100644
--- a/sc/source/ui/inc/FilterListBox.hxx
+++ b/sc/source/ui/inc/FilterListBox.hxx
@@ -19,6 +19,8 @@
#pragma once
+#include <types.hxx>
+
#include <vcl/InterimItemWindow.hxx>
class ScGridWindow;
diff --git a/sc/source/ui/inc/PivotLayoutTreeList.hxx b/sc/source/ui/inc/PivotLayoutTreeList.hxx
index ab1ce9c93ae7..4d15053c0e31 100644
--- a/sc/source/ui/inc/PivotLayoutTreeList.hxx
+++ b/sc/source/ui/inc/PivotLayoutTreeList.hxx
@@ -12,7 +12,6 @@
#define INCLUDED_SC_SOURCE_UI_INC_PIVOTLAYOUTTREELIST_HXX
#include <memory>
-#include <tools/solar.h>
#include "PivotLayoutTreeListBase.hxx"
class ScPivotLayoutTreeList : public ScPivotLayoutTreeListBase
diff --git a/sc/source/ui/inc/PivotLayoutTreeListData.hxx b/sc/source/ui/inc/PivotLayoutTreeListData.hxx
index 5041ff12b8ea..bd60a765fba8 100644
--- a/sc/source/ui/inc/PivotLayoutTreeListData.hxx
+++ b/sc/source/ui/inc/PivotLayoutTreeListData.hxx
@@ -12,7 +12,6 @@
#define INCLUDED_SC_SOURCE_UI_INC_PIVOTLAYOUTTREELISTDATA_HXX
#include "PivotLayoutTreeListBase.hxx"
-#include <tools/solar.h>
#include <vector>
#include <memory>
diff --git a/sc/source/ui/inc/RegressionDialog.hxx b/sc/source/ui/inc/RegressionDialog.hxx
index 96da94047007..2d75ae95dbac 100644
--- a/sc/source/ui/inc/RegressionDialog.hxx
+++ b/sc/source/ui/inc/RegressionDialog.hxx
@@ -12,6 +12,7 @@
#define INCLUDED_SC_SOURCE_UI_INC_REGRESSIONDIALOG_HXX
#include "StatisticsTwoVariableDialog.hxx"
+#include "TableFillingAndNavigationTools.hxx"
class ScRegressionDialog : public ScStatisticsTwoVariableDialog
{
diff --git a/sc/source/ui/inc/TableFillingAndNavigationTools.hxx b/sc/source/ui/inc/TableFillingAndNavigationTools.hxx
index c4974bbd1bc6..a2d04400403f 100644
--- a/sc/source/ui/inc/TableFillingAndNavigationTools.hxx
+++ b/sc/source/ui/inc/TableFillingAndNavigationTools.hxx
@@ -14,6 +14,7 @@
#include <address.hxx>
#include <rangelst.hxx>
+#include <map>
#include <vector>
class FormulaTemplate
diff --git a/sc/source/ui/inc/acredlin.hxx b/sc/source/ui/inc/acredlin.hxx
index 7bca575093d2..04f919ecd019 100644
--- a/sc/source/ui/inc/acredlin.hxx
+++ b/sc/source/ui/inc/acredlin.hxx
@@ -21,6 +21,8 @@
#define INCLUDED_SC_SOURCE_UI_INC_ACREDLIN_HXX
#include <svx/ctredlin.hxx>
+#include <sfx2/basedlgs.hxx>
+#include <sfx2/bindings.hxx>
#include <chgtrack.hxx>
#include <chgviset.hxx>
#include <vcl/idle.hxx>
diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx
index 699725f712c1..30fc15a5b542 100644
--- a/sc/source/ui/inc/anyrefdg.hxx
+++ b/sc/source/ui/inc/anyrefdg.hxx
@@ -23,9 +23,7 @@
#include <sfx2/basedlgs.hxx>
#include <address.hxx>
#include <formula/funcutl.hxx>
-#include <vcl/accel.hxx>
#include "IAnyRefDialog.hxx"
-#include <scmod.hxx>
#include <memory>
diff --git a/sc/source/ui/inc/areasave.hxx b/sc/source/ui/inc/areasave.hxx
index 345331c44272..a8cf0dbc7961 100644
--- a/sc/source/ui/inc/areasave.hxx
+++ b/sc/source/ui/inc/areasave.hxx
@@ -23,6 +23,7 @@
#include <address.hxx>
#include <tools/solar.h>
+#include <memory>
#include <vector>
class ScDocument;
diff --git a/sc/source/ui/inc/autostyl.hxx b/sc/source/ui/inc/autostyl.hxx
index 83078c378aa2..8040373de837 100644
--- a/sc/source/ui/inc/autostyl.hxx
+++ b/sc/source/ui/inc/autostyl.hxx
@@ -20,6 +20,7 @@
#ifndef INCLUDED_SC_SOURCE_UI_INC_AUTOSTYL_HXX
#define INCLUDED_SC_SOURCE_UI_INC_AUTOSTYL_HXX
+#include <address.hxx>
#include <vector>
#include <rtl/ustring.hxx>
#include <tools/solar.h>
diff --git a/sc/source/ui/inc/cellsh.hxx b/sc/source/ui/inc/cellsh.hxx
index 1d543ad557f5..837923fb4e20 100644
--- a/sc/source/ui/inc/cellsh.hxx
+++ b/sc/source/ui/inc/cellsh.hxx
@@ -29,6 +29,7 @@
#include <rtl/ref.hxx>
#include <sot/formats.hxx>
#include <vcl/vclptr.hxx>
+#include <vcl/window.hxx>
#include <tools/solar.h>
class SvxClipboardFormatItem;
diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx
index 247ff1c55c42..602d6d86109d 100644
--- a/sc/source/ui/inc/checklistmenu.hxx
+++ b/sc/source/ui/inc/checklistmenu.hxx
@@ -10,14 +10,12 @@
#ifndef INCLUDED_SC_SOURCE_UI_INC_CHECKLISTMENU_HXX
#define INCLUDED_SC_SOURCE_UI_INC_CHECKLISTMENU_HXX
-#include <vcl/InterimItemWindow.hxx>
#include <vcl/dockwin.hxx>
#include <vcl/timer.hxx>
#include <vcl/weld.hxx>
#include <memory>
#include <unordered_set>
-#include <unordered_map>
#include <map>
#include <set>
diff --git a/sc/source/ui/inc/condformatmgr.hxx b/sc/source/ui/inc/condformatmgr.hxx
index 2e7eaa54eaa9..b70b0ffab851 100644
--- a/sc/source/ui/inc/condformatmgr.hxx
+++ b/sc/source/ui/inc/condformatmgr.hxx
@@ -12,8 +12,6 @@
#include <vcl/weld.hxx>
-#include <map>
-
class ScDocument;
class ScConditionalFormat;
class ScConditionalFormatList;
diff --git a/sc/source/ui/inc/csvcontrol.hxx b/sc/source/ui/inc/csvcontrol.hxx
index 8a87e306341e..65a316372f02 100644
--- a/sc/source/ui/inc/csvcontrol.hxx
+++ b/sc/source/ui/inc/csvcontrol.hxx
@@ -23,7 +23,6 @@
#include <scdllapi.h>
#include <address.hxx>
#include "csvsplits.hxx"
-#include <com/sun/star/uno/Reference.hxx>
#include <o3tl/typed_flags_set.hxx>
#include <rtl/ref.hxx>
#include <vcl/customweld.hxx>
diff --git a/sc/source/ui/inc/csvruler.hxx b/sc/source/ui/inc/csvruler.hxx
index ad917313a1c9..6d64b3174290 100644
--- a/sc/source/ui/inc/csvruler.hxx
+++ b/sc/source/ui/inc/csvruler.hxx
@@ -22,7 +22,6 @@
#include "csvcontrol.hxx"
#include "csvsplits.hxx"
-#include <scdllapi.h>
#include <vcl/virdev.hxx>
diff --git a/sc/source/ui/inc/dataprovider.hxx b/sc/source/ui/inc/dataprovider.hxx
index a7a5f9b10d42..a1cd99ecf3bd 100644
--- a/sc/source/ui/inc/dataprovider.hxx
+++ b/sc/source/ui/inc/dataprovider.hxx
@@ -20,7 +20,7 @@
#include <rtl/strbuf.hxx>
#include <vector>
-#include <map>
+//#include <map>
#include <orcus/csv_parser.hpp>
diff --git a/sc/source/ui/inc/datatableview.hxx b/sc/source/ui/inc/datatableview.hxx
index fe415439eef7..57bcde623b82 100644
--- a/sc/source/ui/inc/datatableview.hxx
+++ b/sc/source/ui/inc/datatableview.hxx
@@ -23,7 +23,6 @@
#include <com/sun/star/awt/XWindow.hpp>
#include <vcl/ctrl.hxx>
#include <vcl/scrbar.hxx>
-#include <scdllapi.h>
#include <types.hxx>
#include "hdrcont.hxx"
diff --git a/sc/source/ui/inc/foptmgr.hxx b/sc/source/ui/inc/foptmgr.hxx
index b26ffbe1d155..319ce2421618 100644
--- a/sc/source/ui/inc/foptmgr.hxx
+++ b/sc/source/ui/inc/foptmgr.hxx
@@ -20,6 +20,8 @@
#ifndef INCLUDED_SC_SOURCE_UI_INC_FOPTMGR_HXX
#define INCLUDED_SC_SOURCE_UI_INC_FOPTMGR_HXX
+#include <vcl/weld.hxx>
+
namespace formula
{
class RefButton;
diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx
index d478ff008285..31ea0b41b064 100644
--- a/sc/source/ui/inc/formula.hxx
+++ b/sc/source/ui/inc/formula.hxx
@@ -23,6 +23,7 @@
#include <memory>
#include "anyrefdg.hxx"
+#include <scmod.hxx>
#include <formula/formula.hxx>
#include "IAnyRefDialog.hxx"
diff --git a/sc/source/ui/inc/fuinsert.hxx b/sc/source/ui/inc/fuinsert.hxx
index a9c8fb5c7e38..45aeb11bab10 100644
--- a/sc/source/ui/inc/fuinsert.hxx
+++ b/sc/source/ui/inc/fuinsert.hxx
@@ -22,9 +22,7 @@
#include "fupoor.hxx"
#include <scdllapi.h>
-#include <svx/svdoole2.hxx>
#include <com/sun/star/ui/dialogs/DialogClosedEvent.hpp>
-#include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
class FuInsertGraphic : public FuPoor
{
diff --git a/sc/source/ui/inc/gridmerg.hxx b/sc/source/ui/inc/gridmerg.hxx
index 82fec233d038..a05c1bd8a8e8 100644
--- a/sc/source/ui/inc/gridmerg.hxx
+++ b/sc/source/ui/inc/gridmerg.hxx
@@ -20,6 +20,9 @@
#ifndef INCLUDED_SC_SOURCE_UI_INC_GRIDMERG_HXX
#define INCLUDED_SC_SOURCE_UI_INC_GRIDMERG_HXX
+#include <tools/long.hxx>
+#include <vcl/vclptr.hxx>
+
class OutputDevice;
class ScGridMerger
diff --git a/sc/source/ui/inc/hdrcont.hxx b/sc/source/ui/inc/hdrcont.hxx
index 3bb0e4223ce5..f9ef17c32eee 100644
--- a/sc/source/ui/inc/hdrcont.hxx
+++ b/sc/source/ui/inc/hdrcont.hxx
@@ -21,7 +21,6 @@
#define INCLUDED_SC_SOURCE_UI_INC_HDRCONT_HXX
#include <vcl/window.hxx>
-#include <scdllapi.h>
#include <types.hxx>
#define HDR_SIZE_OPTIMUM 0xFFFF
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index 04b700ae3be0..c0f37f644538 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -22,7 +22,6 @@
#include <vector>
#include <memory>
-#include <cppuhelper/weakref.hxx>
#include <vcl/customweld.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/InterimItemWindow.hxx>
@@ -30,7 +29,6 @@
#include <svl/lstner.hxx>
#include <svtools/stringtransfer.hxx>
#include <vcl/window.hxx>
-#include <vcl/transfer.hxx>
#include <vcl/menu.hxx>
#include <formula/opcode.hxx>
#include <svx/weldeditview.hxx>
diff --git a/sc/source/ui/inc/instbdlg.hxx b/sc/source/ui/inc/instbdlg.hxx
index 449ec75e2ff1..bb57c66c1d1c 100644
--- a/sc/source/ui/inc/instbdlg.hxx
+++ b/sc/source/ui/inc/instbdlg.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SC_SOURCE_UI_INC_INSTBDLG_HXX
#include <sfx2/objsh.hxx>
+#include <vcl/timer.hxx>
#include <vcl/weld.hxx>
#include <types.hxx>
diff --git a/sc/source/ui/inc/optsolver.hxx b/sc/source/ui/inc/optsolver.hxx
index 410f513375ee..60dad2ca0820 100644
--- a/sc/source/ui/inc/optsolver.hxx
+++ b/sc/source/ui/inc/optsolver.hxx
@@ -22,6 +22,7 @@
#include <address.hxx>
#include "anyrefdg.hxx"
+#include "docsh.hxx"
#include <com/sun/star/uno/Sequence.hxx>
#include <vector>
diff --git a/sc/source/ui/inc/protectiondlg.hxx b/sc/source/ui/inc/protectiondlg.hxx
index e3682173929c..96bdf5853b3f 100644
--- a/sc/source/ui/inc/protectiondlg.hxx
+++ b/sc/source/ui/inc/protectiondlg.hxx
@@ -21,7 +21,6 @@
#define INCLUDED_SC_SOURCE_UI_INC_PROTECTIONDLG_HXX
#include <vcl/weld.hxx>
-#include <scdllapi.h>
class ScTableProtection;
diff --git a/sc/source/ui/inc/scuiasciiopt.hxx b/sc/source/ui/inc/scuiasciiopt.hxx
index d327d81947bf..51cf2ec06a17 100644
--- a/sc/source/ui/inc/scuiasciiopt.hxx
+++ b/sc/source/ui/inc/scuiasciiopt.hxx
@@ -23,7 +23,6 @@
#include <svx/langbox.hxx>
#include <tools/solar.h>
#include <tools/stream.hxx>
-#include <vcl/customweld.hxx>
#include <vcl/weld.hxx>
#include "asciiopt.hxx"
diff --git a/sc/source/ui/inc/scuiautofmt.hxx b/sc/source/ui/inc/scuiautofmt.hxx
index 5fee72451235..24f9f696247a 100644
--- a/sc/source/ui/inc/scuiautofmt.hxx
+++ b/sc/source/ui/inc/scuiautofmt.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_SC_SOURCE_UI_INC_SCUIAUTOFMT_HXX
#include <vcl/customweld.hxx>
+#include <autoform.hxx>
#include "autofmt.hxx"
class ScAutoFormatDlg : public weld::GenericDialogController
diff --git a/sc/source/ui/inc/scuitphfedit.hxx b/sc/source/ui/inc/scuitphfedit.hxx
index b0f0d32c4134..940879fb293c 100644
--- a/sc/source/ui/inc/scuitphfedit.hxx
+++ b/sc/source/ui/inc/scuitphfedit.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SC_SOURCE_UI_INC_SCUITPHFEDIT_HXX
#include "tphfedit.hxx"
+#include <sfx2/tabdlg.hxx>
#include <vcl/customweld.hxx>
#include <vcl/weld.hxx>
diff --git a/sc/source/ui/inc/sharedocdlg.hxx b/sc/source/ui/inc/sharedocdlg.hxx
index e49d4c32a24a..a8f6d1a07283 100644
--- a/sc/source/ui/inc/sharedocdlg.hxx
+++ b/sc/source/ui/inc/sharedocdlg.hxx
@@ -21,7 +21,6 @@
#define INCLUDED_SC_SOURCE_UI_INC_SHAREDOCDLG_HXX
#include <vcl/weld.hxx>
-#include <scdllapi.h>
class ScViewData;
class ScDocShell;
diff --git a/sc/source/ui/inc/sizedev.hxx b/sc/source/ui/inc/sizedev.hxx
index 95bfac3a44e0..93255e62da68 100644
--- a/sc/source/ui/inc/sizedev.hxx
+++ b/sc/source/ui/inc/sizedev.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SC_SOURCE_UI_INC_SIZEDEV_HXX
#include <vcl/mapmod.hxx>
+#include <vcl/vclptr.hxx>
class OutputDevice;
class ScDocShell;
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 1061dbe90a6e..2500a8fabf9f 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -20,7 +20,6 @@
#ifndef INCLUDED_SC_SOURCE_UI_INC_TABVWSH_HXX
#define INCLUDED_SC_SOURCE_UI_INC_TABVWSH_HXX
-#include <com/sun/star/drawing/QRCode.hpp>
#include <formula/errorcodes.hxx>
#include <formula/opcode.hxx>
#include <svx/fmshell.hxx>
@@ -32,7 +31,7 @@
#include "target.hxx"
#include <shellids.hxx>
#include <tabprotection.hxx>
-#include <com/sun/star/ui/dialogs/XDialogClosedListener.hpp>
+#include <com/sun/star/ui/dialogs/DialogClosedEvent.hpp>
#include <memory>
#include <map>
diff --git a/sc/source/ui/inc/tphfedit.hxx b/sc/source/ui/inc/tphfedit.hxx
index 85b8984c821d..7d5a9ca521a3 100644
--- a/sc/source/ui/inc/tphfedit.hxx
+++ b/sc/source/ui/inc/tphfedit.hxx
@@ -22,10 +22,8 @@
#include <scdllapi.h>
#include <cppuhelper/weakref.hxx>
-#include <tools/wintypes.hxx>
#include <svx/weldeditview.hxx>
#include <editeng/svxenum.hxx>
-#include <vcl/customweld.hxx>
#include <functional>
diff --git a/sc/source/ui/inc/uiobject.hxx b/sc/source/ui/inc/uiobject.hxx
index 235c5f7bdbda..ae3583fff154 100644
--- a/sc/source/ui/inc/uiobject.hxx
+++ b/sc/source/ui/inc/uiobject.hxx
@@ -7,6 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include "gridwin.hxx"
+#include "navipi.hxx"
#include <memory>
#include <vcl/uitest/uiobject.hxx>
diff --git a/sc/source/ui/inc/undoolk.hxx b/sc/source/ui/inc/undoolk.hxx
index a8e03577c86e..26695085185c 100644
--- a/sc/source/ui/inc/undoolk.hxx
+++ b/sc/source/ui/inc/undoolk.hxx
@@ -20,6 +20,8 @@
#ifndef INCLUDED_SC_SOURCE_UI_INC_UNDOOLK_HXX
#define INCLUDED_SC_SOURCE_UI_INC_UNDOOLK_HXX
+#include <memory>
+
class SdrUndoAction;
class ScDocument;
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index 3f64e1485f73..a0f84104b63b 100644
--- a/sc/source/ui/inc/validate.hxx
+++ b/sc/source/ui/inc/validate.hxx
@@ -24,6 +24,7 @@
#include "anyrefdg.hxx"
#include <sc.hrc>
+#include <scmod.hxx>
struct ScRefHandlerCaller{
virtual ~ScRefHandlerCaller(){}
diff --git a/sc/source/ui/inc/xmlsourcedlg.hxx b/sc/source/ui/inc/xmlsourcedlg.hxx
index 452bac0f8946..9f4b308e56f4 100644
--- a/sc/source/ui/inc/xmlsourcedlg.hxx
+++ b/sc/source/ui/inc/xmlsourcedlg.hxx
@@ -15,7 +15,6 @@
#include <set>
#include <memory>
-#include <vector>
class ScDocument;
class ScRange;
diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx
index 0e6fe0d76584..636ad9336928 100644
--- a/sc/source/ui/miscdlgs/datafdlg.cxx
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -14,7 +14,6 @@
#include <docsh.hxx>
#include <tabvwsh.hxx>
-#include <rtl/ustrbuf.hxx>
#include <vcl/svapp.hxx>
#define HDL(hdl) LINK( this, ScDataFormDlg, hdl )
diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx
index b66b1cfc0b27..3f0905ee8b12 100644
--- a/sc/source/ui/namedlg/namedefdlg.cxx
+++ b/sc/source/ui/namedlg/namedefdlg.cxx
@@ -9,7 +9,6 @@
#include <namedefdlg.hxx>
-#include <vcl/settings.hxx>
#include <formula/errorcodes.hxx>
#include <sfx2/app.hxx>
#include <unotools/charclass.hxx>
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index bff39913e504..566ecd8fc102 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -32,7 +32,6 @@
#include <globalnames.hxx>
#include <tokenarray.hxx>
-#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
#include <formula/errorcodes.hxx>
#include <unotools/charclass.hxx>
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 6a638f88390f..9686f77a940d 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -28,7 +28,6 @@
#include <sfx2/docfile.hxx>
#include <sfx2/viewfrm.hxx>
#include <vcl/commandevent.hxx>
-#include <vcl/help.hxx>
#include <vcl/svapp.hxx>
#include <tools/urlobj.hxx>
#include <sal/log.hxx>
diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx
index f9ad40679352..0b317ea0acdd 100644
--- a/sc/source/ui/navipi/scenwnd.cxx
+++ b/sc/source/ui/navipi/scenwnd.cxx
@@ -26,7 +26,6 @@
#include <vcl/event.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
-#include <vcl/settings.hxx>
#include <navipi.hxx>
#include <sc.hrc>
#include <globstr.hrc>
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
index b5e53311b6aa..e04f2694507c 100644
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ b/sc/source/ui/pagedlg/tphf.cxx
@@ -24,7 +24,6 @@
#include <sfx2/sfxdlg.hxx>
#include <svl/style.hxx>
#include <svx/pageitem.hxx>
-#include <vcl/svapp.hxx>
#include <attrib.hxx>
#include <tphf.hxx>
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
index acf8333d246d..16be645815ac 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -21,15 +21,11 @@
#include <editeng/eeitem.hxx>
#include <editeng/editobj.hxx>
-#include <editeng/editstat.hxx>
#include <editeng/editview.hxx>
#include <editeng/adjustitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/sfxdlg.hxx>
-#include <vcl/cursor.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/settings.hxx>
#include <tphfedit.hxx>
#include <editutil.hxx>
diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx
index 692fc245f617..7ea361b94557 100644
--- a/sc/source/ui/pagedlg/tptable.cxx
+++ b/sc/source/ui/pagedlg/tptable.cxx
@@ -21,8 +21,6 @@
#include <scitems.hxx>
-#include <vcl/event.hxx>
-#include <vcl/settings.hxx>
#include <osl/diagnose.h>
#include <tptable.hxx>
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
index daae9593b20f..7c51f5db9a2c 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
@@ -26,13 +26,8 @@
#include <sfx2/dispatch.hxx>
#include <svl/intitem.hxx>
#include <svx/rotmodit.hxx>
-#include <svx/sdangitm.hxx>
#include <svtools/unitconv.hxx>
-#include <unotools/localedatawrapper.hxx>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#include <boost/property_tree/json_parser.hpp>
-#include <sfx2/lokhelper.hxx>
-#include <comphelper/lok.hxx>
using namespace css;
using namespace css::uno;
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
index 1747e9f0a37d..ae42b47fc51b 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
@@ -22,8 +22,8 @@
#include <sfx2/sidebar/ControllerItem.hxx>
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
#include <sfx2/sidebar/PanelLayout.hxx>
-#include "CellBorderStyleControl.hxx"
-#include "CellLineStyleControl.hxx"
+#include <vcl/EnumContext.hxx>
+#include <vcl/image.hxx>
class ToolbarUnoDispatcher;
class ToolbarPopupContainer;
diff --git a/sc/source/ui/sidebar/CellBorderStyleControl.cxx b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
index 6a6d7c74d9f6..b1725610b2e7 100644
--- a/sc/source/ui/sidebar/CellBorderStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
@@ -20,7 +20,6 @@
#include "CellBorderStyleControl.hxx"
#include <editeng/boxitem.hxx>
#include <editeng/borderline.hxx>
-#include <sfx2/app.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <svx/svxids.hrc>
diff --git a/sc/source/ui/sidebar/CellLineStyleControl.cxx b/sc/source/ui/sidebar/CellLineStyleControl.cxx
index beae25ff03bd..70dab1825de2 100644
--- a/sc/source/ui/sidebar/CellLineStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellLineStyleControl.cxx
@@ -24,7 +24,6 @@
#include <vcl/svapp.hxx>
#include <editeng/borderline.hxx>
#include <editeng/lineitem.hxx>
-#include <sfx2/app.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <svx/svxids.hrc>
diff --git a/sc/source/ui/styleui/styledlg.cxx b/sc/source/ui/styleui/styledlg.cxx
index 544489b867ff..12acb34463f8 100644
--- a/sc/source/ui/styleui/styledlg.cxx
+++ b/sc/source/ui/styleui/styledlg.cxx
@@ -34,7 +34,6 @@
#include <svx/dialogs.hrc>
#include <svl/intitem.hxx>
#include <editeng/flstitem.hxx>
-#include <svl/aeitem.hxx>
#include <svx/flagsdef.hxx>
ScStyleDlg::ScStyleDlg(weld::Window* pParent,
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index f6d2c1bbcbb7..f7347ecc1c2f 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -45,13 +45,10 @@
#include <refundo.hxx>
#include <undoolk.hxx>
#include <clipparam.hxx>
-#include <brdcst.hxx>
#include <rowheightcontext.hxx>
-#include <refhint.hxx>
#include <refupdatecontext.hxx>
#include <validat.hxx>
#include <gridwin.hxx>
-#include <svl/listener.hxx>
#include <columnspanset.hxx>
#include <memory>
diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx
index 9516b92e570c..6dbf2c5e82d6 100644
--- a/sc/source/ui/unoobj/afmtuno.cxx
+++ b/sc/source/ui/unoobj/afmtuno.cxx
@@ -20,13 +20,10 @@
#include <scitems.hxx>
#include <editeng/memberids.h>
#include <osl/diagnose.h>
-#include <svl/intitem.hxx>
#include <svl/poolitem.hxx>
-#include <svl/eitem.hxx>
#include <vcl/svapp.hxx>
#include <svx/algitem.hxx>
#include <editeng/boxitem.hxx>
-#include <editeng/justifyitem.hxx>
#include <svx/unomid.hxx>
#include <unowids.hxx>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx
index 2a8fd368f204..097f8a982aed 100644
--- a/sc/source/ui/unoobj/appluno.cxx
+++ b/sc/source/ui/unoobj/appluno.cxx
@@ -20,7 +20,6 @@
#include <appluno.hxx>
#include <sal/types.h>
#include <osl/diagnose.h>
-#include <cppuhelper/factory.hxx>
#include <formula/funcvarargs.h>
#include <vcl/svapp.hxx>
@@ -36,7 +35,6 @@
#include <unonames.hxx>
#include <funcdesc.hxx>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/sheet/FunctionArgument.hpp>
#include <memory>
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 4b8613fc30be..8c00ecc12402 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -26,10 +26,8 @@
#include <svx/algitem.hxx>
#include <editeng/borderline.hxx>
#include <editeng/boxitem.hxx>
-#include <editeng/brushitem.hxx>
#include <editeng/editeng.hxx>
#include <editeng/flditem.hxx>
-#include <editeng/justifyitem.hxx>
#include <editeng/editobj.hxx>
#include <editeng/unoipset.hxx>
#include <editeng/langitem.hxx>
diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx
index c8bee745e5df..72618aa4f37f 100644
--- a/sc/source/ui/unoobj/defltuno.cxx
+++ b/sc/source/ui/unoobj/defltuno.cxx
@@ -18,7 +18,6 @@
*/
#include <editeng/memberids.h>
-#include <editeng/langitem.hxx>
#include <svl/hint.hxx>
#include <svl/itemprop.hxx>
#include <vcl/svapp.hxx>
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 7142e2807cf9..9eef212ee572 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -19,8 +19,6 @@
#include <config_feature_opencl.h>
-#include <boost/property_tree/json_parser.hpp>
-
#include <scitems.hxx>
#include <comphelper/sequence.hxx>
#include <editeng/editview.hxx>
diff --git a/sc/source/ui/unoobj/notesuno.cxx b/sc/source/ui/unoobj/notesuno.cxx
index 8929192825b6..11b8049d68fe 100644
--- a/sc/source/ui/unoobj/notesuno.cxx
+++ b/sc/source/ui/unoobj/notesuno.cxx
@@ -32,7 +32,6 @@
#include <cellsuno.hxx>
#include <docsh.hxx>
#include <docfunc.hxx>
-#include <hints.hxx>
#include <editsrc.hxx>
#include <miscuno.hxx>
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 5e32bb5f2417..49c2f684816b 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -21,10 +21,8 @@
#include <editeng/memberids.h>
#include <svx/algitem.hxx>
#include <editeng/boxitem.hxx>
-#include <editeng/justifyitem.hxx>
#include <editeng/langitem.hxx>
#include <editeng/numitem.hxx>
-#include <editeng/shaditem.hxx>
#include <svx/pageitem.hxx>
#include <editeng/pbinitem.hxx>
#include <svx/unomid.hxx>
diff --git a/sc/source/ui/unoobj/unodoc.cxx b/sc/source/ui/unoobj/unodoc.cxx
index 7f26aa3cc6d3..f8785249c1f3 100644
--- a/sc/source/ui/unoobj/unodoc.cxx
+++ b/sc/source/ui/unoobj/unodoc.cxx
@@ -17,11 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <rtl/ustring.hxx>
#include <sfx2/sfxmodelfactory.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <appluno.hxx>
#include <scdll.hxx>
#include <vcl/svapp.hxx>
diff --git a/sc/source/ui/vba/vbafiledialog.hxx b/sc/source/ui/vba/vbafiledialog.hxx
index 9f2b8e0f2677..98a0c76a5dfa 100644
--- a/sc/source/ui/vba/vbafiledialog.hxx
+++ b/sc/source/ui/vba/vbafiledialog.hxx
@@ -22,8 +22,6 @@
#include <ooo/vba/excel/XFileDialog.hpp>
#include <vbahelper/vbahelperinterface.hxx>
-#include <vbahelper/vbacollectionimpl.hxx>
-
namespace com::sun::star::uno { class XComponentContext; }
namespace ooo::vba { class XHelperInterface; }
namespace ooo::vba::excel { class XFileDialogSelectedItems; }
diff --git a/sc/source/ui/vba/vbafont.cxx b/sc/source/ui/vba/vbafont.cxx
index 2c7b4185b604..ef67d6925507 100644
--- a/sc/source/ui/vba/vbafont.cxx
+++ b/sc/source/ui/vba/vbafont.cxx
@@ -20,7 +20,6 @@
#include <com/sun/star/awt/FontUnderline.hpp>
#include <ooo/vba/excel/XlColorIndex.hpp>
#include <ooo/vba/excel/XlUnderlineStyle.hpp>
-#include <editeng/eeitem.hxx>
#include <svl/itemset.hxx>
#include "excelvbahelper.hxx"
#include "vbafont.hxx"
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index f71b8f3678e4..514733f9fb35 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -24,8 +24,6 @@
#include <comphelper/lok.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/request.hxx>
-#include <sfx2/sfxdlg.hxx>
-#include <svl/aeitem.hxx>
#include <basic/sbxcore.hxx>
#include <svl/whiter.hxx>
#include <svl/zforlist.hxx>
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 924ce27ab5f8..5112b80fcc69 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -47,7 +47,6 @@
#include <columnspanset.hxx>
#include <comphelper/lok.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
-#include <sfx2/lokhelper.hxx>
#include <memory>
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 60a57777c073..f237722439fb 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -67,7 +67,6 @@
#include <unordered_set>
#include <unordered_map>
#include <vector>
-#include <set>
#include <algorithm>
using namespace com::sun::star;
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 585e19c02a0b..80a1dd68378c 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -55,7 +55,6 @@
#include <sal/log.hxx>
#include <comphelper/lok.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
-#include <editeng/itemtype.hxx>
#include <formatsh.hxx>
#include <sc.hrc>
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 546d9cb9d8ac..418e73554096 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -28,8 +28,6 @@
#include <editeng/editstat.hxx>
#include <editeng/flditem.hxx>
#include <editeng/justifyitem.hxx>
-#include <editeng/unolingu.hxx>
-#include <editeng/langitem.hxx>
#include <editeng/misspellrange.hxx>
#include <editeng/editobj.hxx>
#include <sfx2/dispatch.hxx>
@@ -117,13 +115,12 @@
#include <queryentry.hxx>
#include <markdata.hxx>
#include <externalrefmgr.hxx>
-#include <dociter.hxx>
-#include <hints.hxx>
#include <spellcheckcontext.hxx>
#include <uiobject.hxx>
#include <undoblk.hxx>
#include <datamapper.hxx>
#include <inputopt.hxx>
+#include <queryparam.hxx>
#include <svx/sdrpagewindow.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
@@ -131,7 +128,6 @@
#include <vcl/uitest/logger.hxx>
#include <vcl/uitest/eventdescription.hxx>
#include <svx/sdr/overlay/overlayselection.hxx>
-#include <comphelper/string.hxx>
#include <comphelper/lok.hxx>
#include <sfx2/lokhelper.hxx>
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 4205db5c8fae..8d95ed2a133c 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -38,7 +38,6 @@
#include <svx/unoapi.hxx>
#include <sal/log.hxx>
#include <comphelper/lok.hxx>
-#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <output.hxx>
#include <document.hxx>
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 367d0dca1f5a..59c1ac497275 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -34,7 +34,6 @@
#include <editeng/fhgtitem.hxx>
#include <editeng/forbiddenruleitem.hxx>
#include <editeng/frmdiritem.hxx>
-#include <editeng/langitem.hxx>
#include <editeng/justifyitem.hxx>
#include <svx/rotmodit.hxx>
#include <editeng/udlnitem.hxx>
diff --git a/sc/source/ui/view/overlayobject.cxx b/sc/source/ui/view/overlayobject.cxx
index 50702170c043..67a77884fb88 100644
--- a/sc/source/ui/view/overlayobject.cxx
+++ b/sc/source/ui/view/overlayobject.cxx
@@ -22,7 +22,6 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
-#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <drawinglayer/primitive2d/PolyPolygonMarkerPrimitive2D.hxx>
#include <officecfg/Office/Common.hxx>
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index c95d45fd5dc0..da60252f99c5 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -65,8 +65,6 @@
#include <memory>
-#include <sfx2/sfxsids.hrc>
-
#define SC_PREVIEW_SHADOWSIZE 2
static tools::Long lcl_GetDisplayStart( SCTAB nTab, const ScDocument* pDoc, std::vector<tools::Long>& nPages )
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index c0304ef55493..e1109da50c0e 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -68,8 +68,6 @@
#include <vcl/EnumContext.hxx>
#include <vcl/notebookbar.hxx>
-#include <sfx2/sfxsids.hrc>
-
// for mouse wheel
#define MINZOOM_SLIDER 10
#define MAXZOOM_SLIDER 400
diff --git a/sc/source/ui/view/spellcheckcontext.cxx b/sc/source/ui/view/spellcheckcontext.cxx
index 971fa481c04f..637458f07385 100644
--- a/sc/source/ui/view/spellcheckcontext.cxx
+++ b/sc/source/ui/view/spellcheckcontext.cxx
@@ -8,15 +8,12 @@
*/
#include <spellcheckcontext.hxx>
-#include <i18nlangtag/languagetag.hxx>
#include <svl/sharedstring.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/langitem.hxx>
-#include <editeng/editeng.hxx>
#include <editeng/unolingu.hxx>
#include <scitems.hxx>
-#include <attarray.hxx>
#include <document.hxx>
#include <cellvalue.hxx>
#include <editutil.hxx>
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 70e781d5e30c..4374eae1d34c 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -48,7 +48,6 @@
#include <attrib.hxx>
#include <spellcheckcontext.hxx>
#include <comphelper/lok.hxx>
-#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <sfx2/lokhelper.hxx>
#include <boost/property_tree/ptree.hpp>
diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
index aa34633397ae..5238947a88f3 100644
--- a/sc/source/ui/view/tabview4.cxx
+++ b/sc/source/ui/view/tabview4.cxx
@@ -27,8 +27,6 @@
#include <gridwin.hxx>
#include <globstr.hrc>
#include <scresid.hxx>
-#include <formulacell.hxx>
-#include <dociter.hxx>
#include <inputhdl.hxx>
// --- Referenz-Eingabe / Fill-Cursor
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 68a76c329007..bb7ba06e840a 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -19,8 +19,6 @@
#include <sal/config.h>
-#include <scitems.hxx>
-#include <editeng/eeitem.hxx>
#include <formdata.hxx>
#include <sfx2/app.hxx>
@@ -56,7 +54,6 @@
#include <inputwin.hxx>
#include <dbdata.hxx>
#include <reffact.hxx>
-#include <fuinsert.hxx>
#include <viewuno.hxx>
#include <dispuno.hxx>
#include <chgtrack.hxx>
diff --git a/sc/source/ui/view/tabvwsh9.cxx b/sc/source/ui/view/tabvwsh9.cxx
index 7bf98acce6a4..03aa0615c052 100644
--- a/sc/source/ui/view/tabvwsh9.cxx
+++ b/sc/source/ui/view/tabvwsh9.cxx
@@ -33,8 +33,6 @@
#include "imapwrap.hxx"
#include <tabvwsh.hxx>
#include <viewdata.hxx>
-#include <drwlayer.hxx>
-#include <userdat.hxx>
#include <docsh.hxx>
#include <svx/galleryitem.hxx>
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index d6f2884ec182..500104e58d02 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -21,10 +21,8 @@
#include <comphelper/lok.hxx>
#include <editeng/boxitem.hxx>
-#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <o3tl/temporary.hxx>
#include <sfx2/bindings.hxx>
-#include <sfx2/lokhelper.hxx>
#include <sfx2/request.hxx>
#include <sfx2/sfxdlg.hxx>
#include <sfx2/sidebar/Sidebar.hxx>
diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx
index bd667a51be1e..51489544ade8 100644
--- a/sc/source/ui/view/tabvwshe.cxx
+++ b/sc/source/ui/view/tabvwshe.cxx
@@ -26,7 +26,6 @@
#include <svx/hlnkitem.hxx>
#include <svl/srchitem.hxx>
#include <sfx2/dispatch.hxx>
-#include <sfx2/viewfrm.hxx>
#include <sfx2/request.hxx>
#include <svl/stritem.hxx>
@@ -37,9 +36,7 @@
#include <editsh.hxx>
#include <dociter.hxx>
#include <inputhdl.hxx>
-#include <svx/srchdlg.hxx>
#include <document.hxx>
-#include <gridwin.hxx>
OUString ScTabViewShell::GetSelectionText( bool bWholeWord )
{
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 3371dedb8cc0..aae8c1bff580 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -59,7 +59,6 @@
#include <scmod.hxx>
#include <spelleng.hxx>
#include <patattr.hxx>
-#include <sc.hrc>
#include <tabvwsh.hxx>
#include <impex.hxx>
#include <editutil.hxx>
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index f85fbf75d6bd..aad9b69a8719 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -33,7 +33,6 @@
#include <svx/svdpage.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/docfile.hxx>
-#include <sfx2/lokhelper.hxx>
#include <comphelper/classids.hxx>
#include <sot/formats.hxx>
#include <sot/filelist.hxx>
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index d0484beb37c9..1c8d699b690a 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -26,7 +26,6 @@
#include <editeng/boxitem.hxx>
#include <editeng/editobj.hxx>
#include <editeng/langitem.hxx>
-#include <editeng/shaditem.hxx>
#include <editeng/justifyitem.hxx>
#include <sfx2/bindings.hxx>
#include <svl/zforlist.hxx>