sc/IwyuFilter_sc.yaml                                             |   86 
++++++++++
 sc/qa/unit/datacache.cxx                                          |    1 
 sc/qa/unit/dataproviders_test.cxx                                 |    3 
 sc/qa/unit/datatransformation_test.cxx                            |    1 
 sc/qa/unit/helper/qahelper.cxx                                    |    1 
 sc/qa/unit/range.cxx                                              |    1 
 sc/qa/unit/rangelst_test.cxx                                      |    1 
 sc/qa/unit/subsequent_export-test.cxx                             |    1 
 sc/qa/unit/subsequent_filters-test.cxx                            |    1 
 sc/qa/unit/ucalc.cxx                                              |    1 
 sc/qa/unit/ucalc_formula.cxx                                      |    2 
 sc/qa/unit/ucalc_sort.cxx                                         |    1 
 sc/source/filter/excel/excel.cxx                                  |    1 
 sc/source/filter/oox/workbookfragment.cxx                         |    1 
 sc/source/filter/xml/xmlimprt.cxx                                 |    1 
 sc/source/ui/Accessibility/AccessibleCell.cxx                     |    1 
 sc/source/ui/Accessibility/AccessibleContextBase.cxx              |    1 
 sc/source/ui/Accessibility/AccessibleFilterMenu.cxx               |    1 
 sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx           |    1 
 sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx          |    1 
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx              |    1 
 sc/source/ui/Accessibility/AccessibleTableBase.cxx                |    1 
 sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx |    3 
 sc/source/ui/app/scdll.cxx                                        |    1 
 sc/source/ui/attrdlg/scdlgfact.cxx                                |    1 
 sc/source/ui/condformat/condformatdlg.cxx                         |    1 
 sc/source/ui/condformat/condformatdlgentry.cxx                    |    3 
 sc/source/ui/condformat/condformathelper.cxx                      |    1 
 sc/source/ui/condformat/condformatmgr.cxx                         |    2 
 sc/source/ui/dataprovider/csvdataprovider.cxx                     |    3 
 sc/source/ui/dataprovider/dataprovider.cxx                        |    3 
 sc/source/ui/dataprovider/htmldataprovider.cxx                    |    3 
 sc/source/ui/dataprovider/sqldataprovider.cxx                     |    3 
 sc/source/ui/dataprovider/xmldataprovider.cxx                     |    2 
 sc/source/ui/dbgui/PivotLayoutDialog.cxx                          |    2 
 sc/source/ui/dbgui/csvruler.cxx                                   |    1 
 sc/source/ui/docshell/docsh.cxx                                   |    3 
 sc/source/ui/docshell/docsh3.cxx                                  |    1 
 sc/source/ui/docshell/docsh6.cxx                                  |    1 
 sc/source/ui/formdlg/dwfunctr.cxx                                 |    1 
 sc/source/ui/inc/AccessibilityHints.hxx                           |    1 
 sc/source/ui/inc/AccessibleCell.hxx                               |    6 
 sc/source/ui/inc/AccessibleCellBase.hxx                           |    1 
 sc/source/ui/inc/AccessibleContextBase.hxx                        |    6 
 sc/source/ui/inc/AccessibleEditObject.hxx                         |    4 
 sc/source/ui/inc/AccessiblePageHeader.hxx                         |    1 
 sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx                  |    1 
 sc/source/ui/inc/AccessibleSpreadsheet.hxx                        |    1 
 sc/source/ui/inc/AccessibleTableBase.hxx                          |    1 
 sc/source/ui/inc/AccessibleText.hxx                               |    2 
 sc/source/ui/inc/AnalysisOfVarianceDialog.hxx                     |    6 
 sc/source/ui/inc/ExponentialSmoothingDialog.hxx                   |    6 
 sc/source/ui/inc/IAnyRefDialog.hxx                                |    1 
 sc/source/ui/inc/MatrixComparisonGenerator.hxx                    |    6 
 sc/source/ui/inc/MovingAverageDialog.hxx                          |    6 
 sc/source/ui/inc/PivotLayoutDialog.hxx                            |    4 
 sc/source/ui/inc/PivotLayoutTreeListBase.hxx                      |    2 
 sc/source/ui/inc/RandomNumberGeneratorDialog.hxx                  |    4 
 sc/source/ui/inc/SamplingDialog.hxx                               |    3 
 sc/source/ui/inc/StatisticsInputOutputDialog.hxx                  |    3 
 sc/source/ui/inc/StatisticsTwoVariableDialog.hxx                  |    3 
 sc/source/ui/inc/TableFillingAndNavigationTools.hxx               |    5 
 sc/source/ui/inc/acredlin.hxx                                     |   11 -
 sc/source/ui/inc/anyrefdg.hxx                                     |    9 -
 sc/source/ui/inc/areasdlg.hxx                                     |    3 
 sc/source/ui/inc/attrdlg.hxx                                      |    1 
 sc/source/ui/inc/auditsh.hxx                                      |    1 
 sc/source/ui/inc/autofmt.hxx                                      |   10 -
 sc/source/ui/inc/cbutton.hxx                                      |    1 
 sc/source/ui/inc/cellmergeoption.hxx                              |    2 
 sc/source/ui/inc/cellsh.hxx                                       |    4 
 sc/source/ui/inc/chartsh.hxx                                      |    1 
 sc/source/ui/inc/checklistmenu.hxx                                |    2 
 sc/source/ui/inc/client.hxx                                       |    1 
 sc/source/ui/inc/cliputil.hxx                                     |    2 
 sc/source/ui/inc/colorformat.hxx                                  |    7 
 sc/source/ui/inc/condformatdlg.hxx                                |   11 -
 sc/source/ui/inc/condformatdlgentry.hxx                           |   11 -
 sc/source/ui/inc/condformathelper.hxx                             |    4 
 sc/source/ui/inc/condformatmgr.hxx                                |    9 -
 sc/source/ui/inc/condformatuno.hxx                                |    3 
 sc/source/ui/inc/conflictsdlg.hxx                                 |    5 
 sc/source/ui/inc/consdlg.hxx                                      |    1 
 sc/source/ui/inc/content.hxx                                      |    2 
 sc/source/ui/inc/crdlg.hxx                                        |    1 
 sc/source/ui/inc/crnrdlg.hxx                                      |    1 
 sc/source/ui/inc/csvcontrol.hxx                                   |    4 
 sc/source/ui/inc/csvgrid.hxx                                      |    2 
 sc/source/ui/inc/csvruler.hxx                                     |    2 
 sc/source/ui/inc/csvtablebox.hxx                                  |    1 
 sc/source/ui/inc/datafdlg.hxx                                     |    9 -
 sc/source/ui/inc/dataprovider.hxx                                 |   16 -
 sc/source/ui/inc/dataproviderdlg.hxx                              |    3 
 sc/source/ui/inc/datastream.hxx                                   |    3 
 sc/source/ui/inc/datastreamdlg.hxx                                |    6 
 sc/source/ui/inc/datatransformation.hxx                           |    2 
 sc/source/ui/inc/dbdocfun.hxx                                     |    7 
 sc/source/ui/inc/dbfunc.hxx                                       |    1 
 sc/source/ui/inc/docfunc.hxx                                      |    6 
 sc/source/ui/inc/docfuncutil.hxx                                  |    1 
 sc/source/ui/inc/docsh.hxx                                        |   18 --
 sc/source/ui/inc/dpcontrol.hxx                                    |    2 
 sc/source/ui/inc/dpgroupdlg.hxx                                   |    3 
 sc/source/ui/inc/drawsh.hxx                                       |    6 
 sc/source/ui/inc/drawutil.hxx                                     |    2 
 sc/source/ui/inc/drformsh.hxx                                     |    3 
 sc/source/ui/inc/drtxtob.hxx                                      |    3 
 sc/source/ui/inc/drwtrans.hxx                                     |    3 
 sc/source/ui/inc/dwfunctr.hxx                                     |   11 -
 sc/source/ui/inc/editable.hxx                                     |    1 
 sc/source/ui/inc/editfield.hxx                                    |    2 
 sc/source/ui/inc/editsh.hxx                                       |    4 
 sc/source/ui/miscdlgs/acredlin.cxx                                |    1 
 sc/source/ui/miscdlgs/autofmt.cxx                                 |    2 
 sc/source/ui/miscdlgs/conflictsdlg.cxx                            |    1 
 sc/source/ui/miscdlgs/crdlg.cxx                                   |    1 
 sc/source/ui/miscdlgs/datafdlg.cxx                                |    1 
 sc/source/ui/miscdlgs/dataproviderdlg.cxx                         |    3 
 sc/source/ui/miscdlgs/datastreamdlg.cxx                           |    1 
 sc/source/ui/namedlg/namedefdlg.cxx                               |    1 
 sc/source/ui/namedlg/namedlg.cxx                                  |    1 
 sc/source/ui/navipi/scenwnd.cxx                                   |    1 
 sc/source/ui/optdlg/tpusrlst.cxx                                  |    1 
 sc/source/ui/unoobj/confuno.cxx                                   |    1 
 sc/source/ui/unoobj/docuno.cxx                                    |    2 
 sc/source/ui/unoobj/unodoc.cxx                                    |    1 
 sc/source/ui/vba/vbaapplication.cxx                               |    1 
 127 files changed, 246 insertions(+), 215 deletions(-)

New commits:
commit 7dc9fb33db45c269fece6cfec993b124491c68f6
Author:     Gabor Kelemen <kelem...@ubuntu.com>
AuthorDate: Sat Oct 13 00:18:03 2018 +0200
Commit:     Miklos Vajna <vmik...@collabora.co.uk>
CommitDate: Tue Oct 16 09:04:29 2018 +0200

    tdf#42949 Fix IWYU warnings in sc/source/ui/inc/[a-e]*
    
    Also files starting with capital letters.
    
    Found with bin/find-unneeded-includes
    Only removal proposals are dealt with here.
    
    Change-Id: Ia79de45524315e2aaa1283ee6e42c54c9e14a31e
    Reviewed-on: https://gerrit.libreoffice.org/61735
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sc/IwyuFilter_sc.yaml b/sc/IwyuFilter_sc.yaml
index 80362e3bb13a..3f63ccb0cea8 100644
--- a/sc/IwyuFilter_sc.yaml
+++ b/sc/IwyuFilter_sc.yaml
@@ -397,3 +397,89 @@ blacklist:
     sc/source/filter/inc/xlstring.hxx:
     # Needed for template
     - o3tl/typed_flags_set.hxx
+    sc/source/ui/inc/AccessibleContextBase.hxx:
+    # base class has to be a complete type
+    - com/sun/star/accessibility/XAccessibleComponent.hpp
+    - com/sun/star/accessibility/XAccessibleContext.hpp
+    - com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp
+    - com/sun/star/accessibility/XAccessible.hpp
+    - com/sun/star/lang/XServiceInfo.hpp
+    sc/source/ui/inc/AccessibleCellBase.hxx:
+    # base class has to be a complete type
+    - com/sun/star/accessibility/XAccessibleValue.hpp
+    sc/source/ui/inc/AccessibleCell.hxx:
+    # base class has to be a complete type
+    - com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp
+    sc/source/ui/inc/AccessibleCsvControl.hxx:
+    # base class has to be a complete type
+    - com/sun/star/accessibility/XAccessibleSelection.hpp
+    - com/sun/star/accessibility/XAccessibleTable.hpp
+    - com/sun/star/accessibility/XAccessibleText.hpp
+    sc/source/ui/inc/AccessibleDocument.hxx:
+    # base class has to be a complete type
+    - com/sun/star/accessibility/XAccessibleSelection.hpp
+    - com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp
+    - com/sun/star/view/XSelectionChangeListener.hpp
+    sc/source/ui/inc/AccessiblePreviewTable.hxx:
+    # base class has to be a complete type
+    - com/sun/star/accessibility/XAccessibleTable.hpp
+    sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx:
+    # base class has to be a complete type
+    - com/sun/star/accessibility/XAccessibleValue.hpp
+    sc/source/ui/inc/AccessibleTableBase.hxx:
+    # base class has to be a complete type
+    - com/sun/star/accessibility/XAccessibleSelection.hpp
+    - com/sun/star/accessibility/XAccessibleTable.hpp
+    - com/sun/star/accessibility/XAccessibleTableSelection.hpp
+    sc/source/ui/inc/ChartRangeSelectionListener.hxx:
+    # base class has to be a complete type
+    - com/sun/star/lang/XServiceInfo.hpp
+    - com/sun/star/view/XSelectionChangeListener.hpp
+    sc/source/ui/inc/AnalysisOfVarianceDialog.hxx:
+    # base class has to be a complete type
+    - viewdata.hxx
+    sc/source/ui/inc/anyrefdg.hxx:
+    # base struct has to be a complete type
+    - sfx2/basedlgs.hxx
+    sc/source/ui/inc/anyrefdg.hxx:
+    # base struct has to be a complete type
+    - sfx2/basedlgs.hxx
+    sc/source/ui/inc/condformatuno.hxx:
+    # base struct has to be a complete type
+    - com/sun/star/beans/XPropertySet.hpp
+    - com/sun/star/sheet/XColorScaleEntry.hpp
+    - com/sun/star/sheet/XConditionalFormat.hpp
+    - com/sun/star/sheet/XConditionalFormats.hpp
+    - com/sun/star/sheet/XConditionEntry.hpp
+    - com/sun/star/sheet/XDataBarEntry.hpp
+    - com/sun/star/sheet/XIconSetEntry.hpp
+    sc/source/ui/inc/dataprovider.hxx:
+    # Don't replace with an implementation detail
+    - orcus/csv_parser.hpp
+    sc/source/ui/inc/DrawModelBroadcaster.hxx:
+    # base class has to be a complete type
+    - com/sun/star/document/XEventBroadcaster.hpp
+    sc/source/ui/inc/ExponentialSmoothingDialog.hxx:
+    # base class has to be a complete type
+    - viewdata.hxx
+    sc/source/ui/inc/MatrixComparisonGenerator.hxx:
+    # base class has to be a complete type
+    - viewdata.hxx
+    sc/source/ui/inc/MovingAverageDialog.hxx:
+    # base class has to be a complete type
+    - viewdata.hxx
+    sc/source/ui/inc/PivotLayoutDialog.hxx:
+    # base class has to be a complete type
+    - viewdata.hxx
+    sc/source/ui/inc/RandomNumberGeneratorDialog.hxx:
+    # base class has to be a complete type
+    - viewdata.hxx
+    sc/source/ui/inc/StatisticsInputOutputDialog.hxx:
+    # base class has to be a complete type
+    - viewdata.hxx
+    sc/source/ui/inc/SamplingDialog.hxx:
+    # base class has to be a complete type
+    - viewdata.hxx
+    sc/source/ui/inc/StatisticsTwoVariableDialog.hxx:
+    # base class has to be a complete type
+    - viewdata.hxx
diff --git a/sc/qa/unit/datacache.cxx b/sc/qa/unit/datacache.cxx
index f95b7028b971..d389bdf3d8b1 100644
--- a/sc/qa/unit/datacache.cxx
+++ b/sc/qa/unit/datacache.cxx
@@ -14,6 +14,7 @@
 
 #include <global.hxx>
 #include <document.hxx>
+#include <scdll.hxx>
 
 #include <tools/stream.hxx>
 
diff --git a/sc/qa/unit/dataproviders_test.cxx 
b/sc/qa/unit/dataproviders_test.cxx
index ceb682e3091f..2885a5a53a2e 100644
--- a/sc/qa/unit/dataproviders_test.cxx
+++ b/sc/qa/unit/dataproviders_test.cxx
@@ -13,6 +13,9 @@
 #include <stringutil.hxx>
 #include <address.hxx>
 #include <dataprovider.hxx>
+#include <dbdata.hxx>
+#include <datamapper.hxx>
+#include <scdll.hxx>
 #include <vcl/scheduler.hxx>
 #include <orcusxml.hxx>
 
diff --git a/sc/qa/unit/datatransformation_test.cxx 
b/sc/qa/unit/datatransformation_test.cxx
index f1aba85b82bc..4872f5684ec9 100644
--- a/sc/qa/unit/datatransformation_test.cxx
+++ b/sc/qa/unit/datatransformation_test.cxx
@@ -15,6 +15,7 @@
 #include <address.hxx>
 #include <dataprovider.hxx>
 #include <datatransformation.hxx>
+#include <scdll.hxx>
 #include <vcl/scheduler.hxx>
 #include <tools/datetime.hxx>
 #include <tools/time.hxx>
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 73af82070253..fba0f6f6b6c4 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -23,6 +23,7 @@
 #include <cppunit/Asserter.h>
 #include <cppunit/AdditionalMessage.h>
 #include <sal/log.hxx>
+#include <sfx2/sfxsids.hrc>
 
 #include <orcus/csv_parser.hpp>
 
diff --git a/sc/qa/unit/range.cxx b/sc/qa/unit/range.cxx
index ddc84e94ef69..67f4ecb92194 100644
--- a/sc/qa/unit/range.cxx
+++ b/sc/qa/unit/range.cxx
@@ -14,6 +14,7 @@
 #include <document.hxx>
 #include <docsh.hxx>
 #include <global.hxx>
+#include <scdll.hxx>
 
 #include <address.hxx>
 #include <rangeutl.hxx>
diff --git a/sc/qa/unit/rangelst_test.cxx b/sc/qa/unit/rangelst_test.cxx
index 01e815aed24b..f955fc9167ef 100644
--- a/sc/qa/unit/rangelst_test.cxx
+++ b/sc/qa/unit/rangelst_test.cxx
@@ -12,6 +12,7 @@
 #include "helper/qahelper.hxx"
 #include <document.hxx>
 #include <docsh.hxx>
+#include <scdll.hxx>
 
 #include <rangelst.hxx>
 
diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index 6c355d1d0e5d..ef0b5c96eec2 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -18,6 +18,7 @@
 #include <sfx2/frame.hxx>
 #include <sfx2/sfxmodelfactory.hxx>
 #include <svl/stritem.hxx>
+#include <sfx2/sfxsids.hrc>
 
 #include "helper/qahelper.hxx"
 #include "helper/xpath.hxx"
diff --git a/sc/qa/unit/subsequent_filters-test.cxx 
b/sc/qa/unit/subsequent_filters-test.cxx
index f06aca38ecf5..a2993d216e88 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -44,6 +44,7 @@
 #include <dbdata.hxx>
 #include <validat.hxx>
 #include <formulacell.hxx>
+#include <formulaopt.hxx>
 #include <userdat.hxx>
 #include <stlsheet.hxx>
 #include <docfunc.hxx>
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 4a87267be6e7..a5af0c3e0db0 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -88,6 +88,7 @@
 #include <svl/sharedstringpool.hxx>
 
 #include <sfx2/docfile.hxx>
+#include <sfx2/sfxsids.hrc>
 
 #include <iostream>
 #include <memory>
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 0b1c4a03bd9a..15efbbf09b36 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -31,11 +31,13 @@
 #include <patattr.hxx>
 #include <docpool.hxx>
 #include <docoptio.hxx>
+#include <formulaopt.hxx>
 
 #include <formula/vectortoken.hxx>
 #include <o3tl/make_unique.hxx>
 #include <officecfg/Office/Common.hxx>
 #include <svl/broadcast.hxx>
+#include <svl/intitem.hxx>
 
 #include <memory>
 #include <functional>
diff --git a/sc/qa/unit/ucalc_sort.cxx b/sc/qa/unit/ucalc_sort.cxx
index 26287c09f617..9a2c759b0aab 100644
--- a/sc/qa/unit/ucalc_sort.cxx
+++ b/sc/qa/unit/ucalc_sort.cxx
@@ -23,6 +23,7 @@
 #include <editutil.hxx>
 #include <table.hxx>
 #include <drwlayer.hxx>
+#include <formulaopt.hxx>
 
 #include <sal/config.h>
 #include <editeng/wghtitem.hxx>
diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx
index edc446b75362..8695ce24150a 100644
--- a/sc/source/filter/excel/excel.cxx
+++ b/sc/source/filter/excel/excel.cxx
@@ -22,6 +22,7 @@
 #include <sfx2/app.hxx>
 #include <sfx2/frame.hxx>
 #include <sfx2/request.hxx>
+#include <sfx2/sfxsids.hrc>
 #include <sot/storage.hxx>
 #include <sot/exchange.hxx>
 #include <filter/msfilter/classids.hxx>
diff --git a/sc/source/filter/oox/workbookfragment.cxx 
b/sc/source/filter/oox/workbookfragment.cxx
index 09d9366e5f06..93295a6fbac6 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -59,6 +59,7 @@
 #include <globstr.hrc>
 #include <scresid.hxx>
 #include <scmod.hxx>
+#include <formulaopt.hxx>
 
 #include <vcl/svapp.hxx>
 #include <vcl/timer.hxx>
diff --git a/sc/source/filter/xml/xmlimprt.cxx 
b/sc/source/filter/xml/xmlimprt.cxx
index 8c5f649aeee5..d0bf81f8468f 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -78,6 +78,7 @@
 #include <unonames.hxx>
 #include <numformat.hxx>
 #include <sizedev.hxx>
+#include <scdll.hxx>
 
 #include <comphelper/base64.hxx>
 #include <comphelper/extract.hxx>
diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx 
b/sc/source/ui/Accessibility/AccessibleCell.cxx
index 21d0c48554d8..d07a2a07f3fb 100644
--- a/sc/source/ui/Accessibility/AccessibleCell.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCell.cxx
@@ -40,6 +40,7 @@
 #include <validat.hxx>
 
 #include <unotools/accessiblestatesethelper.hxx>
+#include <unotools/accessiblerelationsethelper.hxx>
 #include <com/sun/star/accessibility/AccessibleRole.hpp>
 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
 #include <com/sun/star/accessibility/AccessibleRelationType.hpp>
diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx 
b/sc/source/ui/Accessibility/AccessibleContextBase.cxx
index ba615cd412a8..635abbf3f73b 100644
--- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx
@@ -21,6 +21,7 @@
 #include <com/sun/star/accessibility/AccessibleRole.hpp>
 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include 
<com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp>
 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
 #include <tools/gen.hxx>
 #include <unotools/accessiblestatesethelper.hxx>
diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx 
b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx
index 2edec7eb6391..e32f86d5d5a7 100644
--- a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx
+++ b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx
@@ -35,6 +35,7 @@
 #include <com/sun/star/accessibility/AccessibleRole.hpp>
 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::accessibility;
diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx 
b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx
index 1767837e127f..a42507b6046d 100644
--- a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx
+++ b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx
@@ -28,6 +28,7 @@
 #include <com/sun/star/accessibility/AccessibleEventObject.hpp>
 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
 #include <com/sun/star/accessibility/TextSegment.hpp>
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::accessibility;
diff --git a/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx 
b/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx
index 840bc0acbf82..ad2d739cd94b 100644
--- a/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx
+++ b/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx
@@ -22,6 +22,7 @@
 #include <checklistmenu.hxx>
 
 #include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::accessibility;
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx 
b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index 9b8c17f1a687..dc1dc0cac7bc 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -29,6 +29,7 @@
 #include <gridwin.hxx>
 
 #include <unotools/accessiblestatesethelper.hxx>
+#include <unotools/accessiblerelationsethelper.hxx>
 #include <com/sun/star/accessibility/AccessibleRole.hpp>
 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
diff --git a/sc/source/ui/Accessibility/AccessibleTableBase.cxx 
b/sc/source/ui/Accessibility/AccessibleTableBase.cxx
index 5cd1af79915e..6b9705ec7bba 100644
--- a/sc/source/ui/Accessibility/AccessibleTableBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleTableBase.cxx
@@ -28,6 +28,7 @@
 #include <com/sun/star/accessibility/AccessibleRole.hpp>
 #include <com/sun/star/accessibility/AccessibleTableModelChange.hpp>
 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
 #include <comphelper/sequence.hxx>
 #include <vcl/svapp.hxx>
 
diff --git a/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx 
b/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx
index 3998bba8298a..9c972d84b636 100644
--- a/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx
+++ b/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx
@@ -17,6 +17,9 @@
 #include <editutil.hxx>
 
 #include <TableFillingAndNavigationTools.hxx>
+#include <formulacell.hxx>
+#include <docfunc.hxx>
+#include <docsh.hxx>
 
 FormulaTemplate::FormulaTemplate(ScDocument* pDoc)
     : mpDoc(pDoc)
diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index 435cb6fa1549..e6a360398341 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -62,6 +62,7 @@
 #include <graphsh.hxx>
 #include <mediash.hxx>
 #include <pgbrksh.hxx>
+#include <scdll.hxx>
 
 #include <docpool.hxx>
 #include <appoptio.hxx>
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx 
b/sc/source/ui/attrdlg/scdlgfact.cxx
index a23634a41d7d..677a5dd2f518 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -75,6 +75,7 @@
 #include <scres.hrc>
 #include <svx/dialogs.hrc>
 #include <sfx2/sfxdlg.hxx>
+#include <conditio.hxx>
 
 IMPL_ABSTDLG_BASE(AbstractScImportAsciiDlg_Impl);
 IMPL_ABSTDLG_BASE(AbstractScAutoFormatDlg_Impl);
diff --git a/sc/source/ui/condformat/condformatdlg.cxx 
b/sc/source/ui/condformat/condformatdlg.cxx
index 7776ea958f86..eddbb1514f53 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -18,6 +18,7 @@
 #include <svx/drawitem.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/builderfactory.hxx>
+#include <vcl/lstbox.hxx>
 #include <libxml/tree.h>
 
 #include <anyrefdg.hxx>
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx 
b/sc/source/ui/condformat/condformatdlgentry.cxx
index e8651496c864..bf0fae46c56a 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -11,6 +11,9 @@
 #include <condformatdlg.hxx>
 #include <condformatdlgentry.hxx>
 #include <conditio.hxx>
+#include <compiler.hxx>
+#include <colorscale.hxx>
+#include <condformathelper.hxx>
 
 #include <document.hxx>
 
diff --git a/sc/source/ui/condformat/condformathelper.cxx 
b/sc/source/ui/condformat/condformathelper.cxx
index 5b8e192ba044..0699acf476ba 100644
--- a/sc/source/ui/condformat/condformathelper.cxx
+++ b/sc/source/ui/condformat/condformathelper.cxx
@@ -11,6 +11,7 @@
 #include <condformathelper.hxx>
 #include <globstr.hrc>
 #include <scresid.hxx>
+#include <conditio.hxx>
 
 namespace {
 
diff --git a/sc/source/ui/condformat/condformatmgr.cxx 
b/sc/source/ui/condformat/condformatmgr.cxx
index 078714b138bd..ccd569a90c70 100644
--- a/sc/source/ui/condformat/condformatmgr.cxx
+++ b/sc/source/ui/condformat/condformatmgr.cxx
@@ -8,10 +8,12 @@
  */
 
 #include <condformatmgr.hxx>
+#include <condformathelper.hxx>
 #include <globstr.hrc>
 #include <scresid.hxx>
 #include <condformatdlg.hxx>
 #include <document.hxx>
+#include <conditio.hxx>
 
 ScCondFormatManagerWindow::ScCondFormatManagerWindow(SvSimpleTableContainer& 
rParent,
     ScDocument* pDoc, ScConditionalFormatList* pFormatList)
diff --git a/sc/source/ui/dataprovider/csvdataprovider.cxx 
b/sc/source/ui/dataprovider/csvdataprovider.cxx
index 92176f9a55f6..ec2f83906d5d 100644
--- a/sc/source/ui/dataprovider/csvdataprovider.cxx
+++ b/sc/source/ui/dataprovider/csvdataprovider.cxx
@@ -9,8 +9,11 @@
 
 #include <dataprovider.hxx>
 #include <datatransformation.hxx>
+#include <datamapper.hxx>
 #include <stringutil.hxx>
 
+#include <vcl/svapp.hxx>
+#include <docsh.hxx>
 #include <orcus/csv_parser.hpp>
 #include <utility>
 
diff --git a/sc/source/ui/dataprovider/dataprovider.cxx 
b/sc/source/ui/dataprovider/dataprovider.cxx
index 8c13add177e4..2e01ae1c3418 100644
--- a/sc/source/ui/dataprovider/dataprovider.cxx
+++ b/sc/source/ui/dataprovider/dataprovider.cxx
@@ -19,6 +19,9 @@
 #include "xmldataprovider.hxx"
 #include "sqldataprovider.hxx"
 #include <datatransformation.hxx>
+#include <datamapper.hxx>
+#include <dbdata.hxx>
+#include <docsh.hxx>
 
 using namespace com::sun::star;
 
diff --git a/sc/source/ui/dataprovider/htmldataprovider.cxx 
b/sc/source/ui/dataprovider/htmldataprovider.cxx
index d5b1903d93ff..c70ce00fa63e 100644
--- a/sc/source/ui/dataprovider/htmldataprovider.cxx
+++ b/sc/source/ui/dataprovider/htmldataprovider.cxx
@@ -8,8 +8,11 @@
  */
 
 #include "htmldataprovider.hxx"
+#include <datamapper.hxx>
 #include <datatransformation.hxx>
 #include <salhelper/thread.hxx>
+#include <vcl/svapp.hxx>
+#include <tools/stream.hxx>
 
 #include <libxml/HTMLparser.h>
 #include <libxml/HTMLtree.h>
diff --git a/sc/source/ui/dataprovider/sqldataprovider.cxx 
b/sc/source/ui/dataprovider/sqldataprovider.cxx
index 1c16b1647844..4414c2d77da4 100644
--- a/sc/source/ui/dataprovider/sqldataprovider.cxx
+++ b/sc/source/ui/dataprovider/sqldataprovider.cxx
@@ -27,6 +27,9 @@
 #include <comphelper/string.hxx>
 #include <miscuno.hxx>
 #include <dbdocutl.hxx>
+#include <datamapper.hxx>
+#include <vcl/svapp.hxx>
+#include <comphelper/processfactory.hxx>
 
 using namespace css;
 using namespace ::com::sun::star::beans;
diff --git a/sc/source/ui/dataprovider/xmldataprovider.cxx 
b/sc/source/ui/dataprovider/xmldataprovider.cxx
index 67bd92e3ddad..ad72c3cf9ea2 100644
--- a/sc/source/ui/dataprovider/xmldataprovider.cxx
+++ b/sc/source/ui/dataprovider/xmldataprovider.cxx
@@ -13,6 +13,8 @@
 #include <comphelper/string.hxx>
 #include <filter.hxx>
 #include <document.hxx>
+#include <datamapper.hxx>
+#include <vcl/svapp.hxx>
 #include <orcusfilters.hxx>
 #include <utility>
 
diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx 
b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index e12be901ba99..43f82ed302f5 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -19,6 +19,8 @@
 #include <uiitems.hxx>
 #include <dputil.hxx>
 #include <dbdocfun.hxx>
+#include <dpsave.hxx>
+#include <dpshttab.hxx>
 
 #include <memory>
 #include <vector>
diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx
index 86acdc1ec807..529838a05d37 100644
--- a/sc/source/ui/dbgui/csvruler.cxx
+++ b/sc/source/ui/dbgui/csvruler.cxx
@@ -25,6 +25,7 @@
 #include <com/sun/star/uno/Sequence.hxx>
 #include <comphelper/string.hxx>
 #include <vcl/settings.hxx>
+#include <vcl/virdev.hxx>
 #include <miscuno.hxx>
 
 using namespace com::sun::star::uno;
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 39eb8c840e5f..6cdc2c35dc4e 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -72,6 +72,7 @@
 #include <com/sun/star/frame/XStorable2.hpp>
 #include <com/sun/star/frame/Desktop.hpp>
 #include <com/sun/star/lang/XSingleComponentFactory.hpp>
+#include <ooo/vba/excel/XWorkbook.hpp>
 
 #include <config_folders.h>
 
@@ -103,6 +104,8 @@
 #include <pntlock.hxx>
 #include <docuno.hxx>
 #include <appoptio.hxx>
+#include <formulaopt.hxx>
+#include <scdll.hxx>
 #include <detdata.hxx>
 #include <printfun.hxx>
 #include <dociter.hxx>
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 4c6d682b45b2..c57c0ecb52b8 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -64,6 +64,7 @@
 #include <scresid.hxx>
 #include <markdata.hxx>
 #include <memory>
+#include <formulaopt.hxx>
 
 #include <comphelper/lok.hxx>
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index e0a872778fcd..3211896d4cf1 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -37,6 +37,7 @@
 #include <compiler.hxx>
 #include <interpre.hxx>
 #include <calcconfig.hxx>
+#include <formulaopt.hxx>
 
 #include <vcl/svapp.hxx>
 #include <vcl/weld.hxx>
diff --git a/sc/source/ui/formdlg/dwfunctr.cxx 
b/sc/source/ui/formdlg/dwfunctr.cxx
index 527c3a5de512..0f226c199df3 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -35,6 +35,7 @@
 #include <tabvwsh.hxx>
 #include <appoptio.hxx>
 #include <compiler.hxx>
+#include <funcdesc.hxx>
 
 #include <dwfunctr.hxx>
 
diff --git a/sc/source/ui/inc/AccessibilityHints.hxx 
b/sc/source/ui/inc/AccessibilityHints.hxx
index 3b47217d6fbf..5e40f6e075ec 100644
--- a/sc/source/ui/inc/AccessibilityHints.hxx
+++ b/sc/source/ui/inc/AccessibilityHints.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_SC_SOURCE_UI_INC_ACCESSIBILITYHINTS_HXX
 
 #include "viewdata.hxx"
-#include <com/sun/star/uno/XInterface.hpp>
 #include <svl/hint.hxx>
 
 class ScAccWinFocusLostHint : public SfxHint
diff --git a/sc/source/ui/inc/AccessibleCell.hxx 
b/sc/source/ui/inc/AccessibleCell.hxx
index 24dce5df3750..5c5542daf337 100644
--- a/sc/source/ui/inc/AccessibleCell.hxx
+++ b/sc/source/ui/inc/AccessibleCell.hxx
@@ -22,15 +22,15 @@
 
 #include <memory>
 #include "AccessibleCellBase.hxx"
-#include <global.hxx>
 #include "viewdata.hxx"
 #include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
-#include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
 #include <rtl/ref.hxx>
-#include <unotools/accessiblerelationsethelper.hxx>
 #include <editeng/AccessibleStaticTextBase.hxx>
 #include <comphelper/uno3.hxx>
 
+namespace com { namespace sun { namespace star { namespace accessibility { 
class XAccessibleRelationSet; } } } }
+namespace utl { class AccessibleRelationSetHelper; }
+
 class ScTabViewShell;
 class ScAccessibleDocument;
 
diff --git a/sc/source/ui/inc/AccessibleCellBase.hxx 
b/sc/source/ui/inc/AccessibleCellBase.hxx
index 442ff773640e..5e6aa51ba7d8 100644
--- a/sc/source/ui/inc/AccessibleCellBase.hxx
+++ b/sc/source/ui/inc/AccessibleCellBase.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_SC_SOURCE_UI_INC_ACCESSIBLECELLBASE_HXX
 
 #include "AccessibleContextBase.hxx"
-#include <global.hxx>
 #include <address.hxx>
 #include <com/sun/star/accessibility/XAccessibleValue.hpp>
 #include <cppuhelper/implbase1.hxx>
diff --git a/sc/source/ui/inc/AccessibleContextBase.hxx 
b/sc/source/ui/inc/AccessibleContextBase.hxx
index d616fa708e54..d8e7353f123b 100644
--- a/sc/source/ui/inc/AccessibleContextBase.hxx
+++ b/sc/source/ui/inc/AccessibleContextBase.hxx
@@ -24,14 +24,8 @@
 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
-#include 
<com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/uno/Reference.hxx>
-#include <cppuhelper/weak.hxx>
 #include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XTypeProvider.hpp>
-#include <com/sun/star/lang/XServiceName.hpp>
-#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
 #include <cppuhelper/interfacecontainer.h>
 
 #include <svl/lstner.hxx>
diff --git a/sc/source/ui/inc/AccessibleEditObject.hxx 
b/sc/source/ui/inc/AccessibleEditObject.hxx
index 7fb9c6c1b569..9d5160da9c0f 100644
--- a/sc/source/ui/inc/AccessibleEditObject.hxx
+++ b/sc/source/ui/inc/AccessibleEditObject.hxx
@@ -23,8 +23,8 @@
 #include "AccessibleContextBase.hxx"
 
 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
-#include <global.hxx>
-#include <vcl/window.hxx>
+#include <address.hxx>
+#include <vcl/vclptr.hxx>
 
 #include <memory>
 
diff --git a/sc/source/ui/inc/AccessiblePageHeader.hxx 
b/sc/source/ui/inc/AccessiblePageHeader.hxx
index b0ec25cc8143..7207ee516d42 100644
--- a/sc/source/ui/inc/AccessiblePageHeader.hxx
+++ b/sc/source/ui/inc/AccessiblePageHeader.hxx
@@ -27,7 +27,6 @@
 class ScPreviewShell;
 class EditTextObject;
 class ScAccessiblePageHeaderArea;
-class ScPreviewShell;
 
 class ScAccessiblePageHeader : public ScAccessibleContextBase
 {
diff --git a/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx 
b/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx
index 1217e7b5af57..65293b5692c9 100644
--- a/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx
+++ b/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx
@@ -23,7 +23,6 @@
 #include "AccessibleContextBase.hxx"
 #include <com/sun/star/accessibility/XAccessibleValue.hpp>
 #include <tools/gen.hxx>
-#include <global.hxx>
 #include <address.hxx>
 #include <cppuhelper/implbase1.hxx>
 
diff --git a/sc/source/ui/inc/AccessibleSpreadsheet.hxx 
b/sc/source/ui/inc/AccessibleSpreadsheet.hxx
index ab7a070fd48f..b425e92faff1 100644
--- a/sc/source/ui/inc/AccessibleSpreadsheet.hxx
+++ b/sc/source/ui/inc/AccessibleSpreadsheet.hxx
@@ -50,7 +50,6 @@ public:
 class ScTabViewShell;
 class ScAccessibleDocument;
 class ScAccessibleCell;
-class ScRangeList;
 
 /** @descr
         This base class provides an implementation of the
diff --git a/sc/source/ui/inc/AccessibleTableBase.hxx 
b/sc/source/ui/inc/AccessibleTableBase.hxx
index 2655fe67f0d7..a7e8a606788b 100644
--- a/sc/source/ui/inc/AccessibleTableBase.hxx
+++ b/sc/source/ui/inc/AccessibleTableBase.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_SC_SOURCE_UI_INC_ACCESSIBLETABLEBASE_HXX
 
 #include "AccessibleContextBase.hxx"
-#include <global.hxx>
 #include <address.hxx>
 #include <com/sun/star/accessibility/XAccessibleTable.hpp>
 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
diff --git a/sc/source/ui/inc/AccessibleText.hxx 
b/sc/source/ui/inc/AccessibleText.hxx
index ec9e1a8f4411..bf631629237f 100644
--- a/sc/source/ui/inc/AccessibleText.hxx
+++ b/sc/source/ui/inc/AccessibleText.hxx
@@ -21,7 +21,7 @@
 #define INCLUDED_SC_SOURCE_UI_INC_ACCESSIBLETEXT_HXX
 
 #include <textuno.hxx>
-#include <global.hxx>
+#include <address.hxx>
 #include "viewdata.hxx"
 #include <editeng/svxenum.hxx>
 #include <svl/SfxBroadcaster.hxx>
diff --git a/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx 
b/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx
index cfce77924032..0af68255b4b5 100644
--- a/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx
+++ b/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx
@@ -11,12 +11,8 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_ANALYSISOFVARIANCEDIALOG_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_ANALYSISOFVARIANCEDIALOG_HXX
 
-#include <global.hxx>
 #include <address.hxx>
-#include "anyrefdg.hxx"
-
-#include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
+#include "viewdata.hxx"
 
 #include "StatisticsInputOutputDialog.hxx"
 
diff --git a/sc/source/ui/inc/ExponentialSmoothingDialog.hxx 
b/sc/source/ui/inc/ExponentialSmoothingDialog.hxx
index 8634886dac44..ae2b255df918 100644
--- a/sc/source/ui/inc/ExponentialSmoothingDialog.hxx
+++ b/sc/source/ui/inc/ExponentialSmoothingDialog.hxx
@@ -11,12 +11,8 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_EXPONENTIALSMOOTHINGDIALOG_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_EXPONENTIALSMOOTHINGDIALOG_HXX
 
-#include <global.hxx>
 #include <address.hxx>
-#include "anyrefdg.hxx"
-
-#include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
+#include "viewdata.hxx"
 
 #include "StatisticsInputOutputDialog.hxx"
 
diff --git a/sc/source/ui/inc/IAnyRefDialog.hxx 
b/sc/source/ui/inc/IAnyRefDialog.hxx
index cbaf82614261..0e4f81f41572 100644
--- a/sc/source/ui/inc/IAnyRefDialog.hxx
+++ b/sc/source/ui/inc/IAnyRefDialog.hxx
@@ -23,7 +23,6 @@
 
 class ScRange;
 class ScDocument;
-class ScTabViewShell;
 class SfxObjectShell;
 namespace formula
 {
diff --git a/sc/source/ui/inc/MatrixComparisonGenerator.hxx 
b/sc/source/ui/inc/MatrixComparisonGenerator.hxx
index 8e22dbd62c46..cce103291a51 100644
--- a/sc/source/ui/inc/MatrixComparisonGenerator.hxx
+++ b/sc/source/ui/inc/MatrixComparisonGenerator.hxx
@@ -11,12 +11,8 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_MATRIXCOMPARISONGENERATOR_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_MATRIXCOMPARISONGENERATOR_HXX
 
-#include <global.hxx>
 #include <address.hxx>
-#include "anyrefdg.hxx"
-
-#include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
+#include "viewdata.hxx"
 
 #include "StatisticsInputOutputDialog.hxx"
 
diff --git a/sc/source/ui/inc/MovingAverageDialog.hxx 
b/sc/source/ui/inc/MovingAverageDialog.hxx
index ef23cfbd03a3..02cdcca6df7a 100644
--- a/sc/source/ui/inc/MovingAverageDialog.hxx
+++ b/sc/source/ui/inc/MovingAverageDialog.hxx
@@ -11,12 +11,8 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_MOVINGAVERAGEDIALOG_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_MOVINGAVERAGEDIALOG_HXX
 
-#include <global.hxx>
 #include <address.hxx>
-#include "anyrefdg.hxx"
-
-#include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
+#include "viewdata.hxx"
 
 #include "StatisticsInputOutputDialog.hxx"
 
diff --git a/sc/source/ui/inc/PivotLayoutDialog.hxx 
b/sc/source/ui/inc/PivotLayoutDialog.hxx
index c35693609105..7d24443b4f69 100644
--- a/sc/source/ui/inc/PivotLayoutDialog.hxx
+++ b/sc/source/ui/inc/PivotLayoutDialog.hxx
@@ -11,13 +11,9 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_PIVOTLAYOUTDIALOG_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_PIVOTLAYOUTDIALOG_HXX
 
-#include <svx/checklbx.hxx>
 #include <vcl/lstbox.hxx>
 #include "anyrefdg.hxx"
 #include <dpobject.hxx>
-#include <dpsave.hxx>
-#include <dpshttab.hxx>
-#include <document.hxx>
 #include "viewdata.hxx"
 
 #include "PivotLayoutTreeList.hxx"
diff --git a/sc/source/ui/inc/PivotLayoutTreeListBase.hxx 
b/sc/source/ui/inc/PivotLayoutTreeListBase.hxx
index 25ebec3f33bb..147792ea5bac 100644
--- a/sc/source/ui/inc/PivotLayoutTreeListBase.hxx
+++ b/sc/source/ui/inc/PivotLayoutTreeListBase.hxx
@@ -13,8 +13,6 @@
 
 #include <svtools/treelistbox.hxx>
 
-#include <vcl/builder.hxx>
-
 #include <pivot.hxx>
 
 class ScPivotLayoutDialog;
diff --git a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx 
b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx
index 7719a679105e..06854a480d90 100644
--- a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx
+++ b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx
@@ -11,14 +11,14 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_RANDOMNUMBERGENERATORDIALOG_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_RANDOMNUMBERGENERATORDIALOG_HXX
 
-#include <global.hxx>
 #include <address.hxx>
 #include "anyrefdg.hxx"
+#include "viewdata.hxx"
 
 #include <vcl/fixed.hxx>
 #include <vcl/lstbox.hxx>
 
-#include <boost/optional.hpp>
+namespace boost { template <typename T> class optional; }
 
 class ScRandomNumberGeneratorDialog : public ScAnyRefDlg
 {
diff --git a/sc/source/ui/inc/SamplingDialog.hxx 
b/sc/source/ui/inc/SamplingDialog.hxx
index 8446227c9d41..9b66be6e82c3 100644
--- a/sc/source/ui/inc/SamplingDialog.hxx
+++ b/sc/source/ui/inc/SamplingDialog.hxx
@@ -11,12 +11,11 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_SAMPLINGDIALOG_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_SAMPLINGDIALOG_HXX
 
-#include <global.hxx>
 #include <address.hxx>
 #include "anyrefdg.hxx"
+#include "viewdata.hxx"
 
 #include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
 
 class ScSamplingDialog : public ScAnyRefDlg
 {
diff --git a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx 
b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx
index 683d24112c77..849197e34eb5 100644
--- a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx
+++ b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx
@@ -11,12 +11,11 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_STATISTICSINPUTOUTPUTDIALOG_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_STATISTICSINPUTOUTPUTDIALOG_HXX
 
-#include <global.hxx>
 #include <address.hxx>
 #include "anyrefdg.hxx"
+#include "viewdata.hxx"
 
 #include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
 
 class ScStatisticsInputOutputDialog : public ScAnyRefDlg
 {
diff --git a/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx 
b/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx
index ea6fadbe7a97..967114d9e048 100644
--- a/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx
+++ b/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx
@@ -11,12 +11,11 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_STATISTICSTWOVARIABLEDIALOG_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_STATISTICSTWOVARIABLEDIALOG_HXX
 
-#include <global.hxx>
 #include <address.hxx>
 #include "anyrefdg.hxx"
+#include "viewdata.hxx"
 
 #include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
 
 class ScStatisticsTwoVariableDialog : public ScAnyRefDlg
 {
diff --git a/sc/source/ui/inc/TableFillingAndNavigationTools.hxx 
b/sc/source/ui/inc/TableFillingAndNavigationTools.hxx
index a5d1176a8bae..65bd90a3db24 100644
--- a/sc/source/ui/inc/TableFillingAndNavigationTools.hxx
+++ b/sc/source/ui/inc/TableFillingAndNavigationTools.hxx
@@ -14,11 +14,6 @@
 #include <address.hxx>
 #include <rangelst.hxx>
 
-#include "docsh.hxx"
-#include <document.hxx>
-#include "docfunc.hxx"
-#include <formulacell.hxx>
-
 #include <vector>
 
 class FormulaTemplate
diff --git a/sc/source/ui/inc/acredlin.hxx b/sc/source/ui/inc/acredlin.hxx
index a1d52b400387..955a11be5983 100644
--- a/sc/source/ui/inc/acredlin.hxx
+++ b/sc/source/ui/inc/acredlin.hxx
@@ -20,21 +20,16 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_ACREDLIN_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_ACREDLIN_HXX
 
-#include <vcl/combobox.hxx>
-#include <svtools/headbar.hxx>
-#include <svtools/simptabl.hxx>
-#include <svtools/svtabbx.hxx>
-#include <rangenam.hxx>
-#include "anyrefdg.hxx"
-#include <vcl/lstbox.hxx>
 #include <svx/ctredlin.hxx>
 #include <chgtrack.hxx>
 #include <chgviset.hxx>
-#include <vcl/timer.hxx>
 #include <vcl/idle.hxx>
 
 class ScViewData;
 class ScDocument;
+class SvSimpleTable;
+
+struct SfxChildWinInfo;
 
 class ScRedlinData : public RedlinData
 {
diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx
index d868083031cc..c63867ac1d86 100644
--- a/sc/source/ui/inc/anyrefdg.hxx
+++ b/sc/source/ui/inc/anyrefdg.hxx
@@ -20,13 +20,8 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_ANYREFDG_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_ANYREFDG_HXX
 
-#include <vcl/button.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/accel.hxx>
 #include <sfx2/basedlgs.hxx>
-#include <sfx2/tabdlg.hxx>
 #include <address.hxx>
-#include <compiler.hxx>
 #include <formula/funcutl.hxx>
 #include "IAnyRefDialog.hxx"
 #include <scmod.hxx>
@@ -34,11 +29,9 @@
 #include <memory>
 
 class SfxObjectShell;
-class ScRange;
 class ScDocument;
-class ScTabViewShell;
-class ScRefHandler;
 class ScRangeList;
+class ScCompiler;
 
 class ScFormulaReferenceHelper
 {
diff --git a/sc/source/ui/inc/areasdlg.hxx b/sc/source/ui/inc/areasdlg.hxx
index 5439b99bde51..098eed033468 100644
--- a/sc/source/ui/inc/areasdlg.hxx
+++ b/sc/source/ui/inc/areasdlg.hxx
@@ -21,13 +21,12 @@
 
 #include <address.hxx>
 
-#include <svl/stritem.hxx>
 #include <vcl/lstbox.hxx>
-#include <vcl/fixed.hxx>
 #include "anyrefdg.hxx"
 
 class ScDocument;
 class ScViewData;
+class SfxStringItem;
 
 class ScPrintAreasDlg : public ScAnyRefDlg
 {
diff --git a/sc/source/ui/inc/attrdlg.hxx b/sc/source/ui/inc/attrdlg.hxx
index b644c3937800..c8ad33d974d4 100644
--- a/sc/source/ui/inc/attrdlg.hxx
+++ b/sc/source/ui/inc/attrdlg.hxx
@@ -23,7 +23,6 @@
 #include <sfx2/tabdlg.hxx>
 
 namespace weld { class Window; }
-class SfxViewFrame;
 class SfxItemSet;
 
 class ScAttrDlg : public SfxTabDialogController
diff --git a/sc/source/ui/inc/auditsh.hxx b/sc/source/ui/inc/auditsh.hxx
index 20bd32e29437..96fda896fd1f 100644
--- a/sc/source/ui/inc/auditsh.hxx
+++ b/sc/source/ui/inc/auditsh.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_SC_SOURCE_UI_INC_AUDITSH_HXX
 
 #include <sfx2/shell.hxx>
-#include <sfx2/module.hxx>
 
 #include <shellids.hxx>
 
diff --git a/sc/source/ui/inc/autofmt.hxx b/sc/source/ui/inc/autofmt.hxx
index 25e70f9e69b0..ecd89380def8 100644
--- a/sc/source/ui/inc/autofmt.hxx
+++ b/sc/source/ui/inc/autofmt.hxx
@@ -20,21 +20,15 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_AUTOFMT_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_AUTOFMT_HXX
 
-#include <vcl/virdev.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/button.hxx>
-#include <svtools/scriptedtext.hxx>
 #include <svx/framelinkarray.hxx>
 #include <scdllapi.h>
-#include "viewdata.hxx"
 
 class ScAutoFormatData;
 class SvxBoxItem;
 class SvxLineItem;
-class ScAutoFmtPreview; // s.u.
 class SvNumberFormatter;
-class ScDocument;
+class VirtualDevice;
+class ScViewData;
 
 enum AutoFmtLine { TOP_LINE, BOTTOM_LINE, LEFT_LINE, RIGHT_LINE };
 
diff --git a/sc/source/ui/inc/cbutton.hxx b/sc/source/ui/inc/cbutton.hxx
index a519655283c8..9deae846fdba 100644
--- a/sc/source/ui/inc/cbutton.hxx
+++ b/sc/source/ui/inc/cbutton.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_SC_SOURCE_UI_INC_CBUTTON_HXX
 
 #include <tools/gen.hxx>
-#include <tools/color.hxx>
 #include <vcl/vclptr.hxx>
 
 class OutputDevice;
diff --git a/sc/source/ui/inc/cellmergeoption.hxx 
b/sc/source/ui/inc/cellmergeoption.hxx
index 4d88d6194186..f66957ac23ac 100644
--- a/sc/source/ui/inc/cellmergeoption.hxx
+++ b/sc/source/ui/inc/cellmergeoption.hxx
@@ -14,8 +14,6 @@
 
 #include <set>
 
-class ScRange;
-
 struct ScCellMergeOption
 {
     ::std::set<SCTAB> maTabs;
diff --git a/sc/source/ui/inc/cellsh.hxx b/sc/source/ui/inc/cellsh.hxx
index 04ab41c9aa2f..a4a8eee681d3 100644
--- a/sc/source/ui/inc/cellsh.hxx
+++ b/sc/source/ui/inc/cellsh.hxx
@@ -22,14 +22,10 @@
 
 #include <sfx2/shell.hxx>
 #include <shellids.hxx>
-#include <sfx2/module.hxx>
-#include <svx/svdmark.hxx>
 #include <unotools/caserotate.hxx>
 #include <tools/link.hxx>
 #include <memory>
 #include "formatsh.hxx"
-#include <address.hxx>
-#include <vcl/window.hxx>
 #include <rtl/ref.hxx>
 #include <sot/formats.hxx>
 
diff --git a/sc/source/ui/inc/chartsh.hxx b/sc/source/ui/inc/chartsh.hxx
index 05dda65fefd4..caa5a89f14f3 100644
--- a/sc/source/ui/inc/chartsh.hxx
+++ b/sc/source/ui/inc/chartsh.hxx
@@ -22,7 +22,6 @@
 
 #include <sfx2/shell.hxx>
 #include <shellids.hxx>
-#include <sfx2/module.hxx>
 
 class ScViewData;
 
diff --git a/sc/source/ui/inc/checklistmenu.hxx 
b/sc/source/ui/inc/checklistmenu.hxx
index c3638b147384..681bdf7f2c06 100644
--- a/sc/source/ui/inc/checklistmenu.hxx
+++ b/sc/source/ui/inc/checklistmenu.hxx
@@ -13,10 +13,8 @@
 #include <vcl/popupmenuwindow.hxx>
 #include <vcl/button.hxx>
 #include <vcl/edit.hxx>
-#include <vcl/scrbar.hxx>
 #include <vcl/timer.hxx>
 #include <svtools/svlbitm.hxx>
-#include <svx/checklbx.hxx>
 
 #include <memory>
 #include <unordered_set>
diff --git a/sc/source/ui/inc/client.hxx b/sc/source/ui/inc/client.hxx
index e36322f1a481..38c02103e329 100644
--- a/sc/source/ui/inc/client.hxx
+++ b/sc/source/ui/inc/client.hxx
@@ -24,7 +24,6 @@
 
 class ScTabViewShell;
 class SdrOle2Obj;
-class SdrGrafObj;
 class SdrModel;
 
 class ScClient : public SfxInPlaceClient
diff --git a/sc/source/ui/inc/cliputil.hxx b/sc/source/ui/inc/cliputil.hxx
index 871da744e007..b938dfe444ff 100644
--- a/sc/source/ui/inc/cliputil.hxx
+++ b/sc/source/ui/inc/cliputil.hxx
@@ -10,7 +10,7 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_CLIPUTIL_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_CLIPUTIL_HXX
 
-#include <address.hxx>
+#include <types.hxx>
 
 class ScViewData;
 class ScTabViewShell;
diff --git a/sc/source/ui/inc/colorformat.hxx b/sc/source/ui/inc/colorformat.hxx
index 00cc4e798f9e..af2adf1d5107 100644
--- a/sc/source/ui/inc/colorformat.hxx
+++ b/sc/source/ui/inc/colorformat.hxx
@@ -12,14 +12,13 @@
 
 #include <vcl/button.hxx>
 #include <vcl/dialog.hxx>
-#include <vcl/fixed.hxx>
-#include <svtools/ctrlbox.hxx>
-#include <svl/zforlist.hxx>
-#include "anyrefdg.hxx"
+#include <address.hxx>
 
 struct ScDataBarFormatData;
 class ScDocument;
 class SvxColorListBox;
+class SvNumberFormatter;
+class Edit;
 
 class ScDataBarSettingsDlg : public ModalDialog
 {
diff --git a/sc/source/ui/inc/condformatdlg.hxx 
b/sc/source/ui/inc/condformatdlg.hxx
index 374b4611cf2c..684fd75a68c3 100644
--- a/sc/source/ui/inc/condformatdlg.hxx
+++ b/sc/source/ui/inc/condformatdlg.hxx
@@ -11,17 +11,10 @@
 #define INCLUDED_SC_SOURCE_UI_INC_CONDFORMATDLG_HXX
 
 #include <vcl/button.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/lstbox.hxx>
 #include <vcl/scrbar.hxx>
 #include <vcl/fixed.hxx>
-#include <vcl/edit.hxx>
-#include <svx/fntctrl.hxx>
-#include <svtools/ctrlbox.hxx>
 
 #include <rangelst.hxx>
-#include "condformathelper.hxx"
-#include "viewdata.hxx"
 #include "condformatdlgitem.hxx"
 
 #include "anyrefdg.hxx"
@@ -33,10 +26,8 @@
 
 class ScDocument;
 class ScConditionalFormat;
-class ScFormatEntry;
-class ScConditionalFormat;
-struct ScDataBarFormatData;
 class ScCondFrmtEntry;
+class ScViewData;
 
 class ScCondFormatDlg;
 
diff --git a/sc/source/ui/inc/condformatdlgentry.hxx 
b/sc/source/ui/inc/condformatdlgentry.hxx
index 53cf931c8a71..0f9773039c9b 100644
--- a/sc/source/ui/inc/condformatdlgentry.hxx
+++ b/sc/source/ui/inc/condformatdlgentry.hxx
@@ -10,16 +10,21 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_CONDFORMATDLGENTRY_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_CONDFORMATDLGENTRY_HXX
 
-#include <memory>
-#include <colorscale.hxx>
 #include <conditio.hxx>
 #include <formula/funcutl.hxx>
-
+#include <vcl/vclptr.hxx>
+#include <vcl/builder.hxx>
+#include <vcl/layout.hxx>
 #include <svl/lstner.hxx>
+#include <svx/fntctrl.hxx>
 
 class ScIconSetFrmtDataEntry;
 class ScCondFormatDlg;
 class SvxColorListBox;
+class ScColorScaleFormat;
+class ScDataBarFormat;
+class ScIconSetFormat;
+struct ScDataBarFormatData;
 
 namespace condformat {
 
diff --git a/sc/source/ui/inc/condformathelper.hxx 
b/sc/source/ui/inc/condformathelper.hxx
index 73848a281239..79de9c7d6d7b 100644
--- a/sc/source/ui/inc/condformathelper.hxx
+++ b/sc/source/ui/inc/condformathelper.hxx
@@ -11,9 +11,9 @@
 #define INCLUDED_SC_SOURCE_UI_INC_CONDFORMATHELPER_HXX
 
 #include <rtl/ustring.hxx>
-#include <conditio.hxx>
+#include <address.hxx>
 
-#include <global.hxx>
+class ScConditionalFormat;
 
 enum ScCondFormatEntryType
 {
diff --git a/sc/source/ui/inc/condformatmgr.hxx 
b/sc/source/ui/inc/condformatmgr.hxx
index 58b8b605228c..1d3cbf101e75 100644
--- a/sc/source/ui/inc/condformatmgr.hxx
+++ b/sc/source/ui/inc/condformatmgr.hxx
@@ -10,20 +10,15 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_CONDFORMATMGR_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_CONDFORMATMGR_HXX
 
-#include <scres.hrc>
-
 #include <vcl/dialog.hxx>
-#include <vcl/layout.hxx>
-#include <svtools/svtabbx.hxx>
 #include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
 #include <svtools/simptabl.hxx>
 
-#include <conditio.hxx>
-
 #include <map>
 
 class ScDocument;
+class ScConditionalFormat;
+class ScConditionalFormatList;
 
 class ScCondFormatManagerWindow : public SvSimpleTable
 {
diff --git a/sc/source/ui/inc/condformatuno.hxx 
b/sc/source/ui/inc/condformatuno.hxx
index 65ce1e4a70f7..bf0319b5f530 100644
--- a/sc/source/ui/inc/condformatuno.hxx
+++ b/sc/source/ui/inc/condformatuno.hxx
@@ -10,7 +10,7 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_CONDFORMATUNO_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_CONDFORMATUNO_HXX
 
-#include <address.hxx>
+#include <types.hxx>
 
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/sheet/XConditionalFormats.hpp>
@@ -25,7 +25,6 @@
 #include <svl/lstner.hxx>
 #include <rtl/ref.hxx>
 
-class ScDocument;
 class ScDocShell;
 class ScConditionalFormatList;
 class ScConditionalFormat;
diff --git a/sc/source/ui/inc/conflictsdlg.hxx 
b/sc/source/ui/inc/conflictsdlg.hxx
index 67d7aab30183..5e1b742e7a4c 100644
--- a/sc/source/ui/inc/conflictsdlg.hxx
+++ b/sc/source/ui/inc/conflictsdlg.hxx
@@ -22,15 +22,14 @@
 
 #include <vcl/button.hxx>
 #include <vcl/dialog.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
 #include <vcl/idle.hxx>
 #include <svx/ctredlin.hxx>
 
-#include <chgtrack.hxx>
 #include "docsh.hxx"
 
 class ScViewData;
+class ScChangeTrack;
+class ScChangeAction;
 
 enum ScConflictAction
 {
diff --git a/sc/source/ui/inc/consdlg.hxx b/sc/source/ui/inc/consdlg.hxx
index d4cab7300678..f3e6401ed2e5 100644
--- a/sc/source/ui/inc/consdlg.hxx
+++ b/sc/source/ui/inc/consdlg.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_CONSDLG_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_CONSDLG_HXX
 
-#include <vcl/fixed.hxx>
 #include <vcl/lstbox.hxx>
 #include <vcl/layout.hxx>
 #include <global.hxx>
diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx
index 7aad4b005442..f02204ca34ed 100644
--- a/sc/source/ui/inc/content.hxx
+++ b/sc/source/ui/inc/content.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_SC_SOURCE_UI_INC_CONTENT_HXX
 
 #include <svtools/treelistbox.hxx>
-#include <global.hxx>
 #include <address.hxx>
 #include <tools/solar.h>
 #include <o3tl/enumarray.hxx>
@@ -30,7 +29,6 @@ class ScNavigatorDlg;
 class ScDocument;
 class ScDocShell;
 class ScAreaLink;
-class SdrPage;
 
 enum class ScContentId {
     ROOT, TABLE, RANGENAME, DBAREA,
diff --git a/sc/source/ui/inc/crdlg.hxx b/sc/source/ui/inc/crdlg.hxx
index daea06afd699..6ddb6bb03466 100644
--- a/sc/source/ui/inc/crdlg.hxx
+++ b/sc/source/ui/inc/crdlg.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_SC_SOURCE_UI_INC_CRDLG_HXX
 
 #include <vcl/weld.hxx>
-#include "scui_def.hxx"
 
 class ScColOrRowDlg : public weld::GenericDialogController
 {
diff --git a/sc/source/ui/inc/crnrdlg.hxx b/sc/source/ui/inc/crnrdlg.hxx
index 23b332b2ab58..95222a9b5379 100644
--- a/sc/source/ui/inc/crnrdlg.hxx
+++ b/sc/source/ui/inc/crnrdlg.hxx
@@ -22,7 +22,6 @@
 
 #include "anyrefdg.hxx"
 #include <rangelst.hxx>
-#include <vcl/fixed.hxx>
 #include <vcl/lstbox.hxx>
 
 #include <unordered_map>
diff --git a/sc/source/ui/inc/csvcontrol.hxx b/sc/source/ui/inc/csvcontrol.hxx
index 7ef77ef1b9dc..4086a4626f52 100644
--- a/sc/source/ui/inc/csvcontrol.hxx
+++ b/sc/source/ui/inc/csvcontrol.hxx
@@ -22,17 +22,17 @@
 
 #include <vcl/ctrl.hxx>
 #include <scdllapi.h>
-#include <global.hxx>
 #include <address.hxx>
 #include "csvsplits.hxx"
 #include <com/sun/star/uno/Reference.hxx>
-#include <o3tl/typed_flags_set.hxx>
 
 class ScAccessibleCsvControl;
 namespace com { namespace sun { namespace star { namespace accessibility {
     class XAccessible;
 } } } }
 
+namespace o3tl { template <typename T> struct typed_flags; }
+
 /** Minimum character count for a column in separators mode. */
 const sal_Int32 CSV_MINCOLWIDTH         = 8;
 /** Maximum length of a cell string. */
diff --git a/sc/source/ui/inc/csvgrid.hxx b/sc/source/ui/inc/csvgrid.hxx
index 2fc364f650a2..c233997b5f35 100644
--- a/sc/source/ui/inc/csvgrid.hxx
+++ b/sc/source/ui/inc/csvgrid.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_CSVGRID_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_CSVGRID_HXX
 
-#include <vcl/virdev.hxx>
 #include <vcl/menu.hxx>
 #include <unotools/options.hxx>
 
@@ -35,6 +34,7 @@ class EditEngine;
 class ScEditEngineDefaulter;
 class ScAsciiOptions;
 class ScAccessibleCsvControl;
+class VirtualDevice;
 
 const sal_uInt32 CSV_COLUMN_INVALID = CSV_VEC_NOTFOUND;
 
diff --git a/sc/source/ui/inc/csvruler.hxx b/sc/source/ui/inc/csvruler.hxx
index a3de15686b77..5238d86f754a 100644
--- a/sc/source/ui/inc/csvruler.hxx
+++ b/sc/source/ui/inc/csvruler.hxx
@@ -20,12 +20,12 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_CSVRULER_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_CSVRULER_HXX
 
-#include <vcl/virdev.hxx>
 #include "csvcontrol.hxx"
 #include "csvsplits.hxx"
 #include <scdllapi.h>
 
 class ScAccessibleCsvControl;
+class VirtualDevice;
 
 /** A ruler control for the CSV import dialog. Supports setting and moving
     splits (which divide lines of data into several columns). */
diff --git a/sc/source/ui/inc/csvtablebox.hxx b/sc/source/ui/inc/csvtablebox.hxx
index b508243f26b7..0f9d8ace54e3 100644
--- a/sc/source/ui/inc/csvtablebox.hxx
+++ b/sc/source/ui/inc/csvtablebox.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_CSVTABLEBOX_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_CSVTABLEBOX_HXX
 
-#include <vcl/ctrl.hxx>
 #include <vcl/scrbar.hxx>
 #include <vcl/vclptr.hxx>
 #include <scdllapi.h>
diff --git a/sc/source/ui/inc/datafdlg.hxx b/sc/source/ui/inc/datafdlg.hxx
index 5a944e1d7420..6d4c137e650d 100644
--- a/sc/source/ui/inc/datafdlg.hxx
+++ b/sc/source/ui/inc/datafdlg.hxx
@@ -13,12 +13,11 @@
 #include <vcl/dialog.hxx>
 #include <vcl/button.hxx>
 #include <vcl/fixed.hxx>
+#include <vcl/layout.hxx>
+#include <types.hxx>
 
-#include <global.hxx>
-
-#include "tabvwsh.hxx"
-#include <sfx2/bindings.hxx>
-#include <sfx2/dispatch.hxx>
+class ScTabViewShell;
+class ScDocument;
 
 #define MAX_DATAFORM_COLS   256
 #define MAX_DATAFORM_ROWS   32000
diff --git a/sc/source/ui/inc/dataprovider.hxx 
b/sc/source/ui/inc/dataprovider.hxx
index a3311e7fde80..e0e22490f58e 100644
--- a/sc/source/ui/inc/dataprovider.hxx
+++ b/sc/source/ui/inc/dataprovider.hxx
@@ -12,37 +12,25 @@
 
 #include <memory>
 #include <salhelper/thread.hxx>
-#include <tools/stream.hxx>
 #include <rtl/ustring.hxx>
 #include <rtl/ref.hxx>
-#include <address.hxx>
 #include <osl/mutex.hxx>
-#include <osl/conditn.hxx>
-#include <dbdata.hxx>
 #include <document.hxx>
-#include <vcl/idle.hxx>
 
-#include "docsh.hxx"
-#include <scdllapi.h>
-#include <datamapper.hxx>
 #include <rtl/strbuf.hxx>
 
-#include <queue>
 #include <vector>
 #include <map>
 
-#include <officecfg/Office/Calc.hxx>
-
 #include <orcus/csv_parser.hpp>
 
 class SvStream;
+class ScDBData;
 
 namespace sc {
 
-class DataProvider;
-class CSVDataProvider;
-class ScDBDataManager;
 class DataTransformation;
+class ExternalDataSource;
 
 class CSVFetchThread : public salhelper::Thread
 {
diff --git a/sc/source/ui/inc/dataproviderdlg.hxx 
b/sc/source/ui/inc/dataproviderdlg.hxx
index d83fb4529a9e..44b58376bc1e 100644
--- a/sc/source/ui/inc/dataproviderdlg.hxx
+++ b/sc/source/ui/inc/dataproviderdlg.hxx
@@ -12,12 +12,9 @@
 
 #include <sal/config.h>
 
-#include <rtl/ref.hxx>
 #include <vcl/dialog.hxx>
-#include <vcl/layout.hxx>
 #include <vcl/lstbox.hxx>
 #include <vcl/listctrl.hxx>
-#include <vcl/button.hxx>
 
 #include "datatableview.hxx"
 
diff --git a/sc/source/ui/inc/datastream.hxx b/sc/source/ui/inc/datastream.hxx
index d71ddce79855..653eb9edc018 100644
--- a/sc/source/ui/inc/datastream.hxx
+++ b/sc/source/ui/inc/datastream.hxx
@@ -22,13 +22,10 @@
 #include <documentstreamaccess.hxx>
 
 class ScDocShell;
-class ScDocument;
-namespace vcl { class Window; }
 
 namespace sc {
 
 namespace datastreams {
-    class CallerThread;
     class ReaderThread;
 }
 
diff --git a/sc/source/ui/inc/datastreamdlg.hxx 
b/sc/source/ui/inc/datastreamdlg.hxx
index e377b30eda94..728ab5fcbdc4 100644
--- a/sc/source/ui/inc/datastreamdlg.hxx
+++ b/sc/source/ui/inc/datastreamdlg.hxx
@@ -12,18 +12,16 @@
 
 #include <sal/config.h>
 
-#include <rtl/ref.hxx>
 #include <vcl/weld.hxx>
 
-#include "datastream.hxx"
-
 class ScDocShell;
 class URLBox;
 class ScRange;
-class ComboBox;
 
 namespace sc {
 
+class DataStream;
+
 class DataStreamDlg : public weld::GenericDialogController
 {
     ScDocShell *m_pDocShell;
diff --git a/sc/source/ui/inc/datatransformation.hxx 
b/sc/source/ui/inc/datatransformation.hxx
index 8077dce93e9d..40e7002cc40e 100644
--- a/sc/source/ui/inc/datatransformation.hxx
+++ b/sc/source/ui/inc/datatransformation.hxx
@@ -10,7 +10,7 @@
 #ifndef INCLUDED_SC_SOURCE_UI_DATAPROVIDER_DATATRANSFORMATION_HXX
 #define INCLUDED_SC_SOURCE_UI_DATAPROVIDER_DATATRANSFORMATION_HXX
 
-#include <address.hxx>
+#include <types.hxx>
 #include <scdllapi.h>
 
 #include <sortparam.hxx>
diff --git a/sc/source/ui/inc/dbdocfun.hxx b/sc/source/ui/inc/dbdocfun.hxx
index 0222fe5bd629..8ba37a18f077 100644
--- a/sc/source/ui/inc/dbdocfun.hxx
+++ b/sc/source/ui/inc/dbdocfun.hxx
@@ -21,8 +21,7 @@
 #define INCLUDED_SC_SOURCE_UI_INC_DBDOCFUN_HXX
 
 #include <address.hxx>
-#include <tools/solar.h>
-#include <com/sun/star/uno/Sequence.hxx>
+#include <vector>
 
 struct ScImportParam;
 struct ScQueryParam;
@@ -32,11 +31,11 @@ struct ScSubTotalParam;
 class SfxViewFrame;
 class ScDBData;
 class ScDocShell;
-class ScAddress;
-class ScRange;
 class ScDPObject;
 class ScDBCollection;
 
+namespace com { namespace sun { namespace star { namespace uno { template 
<typename > class Sequence; } } } }
+
 namespace com { namespace sun { namespace star {
     namespace beans {
         struct PropertyValue;
diff --git a/sc/source/ui/inc/dbfunc.hxx b/sc/source/ui/inc/dbfunc.hxx
index 709e1a3fd058..0dd142b4e92f 100644
--- a/sc/source/ui/inc/dbfunc.hxx
+++ b/sc/source/ui/inc/dbfunc.hxx
@@ -30,7 +30,6 @@ namespace com { namespace sun { namespace star { namespace 
sheet {
 struct ScSortParam;
 struct ScQueryParam;
 class ScDBData;
-class ScDBCollection;
 class ScDPObject;
 class ScDPSaveData;
 struct ScDPNumGroupInfo;
diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx
index d8b1d15c1570..00d572f47ce5 100644
--- a/sc/source/ui/inc/docfunc.hxx
+++ b/sc/source/ui/inc/docfunc.hxx
@@ -20,12 +20,10 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_DOCFUNC_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_DOCFUNC_HXX
 
-#include <tools/link.hxx>
+#include <tools/solar.h>
 #include <global.hxx>
 #include <formula/grammar.hxx>
 #include <tabbgcolor.hxx>
-#include <token.hxx>
-#include <rangenam.hxx>
 
 #include <memory>
 #include <vector>
@@ -47,6 +45,8 @@ struct ScCellMergeOption;
 class ScConditionalFormat;
 class ScConditionalFormatList;
 class ScUndoRemoveMerge;
+class ScRangeName;
+
 enum class TransliterationFlags;
 enum class CreateNameFlags;
 namespace sc {
diff --git a/sc/source/ui/inc/docfuncutil.hxx b/sc/source/ui/inc/docfuncutil.hxx
index 0293db3168dc..bfb4275b576d 100644
--- a/sc/source/ui/inc/docfuncutil.hxx
+++ b/sc/source/ui/inc/docfuncutil.hxx
@@ -12,7 +12,6 @@
 
 #include <memory>
 
-class ScDocument;
 class ScMarkData;
 class ScRange;
 enum class InsertDeleteFlags : sal_uInt16;
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index 032585f8d7c7..2870fc38927c 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -20,19 +20,13 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_DOCSH_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_DOCSH_HXX
 
-#include <ooo/vba/excel/XWorkbook.hpp>
-#include <o3tl/deleter.hxx>
 #include <sfx2/objsh.hxx>
 #include <sfx2/docfac.hxx>
 #include <sfx2/sfxmodelfactory.hxx>
 #include <sfx2/viewsh.hxx>
-#include <com/sun/star/datatransfer/XTransferable2.hpp>
 
 #include <scdllapi.h>
-#include <scdll.hxx>
 #include <document.hxx>
-#include <appoptio.hxx>
-#include <formulaopt.hxx>
 #include <shellids.hxx>
 #include <optutil.hxx>
 #include <docuno.hxx>
@@ -51,26 +45,27 @@ class ScViewData;
 class ScDocFunc;
 class ScDrawLayer;
 class ScTabViewShell;
-class ScSbxDocHelper;
 class ScAutoStyleList;
-class ScRange;
 class ScMarkData;
 class ScPaintLockData;
 class ScChangeAction;
-class VirtualDevice;
 class ScImportOptions;
 class ScDocShellModificator;
 class ScOptSolverSave;
-class ScRefreshTimer;
 class ScSheetSaveData;
 class ScFlatBoolRowSegments;
-class HelperModelObj;
 struct ScColWidthParam;
+class ScFormulaOptions;
 
 namespace com { namespace sun { namespace star { namespace script { namespace 
vba {
     class XVBAScriptListener;
 } } } } }
 
+namespace ooo { namespace vba { namespace excel { class XWorkbook; } } }
+
+namespace o3tl { template <typename T> struct default_delete; }
+namespace com { namespace sun { namespace star { namespace datatransfer { 
class XTransferable2; } } } }
+
 namespace sfx2 { class FileDialogHelper; }
 struct DocShell_Impl;
 
@@ -438,7 +433,6 @@ public:
 
 void UpdateAcceptChangesDialog();
 
-class ScDocShell;
 typedef tools::SvRef<ScDocShell> ScDocShellRef;
 
 /** Create before modifications of the document and destroy thereafter.
diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx
index ad4d65371923..27863fe60618 100644
--- a/sc/source/ui/inc/dpcontrol.hxx
+++ b/sc/source/ui/inc/dpcontrol.hxx
@@ -26,8 +26,6 @@
 #include <vcl/vclptr.hxx>
 
 class OutputDevice;
-class Point;
-class Size;
 class StyleSettings;
 class ScDocument;
 
diff --git a/sc/source/ui/inc/dpgroupdlg.hxx b/sc/source/ui/inc/dpgroupdlg.hxx
index 0a8ad0ffe795..01737a65000b 100644
--- a/sc/source/ui/inc/dpgroupdlg.hxx
+++ b/sc/source/ui/inc/dpgroupdlg.hxx
@@ -20,13 +20,12 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_DPGROUPDLG_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_DPGROUPDLG_HXX
 
-#include <vcl/fixed.hxx>
 #include <vcl/dialog.hxx>
 #include <vcl/button.hxx>
 #include <vcl/field.hxx>
 #include <svx/checklbx.hxx>
 #include "editfield.hxx"
-#include <dpgroup.hxx>
+#include <dpnumgroupinfo.hxx>
 
 class ScDPGroupEditHelper
 {
diff --git a/sc/source/ui/inc/drawsh.hxx b/sc/source/ui/inc/drawsh.hxx
index a5d515bceb62..8f195484e278 100644
--- a/sc/source/ui/inc/drawsh.hxx
+++ b/sc/source/ui/inc/drawsh.hxx
@@ -22,8 +22,6 @@
 
 #include <sfx2/shell.hxx>
 #include <shellids.hxx>
-#include <sfx2/module.hxx>
-#include <svx/svdmark.hxx>
 #include <svx/svdtypes.hxx>
 #include <tools/link.hxx>
 #include <rtl/ref.hxx>
@@ -31,6 +29,10 @@
 class AbstractSvxObjectNameDialog;
 class ScViewData;
 class ScDrawView;
+class SdrMarkList;
+class SfxModule;
+class SdrObject;
+
 namespace svx { namespace sidebar {
 class SelectionChangeHandler;
 } }
diff --git a/sc/source/ui/inc/drawutil.hxx b/sc/source/ui/inc/drawutil.hxx
index 07b7945e36bc..0623347f8356 100644
--- a/sc/source/ui/inc/drawutil.hxx
+++ b/sc/source/ui/inc/drawutil.hxx
@@ -20,7 +20,7 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_DRAWUTIL_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_DRAWUTIL_HXX
 
-#include <address.hxx>
+#include <types.hxx>
 
 class Fraction;
 class OutputDevice;
diff --git a/sc/source/ui/inc/drformsh.hxx b/sc/source/ui/inc/drformsh.hxx
index 5b6318f82e23..c6aad34d8e23 100644
--- a/sc/source/ui/inc/drformsh.hxx
+++ b/sc/source/ui/inc/drformsh.hxx
@@ -22,10 +22,9 @@
 
 #include <sfx2/shell.hxx>
 #include <shellids.hxx>
-#include <sfx2/module.hxx>
-#include <svx/svdmark.hxx>
 
 class ScViewData;
+class SfxModule;
 
 #include "drawsh.hxx"
 
diff --git a/sc/source/ui/inc/drtxtob.hxx b/sc/source/ui/inc/drtxtob.hxx
index 4386bcf957fa..8ba3dacc60c2 100644
--- a/sc/source/ui/inc/drtxtob.hxx
+++ b/sc/source/ui/inc/drtxtob.hxx
@@ -21,13 +21,14 @@
 #define INCLUDED_SC_SOURCE_UI_INC_DRTXTOB_HXX
 
 #include <sfx2/shell.hxx>
-#include <sfx2/module.hxx>
 #include <tools/link.hxx>
+#include <rtl/ref.hxx>
 
 #include <shellids.hxx>
 
 sal_uInt16 ScGetFontWorkId();       // instead of 
SvxFontWorkChildWindow::GetChildWindowId()
 
+class SfxModule;
 class ScViewData;
 class TransferableDataHelper;
 class TransferableClipboardListener;
diff --git a/sc/source/ui/inc/drwtrans.hxx b/sc/source/ui/inc/drwtrans.hxx
index b2604df48d3c..12c873fb0561 100644
--- a/sc/source/ui/inc/drwtrans.hxx
+++ b/sc/source/ui/inc/drwtrans.hxx
@@ -21,13 +21,10 @@
 #define INCLUDED_SC_SOURCE_UI_INC_DRWTRANS_HXX
 
 #include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/embed/XEmbeddedObject.hpp>
 #include <svtools/transfer.hxx>
 
 #include <sfx2/objsh.hxx>
-#include <global.hxx>
 #include <charthelper.hxx>
-#include <rangelst.hxx>
 
 class SdrModel;
 class ScDocShell;
diff --git a/sc/source/ui/inc/dwfunctr.hxx b/sc/source/ui/inc/dwfunctr.hxx
index 5d55f7ad2261..2be013f2b9a7 100644
--- a/sc/source/ui/inc/dwfunctr.hxx
+++ b/sc/source/ui/inc/dwfunctr.hxx
@@ -19,17 +19,12 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_DWFUNCTR_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_DWFUNCTR_HXX
 
-#include <sfx2/childwin.hxx>
-#include <sfx2/dockwin.hxx>
-#include <svl/lstner.hxx>
-
 #include <vcl/lstbox.hxx>
 #include <vcl/button.hxx>
-#include <vcl/combobox.hxx>
 #include <svx/sidebar/PanelLayout.hxx>
-#include "anyrefdg.hxx"
-#include <global.hxx>
-#include <funcdesc.hxx>
+
+class ScFuncDesc;
+namespace formula { class IFunctionDescription; }
 
 class ScFunctionWin : public PanelLayout
 {
diff --git a/sc/source/ui/inc/editable.hxx b/sc/source/ui/inc/editable.hxx
index d7eac06d449d..05eaa985d04c 100644
--- a/sc/source/ui/inc/editable.hxx
+++ b/sc/source/ui/inc/editable.hxx
@@ -25,7 +25,6 @@
 class ScDocument;
 class ScViewFunc;
 class ScMarkData;
-class ScRange;
 
 namespace sc {
 
diff --git a/sc/source/ui/inc/editfield.hxx b/sc/source/ui/inc/editfield.hxx
index 2020db572aae..fa27d4710b16 100644
--- a/sc/source/ui/inc/editfield.hxx
+++ b/sc/source/ui/inc/editfield.hxx
@@ -20,7 +20,7 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_EDITFIELD_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_EDITFIELD_HXX
 
-#include <vcl/field.hxx>
+#include <vcl/edit.hxx>
 
 /** An edit control that contains a double precision floating-point value. */
 class ScDoubleField : public Edit
diff --git a/sc/source/ui/inc/editsh.hxx b/sc/source/ui/inc/editsh.hxx
index 18ee2dc40331..7eb432b1f3fc 100644
--- a/sc/source/ui/inc/editsh.hxx
+++ b/sc/source/ui/inc/editsh.hxx
@@ -21,12 +21,12 @@
 #define INCLUDED_SC_SOURCE_UI_INC_EDITSH_HXX
 
 #include <sfx2/shell.hxx>
-#include <sfx2/module.hxx>
 #include <tools/link.hxx>
+#include <rtl/ref.hxx>
 
 #include <shellids.hxx>
-#include <editeng/editview.hxx>
 
+class SfxModule;
 class EditView;
 class ScViewData;
 class ScInputHandler;
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx 
b/sc/source/ui/miscdlgs/acredlin.cxx
index 50f8f1017309..b1294a0ddff6 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -23,6 +23,7 @@
 #include <unotools/collatorwrapper.hxx>
 #include <sfx2/app.hxx>
 #include <sfx2/viewfrm.hxx>
+#include <sfx2/basedlgs.hxx>
 
 #include <acredlin.hxx>
 #include <global.hxx>
diff --git a/sc/source/ui/miscdlgs/autofmt.cxx 
b/sc/source/ui/miscdlgs/autofmt.cxx
index 65b67242a5bb..c4650addbd8e 100644
--- a/sc/source/ui/miscdlgs/autofmt.cxx
+++ b/sc/source/ui/miscdlgs/autofmt.cxx
@@ -31,6 +31,7 @@
 #include <editeng/wghtitem.hxx>
 #include <vcl/svapp.hxx>
 #include <svl/zforlist.hxx>
+#include <svtools/scriptedtext.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/builderfactory.hxx>
 #include <sfx2/viewfrm.hxx>
@@ -48,6 +49,7 @@
 #include <document.hxx>
 #include <docsh.hxx>
 #include <tabvwsh.hxx>
+#include <viewdata.hxx>
 
 #define FRAME_OFFSET 4
 
diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx 
b/sc/source/ui/miscdlgs/conflictsdlg.cxx
index 28ba0dfdf368..af8de51f271f 100644
--- a/sc/source/ui/miscdlgs/conflictsdlg.cxx
+++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx
@@ -24,6 +24,7 @@
 #include <scresid.hxx>
 #include <viewdata.hxx>
 #include <dbfunc.hxx>
+#include <chgtrack.hxx>
 
 // struct ScConflictsListEntry
 
diff --git a/sc/source/ui/miscdlgs/crdlg.cxx b/sc/source/ui/miscdlgs/crdlg.cxx
index 4764075697a4..e2690af78750 100644
--- a/sc/source/ui/miscdlgs/crdlg.cxx
+++ b/sc/source/ui/miscdlgs/crdlg.cxx
@@ -20,6 +20,7 @@
 #undef SC_DLLIMPLEMENTATION
 
 #include <crdlg.hxx>
+#include <scui_def.hxx>
 
 ScColOrRowDlg::ScColOrRowDlg(weld::Window* pParent, const OUString& rStrTitle, 
const OUString& rStrLabel)
     : GenericDialogController(pParent, "modules/scalc/ui/colorrowdialog.ui", 
"ColOrRowDialog")
diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx 
b/sc/source/ui/miscdlgs/datafdlg.cxx
index 4d73a2aef251..5dbe9b07d987 100644
--- a/sc/source/ui/miscdlgs/datafdlg.cxx
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -14,6 +14,7 @@
 #include <docsh.hxx>
 #include <refundo.hxx>
 #include <undodat.hxx>
+#include <tabvwsh.hxx>
 
 #include <rtl/ustrbuf.hxx>
 
diff --git a/sc/source/ui/miscdlgs/dataproviderdlg.cxx 
b/sc/source/ui/miscdlgs/dataproviderdlg.cxx
index 54a1e88a9249..75a7880e42ff 100644
--- a/sc/source/ui/miscdlgs/dataproviderdlg.cxx
+++ b/sc/source/ui/miscdlgs/dataproviderdlg.cxx
@@ -12,6 +12,9 @@
 #include <document.hxx>
 #include <dataprovider.hxx>
 #include <datatransformation.hxx>
+#include <datamapper.hxx>
+#include <dbdata.hxx>
+#include <docsh.hxx>
 
 #include <comphelper/string.hxx>
 #include <sal/log.hxx>
diff --git a/sc/source/ui/miscdlgs/datastreamdlg.cxx 
b/sc/source/ui/miscdlgs/datastreamdlg.cxx
index 985c389fb2b6..a270844da2bb 100644
--- a/sc/source/ui/miscdlgs/datastreamdlg.cxx
+++ b/sc/source/ui/miscdlgs/datastreamdlg.cxx
@@ -14,6 +14,7 @@
 #include <vcl/layout.hxx>
 #include <address.hxx>
 #include <docsh.hxx>
+#include <datastream.hxx>
 
 namespace sc {
 
diff --git a/sc/source/ui/namedlg/namedefdlg.cxx 
b/sc/source/ui/namedlg/namedefdlg.cxx
index ff226ef9a471..8e9ec64643ae 100644
--- a/sc/source/ui/namedlg/namedefdlg.cxx
+++ b/sc/source/ui/namedlg/namedefdlg.cxx
@@ -13,6 +13,7 @@
 #include <formula/errorcodes.hxx>
 #include <sfx2/app.hxx>
 
+#include <compiler.hxx>
 #include <document.hxx>
 #include <globstr.hrc>
 #include <scresid.hxx>
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index f25f9582f267..f7e9d0cd2c6d 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -20,6 +20,7 @@
 #include <memory>
 #include <global.hxx>
 #include <reffact.hxx>
+#include <compiler.hxx>
 #include <document.hxx>
 #include <docfunc.hxx>
 #include <globstr.hrc>
diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx
index 2705f8ff9784..95adccac53ad 100644
--- a/sc/source/ui/navipi/scenwnd.cxx
+++ b/sc/source/ui/navipi/scenwnd.cxx
@@ -30,6 +30,7 @@
 #include <globstr.hrc>
 #include <scresid.hxx>
 #include <helpids.h>
+#include <global.hxx>
 
 // class ScScenarioWindow ------------------------------------------------
 
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index 89a578dfed16..b1bcaaba9246 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -34,6 +34,7 @@
 #include <globstr.hrc>
 #include <scresid.hxx>
 #include <tpusrlst.hxx>
+#include <scui_def.hxx>
 
 #define CR  u'\x000D'
 #define LF  u'\x000A'
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index 676ed2814ffc..229730e1afc8 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -29,6 +29,7 @@
 #include <docsh.hxx>
 #include <miscuno.hxx>
 #include <forbiuno.hxx>
+#include <appoptio.hxx>
 #include <viewopti.hxx>
 #include <docpool.hxx>
 #include <sc.hrc>
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 7918adcb5cc0..10c2220c22f1 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -125,6 +125,8 @@
 #include <transobj.hxx>
 #include <chgtrack.hxx>
 #include <table.hxx>
+#include <appoptio.hxx>
+#include <formulaopt.hxx>
 
 #include <strings.hrc>
 
diff --git a/sc/source/ui/unoobj/unodoc.cxx b/sc/source/ui/unoobj/unodoc.cxx
index e632de65fa69..d2cc5fd0f935 100644
--- a/sc/source/ui/unoobj/unodoc.cxx
+++ b/sc/source/ui/unoobj/unodoc.cxx
@@ -24,6 +24,7 @@
 
 #include <appluno.hxx>
 #include <scmod.hxx>
+#include <scdll.hxx>
 #include <vcl/svapp.hxx>
 
 #include <docsh.hxx>
diff --git a/sc/source/ui/vba/vbaapplication.cxx 
b/sc/source/ui/vba/vbaapplication.cxx
index 4a67e290e7a1..fb1a4e2401f4 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -96,6 +96,7 @@
 #include <viewutil.hxx>
 #include <docoptio.hxx>
 #include <scmod.hxx>
+#include <scdll.hxx>
 
 using namespace ::ooo::vba;
 using namespace ::com::sun::star;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to