[Libreoffice-commits] core.git: include/sfx2 sc/IwyuFilter_sc.yaml sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Feb 27 10:19:02 UTC 2019


 include/sfx2/msg.hxx                             |    3 +
 sc/IwyuFilter_sc.yaml                            |   40 +++++++++++++++++++++++
 sc/source/ui/dataprovider/dataprovider.cxx       |    3 -
 sc/source/ui/dataprovider/datatransformation.cxx |    2 -
 sc/source/ui/dataprovider/htmldataprovider.cxx   |    2 -
 sc/source/ui/dataprovider/sqldataprovider.cxx    |    9 -----
 sc/source/ui/dataprovider/xmldataprovider.cxx    |    1 
 sc/source/ui/dbgui/PivotLayoutDialog.cxx         |    1 
 sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx   |    2 -
 sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx  |    1 
 sc/source/ui/dbgui/csvcontrol.cxx                |    1 
 sc/source/ui/dbgui/csvgrid.cxx                   |    1 
 sc/source/ui/dbgui/csvruler.cxx                  |    2 -
 sc/source/ui/dbgui/csvtablebox.cxx               |    1 
 sc/source/ui/dbgui/dapidata.cxx                  |    3 -
 sc/source/ui/dbgui/dapitype.cxx                  |    1 
 sc/source/ui/dbgui/dpgroupdlg.cxx                |    3 +
 sc/source/ui/dbgui/filtdlg.cxx                   |    2 -
 sc/source/ui/dbgui/foptmgr.cxx                   |    2 -
 sc/source/ui/dbgui/imoptdlg.cxx                  |    1 
 sc/source/ui/dbgui/pfiltdlg.cxx                  |    1 
 sc/source/ui/dbgui/pvfundlg.cxx                  |    3 -
 sc/source/ui/dbgui/scendlg.cxx                   |    5 --
 sc/source/ui/dbgui/scuiasciiopt.cxx              |    3 -
 sc/source/ui/dbgui/scuiimoptdlg.cxx              |    4 --
 sc/source/ui/dbgui/sfiltdlg.cxx                  |    1 
 sc/source/ui/dbgui/sortkeydlg.cxx                |    3 -
 sc/source/ui/dbgui/textimportoptions.cxx         |    1 
 sc/source/ui/dbgui/tpsort.cxx                    |    2 -
 sc/source/ui/dbgui/tpsubt.cxx                    |    1 
 sc/source/ui/dbgui/validate.cxx                  |    4 --
 sc/source/ui/dialogs/searchresults.cxx           |    2 -
 sc/source/ui/docshell/arealink.cxx               |    4 --
 sc/source/ui/docshell/autostyl.cxx               |    3 -
 sc/source/ui/docshell/datastream.cxx             |    7 +---
 sc/source/ui/docshell/dbdocfun.cxx               |    1 
 sc/source/ui/docshell/docfunc.cxx                |    6 ---
 sc/source/ui/docshell/docfuncutil.cxx            |    1 
 sc/source/ui/docshell/docsh.cxx                  |   21 +-----------
 sc/source/ui/docshell/docsh2.cxx                 |    8 +---
 sc/source/ui/docshell/docsh3.cxx                 |    2 -
 sc/source/ui/docshell/docsh4.cxx                 |   13 -------
 sc/source/ui/docshell/docsh5.cxx                 |    1 
 sc/source/ui/docshell/docsh6.cxx                 |    2 -
 sc/source/ui/docshell/docsh8.cxx                 |    5 --
 sc/source/ui/docshell/editable.cxx               |    1 
 sc/source/ui/docshell/externalrefmgr.cxx         |    4 --
 sc/source/ui/docshell/impex.cxx                  |    5 --
 sc/source/ui/docshell/olinefun.cxx               |    2 -
 sc/source/ui/docshell/servobj.cxx                |    1 
 sc/source/ui/docshell/tablink.cxx                |    2 -
 sc/source/ui/drawfunc/chartsh.cxx                |    7 ----
 sc/source/ui/drawfunc/drawsh.cxx                 |    7 ----
 sc/source/ui/drawfunc/drawsh2.cxx                |    4 --
 sc/source/ui/drawfunc/drawsh4.cxx                |    7 ----
 sc/source/ui/drawfunc/drawsh5.cxx                |    9 -----
 sc/source/ui/drawfunc/drformsh.cxx               |   17 ++-------
 sc/source/ui/drawfunc/drtxtob.cxx                |    9 -----
 sc/source/ui/drawfunc/drtxtob1.cxx               |    6 +--
 sc/source/ui/drawfunc/drtxtob2.cxx               |   11 ------
 sc/source/ui/drawfunc/fuconarc.cxx               |    1 
 sc/source/ui/drawfunc/fuconcustomshape.cxx       |    2 -
 sc/source/ui/drawfunc/fuconpol.cxx               |    1 
 sc/source/ui/drawfunc/fuconrec.cxx               |    2 -
 sc/source/ui/drawfunc/fuconstr.cxx               |    4 --
 sc/source/ui/drawfunc/fuconuno.cxx               |    1 
 sc/source/ui/drawfunc/fudraw.cxx                 |    5 --
 sc/source/ui/drawfunc/fuins1.cxx                 |    1 
 sc/source/ui/drawfunc/fuins2.cxx                 |   13 -------
 sc/source/ui/drawfunc/fusel.cxx                  |    7 ----
 sc/source/ui/drawfunc/fusel2.cxx                 |    5 --
 sc/source/ui/drawfunc/futext.cxx                 |    4 --
 sc/source/ui/drawfunc/futext3.cxx                |   10 -----
 sc/source/ui/drawfunc/graphsh.cxx                |    6 +--
 sc/source/ui/drawfunc/mediash.cxx                |    1 
 sc/source/ui/drawfunc/oleobjsh.cxx               |   13 -------
 sc/source/ui/inc/csvgrid.hxx                     |    4 +-
 sc/source/ui/inc/csvruler.hxx                    |    3 +
 sc/source/ui/inc/dpgroupdlg.hxx                  |    8 +---
 sc/source/ui/inc/drawsh.hxx                      |    2 +
 sc/source/ui/inc/notemark.hxx                    |    1 
 sc/source/ui/inc/protectiondlg.hxx               |    1 
 sc/source/ui/inc/scuiimoptdlg.hxx                |    3 +
 sc/source/ui/inc/searchresults.hxx               |    2 -
 sc/source/ui/inc/textimportoptions.hxx           |    3 +
 85 files changed, 81 insertions(+), 299 deletions(-)

New commits:
commit 1805c7ce2d4ef5227ce8f456956d047144c6aaf8
Author:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
AuthorDate: Tue Feb 26 00:29:20 2019 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Feb 27 11:18:34 2019 +0100

    tdf#42949 Fix IWYU warnings in sc/source/ui/d*/*cxx
    
    Also additions were needed in include/sfx2/msg.hxx
    to avoid build breakage
    
    Found with bin/find-unneeded-includes
    Only removal proposals are dealt with here.
    
    Change-Id: I259ff10aaa5d044d4b11f9041174765d5a5f7dc7
    Reviewed-on: https://gerrit.libreoffice.org/68364
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/include/sfx2/msg.hxx b/include/sfx2/msg.hxx
index 25b5121d3dcd..6634584558b6 100644
--- a/include/sfx2/msg.hxx
+++ b/include/sfx2/msg.hxx
@@ -22,11 +22,14 @@
 #include <sfx2/shell.hxx>
 #include <rtl/string.hxx>
 #include <rtl/ustring.hxx>
+#include <svl/poolitem.hxx>
 #include <sfx2/dllapi.h>
 #include <o3tl/typed_flags_set.hxx>
 #include <sfx2/groupid.hxx>
 #include <functional>
 
+#include <climits>
+
 class SfxItemPool;
 class SfxItemSet;
 class SfxPoolItem;
diff --git a/sc/IwyuFilter_sc.yaml b/sc/IwyuFilter_sc.yaml
index aae990f8515f..dc3b4ab96723 100644
--- a/sc/IwyuFilter_sc.yaml
+++ b/sc/IwyuFilter_sc.yaml
@@ -474,6 +474,14 @@ blacklist:
     - com/sun/star/sheet/XConditionEntry.hpp
     - com/sun/star/sheet/XDataBarEntry.hpp
     - com/sun/star/sheet/XIconSetEntry.hpp
+    sc/source/ui/inc/csvgrid.hxx:
+    # Needed for typedef
+    - editutil.hxx
+    # Needed for VclPtr type
+    - vcl/virdev.hxx
+    sc/source/ui/inc/csvruler.hxx:
+    # Needed for ScopedVclPtrInstance type
+    - vcl/virdev.hxx
     sc/source/ui/inc/dataprovider.hxx:
     # Don't replace with an implementation detail
     - orcus/csv_parser.hpp
@@ -492,12 +500,18 @@ blacklist:
     sc/source/ui/inc/MovingAverageDialog.hxx:
     # base class has to be a complete type
     - viewdata.hxx
+    sc/source/ui/inc/namepast.hxx:
+    # Needed for unique_ptr type
+    - namemgrtable.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/searchresults.hxx:
+    # Needed for VclPtr type
+    - svtools/simptabl.hxx
     sc/source/ui/inc/StatisticsInputOutputDialog.hxx:
     # base class has to be a complete type
     - viewdata.hxx
@@ -820,3 +834,29 @@ blacklist:
     - attrib.hxx
     - svx/sdprcitm.hxx
     - svx/sdmetitm.hxx
+    sc/source/ui/dataprovider/csvdataprovider.cxx:
+    # Needed for unique_ptr type
+    - tools/stream.hxx
+    sc/source/ui/dataprovider/htmldataprovider.cxx:
+    # Needed for unique_ptr type
+    - tools/stream.hxx
+    sc/source/ui/docshell/docfunc.cxx:
+    # Needed for direct member access
+    - svx/svdocapt.hxx
+    sc/source/ui/docshell/docsh.cxx:
+    # Needed for method parameter
+    - ooo/vba/excel/XWorkbook.hpp
+    sc/source/ui/docshell/docsh4.cxx:
+    # Needed on WIN32
+    - impex.hxx
+    - rangeseq.hxx
+    sc/source/ui/docshell/impex.cxx:
+    # OSL_BIGENDIAN is being checked
+    - osl/endian.h
+    # Needed for unique_ptr type
+    - tokenarray.hxx
+    - refundo.hxx
+    - editeng/editobj.hxx
+    sc/source/ui/drawfunc/futext3.cxx:
+    # Needed for direct member access
+    - svx/svdocapt.hxx
diff --git a/sc/source/ui/dataprovider/dataprovider.cxx b/sc/source/ui/dataprovider/dataprovider.cxx
index 4f20bd4e719b..3b59f17e5fbc 100644
--- a/sc/source/ui/dataprovider/dataprovider.cxx
+++ b/sc/source/ui/dataprovider/dataprovider.cxx
@@ -11,16 +11,15 @@
 #include <com/sun/star/ucb/XSimpleFileAccess3.hpp>
 #include <com/sun/star/ucb/SimpleFileAccess.hpp>
 #include <com/sun/star/io/XInputStream.hpp>
-#include <officecfg/Office/Calc.hxx>
 #include <rtl/strbuf.hxx>
 #include <sal/log.hxx>
 #include <unotools/charclass.hxx>
 #include <tools/stream.hxx>
+#include <comphelper/processfactory.hxx>
 
 #include "htmldataprovider.hxx"
 #include "xmldataprovider.hxx"
 #include "sqldataprovider.hxx"
-#include <datatransformation.hxx>
 #include <datamapper.hxx>
 #include <dbdata.hxx>
 #include <docsh.hxx>
diff --git a/sc/source/ui/dataprovider/datatransformation.cxx b/sc/source/ui/dataprovider/datatransformation.cxx
index 1c67d8d9ee45..2cb3f7495710 100644
--- a/sc/source/ui/dataprovider/datatransformation.cxx
+++ b/sc/source/ui/dataprovider/datatransformation.cxx
@@ -12,9 +12,7 @@
 #include <document.hxx>
 #include <rtl/math.hxx>
 #include <cmath>
-#include <tools/datetime.hxx>
 #include <svl/zforlist.hxx>
-#include <globalnames.hxx>
 #include <unotools/charclass.hxx>
 
 namespace {
diff --git a/sc/source/ui/dataprovider/htmldataprovider.cxx b/sc/source/ui/dataprovider/htmldataprovider.cxx
index c70ce00fa63e..d82fc76700f5 100644
--- a/sc/source/ui/dataprovider/htmldataprovider.cxx
+++ b/sc/source/ui/dataprovider/htmldataprovider.cxx
@@ -15,10 +15,8 @@
 #include <tools/stream.hxx>
 
 #include <libxml/HTMLparser.h>
-#include <libxml/HTMLtree.h>
 
 #include <libxml/xpath.h>
-#include <libxml/xpathInternals.h>
 
 #include <comphelper/string.hxx>
 #include <utility>
diff --git a/sc/source/ui/dataprovider/sqldataprovider.cxx b/sc/source/ui/dataprovider/sqldataprovider.cxx
index 54faff99be83..b8b9c9d28a40 100644
--- a/sc/source/ui/dataprovider/sqldataprovider.cxx
+++ b/sc/source/ui/dataprovider/sqldataprovider.cxx
@@ -10,21 +10,12 @@
 #include "sqldataprovider.hxx"
 #include <datatransformation.hxx>
 #include <salhelper/thread.hxx>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/sheet/DataImportMode.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
 #include <com/sun/star/sdb/DatabaseContext.hpp>
-#include <com/sun/star/sdb/XQueriesSupplier.hpp>
 #include <com/sun/star/sdb/XCompletedConnection.hpp>
 #include <com/sun/star/task/InteractionHandler.hpp>
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
 #include <com/sun/star/sdbc/XResultSetMetaData.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/util/Date.hpp>
-#include <comphelper/string.hxx>
 #include <miscuno.hxx>
 #include <dbdocutl.hxx>
 #include <datamapper.hxx>
diff --git a/sc/source/ui/dataprovider/xmldataprovider.cxx b/sc/source/ui/dataprovider/xmldataprovider.cxx
index ad72c3cf9ea2..42b5d5620374 100644
--- a/sc/source/ui/dataprovider/xmldataprovider.cxx
+++ b/sc/source/ui/dataprovider/xmldataprovider.cxx
@@ -10,7 +10,6 @@
 #include "xmldataprovider.hxx"
 #include <datatransformation.hxx>
 #include <salhelper/thread.hxx>
-#include <comphelper/string.hxx>
 #include <filter.hxx>
 #include <document.hxx>
 #include <datamapper.hxx>
diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index 50f65868f86c..9199d8039922 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -12,7 +12,6 @@
 #include <PivotLayoutTreeList.hxx>
 #include <PivotLayoutDialog.hxx>
 #include <reffact.hxx>
-#include <vcl/treelistentry.hxx>
 
 #include <rangeutl.hxx>
 #include <uiitems.hxx>
diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx
index c1fbecb99031..f9fdea939b90 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx
@@ -12,9 +12,7 @@
 #include <PivotLayoutTreeListBase.hxx>
 #include <PivotLayoutDialog.hxx>
 
-#include <reffact.hxx>
 #include <vcl/treelistentry.hxx>
-#include <scabstdlg.hxx>
 
 ScPivotLayoutTreeListBase::ScPivotLayoutTreeListBase(vcl::Window* pParent, WinBits nBits, SvPivotTreeListType eType)
     : SvTreeListBox(pParent, nBits)
diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx
index fddd967edcde..3e6d9d294607 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx
@@ -16,7 +16,6 @@
 #include <vcl/builderfactory.hxx>
 #include <vcl/treelistentry.hxx>
 #include <pivot.hxx>
-#include <scabstdlg.hxx>
 
 VCL_BUILDER_FACTORY_ARGS(ScPivotLayoutTreeListLabel,
                          WB_BORDER | WB_TABSTOP | WB_CLIPCHILDREN);
diff --git a/sc/source/ui/dbgui/csvcontrol.cxx b/sc/source/ui/dbgui/csvcontrol.cxx
index b239dc258250..f30a5d181082 100644
--- a/sc/source/ui/dbgui/csvcontrol.cxx
+++ b/sc/source/ui/dbgui/csvcontrol.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <csvcontrol.hxx>
-#include <vcl/svapp.hxx>
 #include <vcl/settings.hxx>
 #include <AccessibleCsvControl.hxx>
 
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index e16b7f8b8b96..8a3a9da66133 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -31,7 +31,6 @@
 #include <AccessibleCsvControl.hxx>
 
 // *** edit engine ***
-#include <scitems.hxx>
 #include <editeng/eeitem.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/virdev.hxx>
diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx
index 533c8744ee18..093b01d059bd 100644
--- a/sc/source/ui/dbgui/csvruler.cxx
+++ b/sc/source/ui/dbgui/csvruler.cxx
@@ -23,12 +23,10 @@
 #include <optutil.hxx>
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/uno/Sequence.hxx>
-#include <comphelper/string.hxx>
 #include <vcl/event.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/virdev.hxx>
 #include <vcl/ptrstyle.hxx>
-#include <miscuno.hxx>
 
 using namespace com::sun::star::uno;
 
diff --git a/sc/source/ui/dbgui/csvtablebox.cxx b/sc/source/ui/dbgui/csvtablebox.cxx
index fb8d0216a97e..efa8a75787d6 100644
--- a/sc/source/ui/dbgui/csvtablebox.cxx
+++ b/sc/source/ui/dbgui/csvtablebox.cxx
@@ -22,7 +22,6 @@
 #include <vcl/event.hxx>
 #include <vcl/lstbox.hxx>
 #include <vcl/settings.hxx>
-#include <editutil.hxx>
 #include <AccessibleCsvControl.hxx>
 
 ScCsvTableBox::ScCsvTableBox( vcl::Window* pParent, WinBits nBits ) :
diff --git a/sc/source/ui/dbgui/dapidata.cxx b/sc/source/ui/dbgui/dapidata.cxx
index 71b06030702c..b433c31890f8 100644
--- a/sc/source/ui/dbgui/dapidata.cxx
+++ b/sc/source/ui/dbgui/dapidata.cxx
@@ -19,12 +19,10 @@
 
 #undef SC_DLLIMPLEMENTATION
 
-#include <vcl/waitobj.hxx>
 #include <comphelper/processfactory.hxx>
 #include <osl/diagnose.h>
 
 #include <com/sun/star/sheet/DataImportMode.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
 #include <com/sun/star/sdb/DatabaseContext.hpp>
 #include <com/sun/star/sdb/XQueriesSupplier.hpp>
@@ -34,7 +32,6 @@
 using namespace com::sun::star;
 
 #include <dapidata.hxx>
-#include <sc.hrc>
 #include <miscuno.hxx>
 #include <dpsdbtab.hxx>
 
diff --git a/sc/source/ui/dbgui/dapitype.cxx b/sc/source/ui/dbgui/dapitype.cxx
index b8ae9754d056..f8791c4bc4b4 100644
--- a/sc/source/ui/dbgui/dapitype.cxx
+++ b/sc/source/ui/dbgui/dapitype.cxx
@@ -20,7 +20,6 @@
 #undef SC_DLLIMPLEMENTATION
 
 #include <dapitype.hxx>
-#include <sc.hrc>
 
 using namespace com::sun::star;
 
diff --git a/sc/source/ui/dbgui/dpgroupdlg.cxx b/sc/source/ui/dbgui/dpgroupdlg.cxx
index 9355d4e28b16..273a0d956564 100644
--- a/sc/source/ui/dbgui/dpgroupdlg.cxx
+++ b/sc/source/ui/dbgui/dpgroupdlg.cxx
@@ -22,11 +22,12 @@
 #endif
 
 #include <dpgroupdlg.hxx>
-#include <sc.hrc>
 #include <globstr.hrc>
 #include <scresid.hxx>
+#include <editfield.hxx>
 
 #include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp>
+#include <svtools/ctrlbox.hxx>
 
 namespace {
 
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index 96debd0892e4..9b6fe0ea03da 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -17,13 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <rangelst.hxx>
 #include <sfx2/dispatch.hxx>
 #include <vcl/waitobj.hxx>
 #include <sal/log.hxx>
 
 #include <uiitems.hxx>
-#include <dbdata.hxx>
 #include <reffact.hxx>
 #include <viewdata.hxx>
 #include <document.hxx>
diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx
index 05c6bd062c1c..bad74e8c3e7a 100644
--- a/sc/source/ui/dbgui/foptmgr.cxx
+++ b/sc/source/ui/dbgui/foptmgr.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <anyrefdg.hxx>
 #include <rangeutl.hxx>
 #include <dbdata.hxx>
 #include <viewdata.hxx>
@@ -26,6 +25,7 @@
 #include <globalnames.hxx>
 
 #include <foptmgr.hxx>
+#include <formula/funcutl.hxx>
 
 // ScFilterOptionsMgr (.ui's option helper)
 
diff --git a/sc/source/ui/dbgui/imoptdlg.cxx b/sc/source/ui/dbgui/imoptdlg.cxx
index a60541a85107..26781924baac 100644
--- a/sc/source/ui/dbgui/imoptdlg.cxx
+++ b/sc/source/ui/dbgui/imoptdlg.cxx
@@ -21,7 +21,6 @@
 #include <asciiopt.hxx>
 #include <comphelper/string.hxx>
 #include <osl/thread.h>
-#include <rtl/tencinfo.h>
 #include <global.hxx>
 
 static const sal_Char pStrFix[] = "FIX";
diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx
index fe98f18c67df..a23e77027266 100644
--- a/sc/source/ui/dbgui/pfiltdlg.cxx
+++ b/sc/source/ui/dbgui/pfiltdlg.cxx
@@ -35,7 +35,6 @@
 #include <strings.hrc>
 
 #include <pfiltdlg.hxx>
-#include <svl/zforlist.hxx>
 #include <svl/sharedstringpool.hxx>
 
 ScPivotFilterDlg::ScPivotFilterDlg(vcl::Window* pParent, const SfxItemSet& rArgSet,
diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index f2d357119d8f..ddfb6c004a50 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -27,15 +27,12 @@
 #include <com/sun/star/sheet/DataPilotFieldSortMode.hpp>
 #include <com/sun/star/sheet/DataPilotFieldShowItemsMode.hpp>
 
-#include <vcl/builderfactory.hxx>
 #include <osl/diagnose.h>
 
 #include <scresid.hxx>
 #include <dpobject.hxx>
 #include <dpsave.hxx>
 #include <pvfundlg.hrc>
-#include <strings.hrc>
-#include <scmod.hxx>
 #include <globstr.hrc>
 #include <dputil.hxx>
 
diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx
index 8e71454ee09f..e9e0016a1c33 100644
--- a/sc/source/ui/dbgui/scendlg.cxx
+++ b/sc/source/ui/dbgui/scendlg.cxx
@@ -19,16 +19,11 @@
 
 #undef SC_DLLIMPLEMENTATION
 
-#include <scitems.hxx>
 #include <comphelper/string.hxx>
 #include <svx/colorbox.hxx>
-#include <svx/drawitem.hxx>
-#include <svx/xtable.hxx>
-#include <sfx2/objsh.hxx>
 #include <unotools/useroptions.hxx>
 #include <vcl/weld.hxx>
 #include <unotools/localedatawrapper.hxx>
-#include <vcl/vclmedit.hxx>
 
 #include <global.hxx>
 #include <globstr.hrc>
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 8c847673f3b0..288842472a4b 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -36,15 +36,12 @@
 #include <strings.hxx>
 #include <csvtablebox.hxx>
 #include <osl/thread.h>
-#include <rtl/tencinfo.h>
 #include <unotools/transliterationwrapper.hxx>
-#include <editutil.hxx>
 
 #include <optutil.hxx>
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/uno/Sequence.hxx>
 #include <miscuno.hxx>
-#include <tools/urlobj.hxx>
 #include <osl/diagnose.h>
 
 //! TODO make dynamic
diff --git a/sc/source/ui/dbgui/scuiimoptdlg.cxx b/sc/source/ui/dbgui/scuiimoptdlg.cxx
index 9eba630d4298..f72135e9d16a 100644
--- a/sc/source/ui/dbgui/scuiimoptdlg.cxx
+++ b/sc/source/ui/dbgui/scuiimoptdlg.cxx
@@ -20,7 +20,6 @@
 #undef SC_DLLIMPLEMENTATION
 
 #include <scuiimoptdlg.hxx>
-#include <tabvwsh.hxx>
 #include <scresid.hxx>
 #include <strings.hrc>
 #include <strings.hxx>
@@ -28,8 +27,7 @@
 #include <osl/thread.h>
 #include <rtl/tencinfo.h>
 #include <imoptdlg.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/dialog.hxx>
+#include <svx/txencbox.hxx>
 
 // ScDelimiterTable
 
diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx
index 2c46c8684ba2..919632c577fd 100644
--- a/sc/source/ui/dbgui/sfiltdlg.cxx
+++ b/sc/source/ui/dbgui/sfiltdlg.cxx
@@ -22,7 +22,6 @@
 
 #include <uiitems.hxx>
 #include <rangenam.hxx>
-#include <dbdata.hxx>
 #include <reffact.hxx>
 #include <viewdata.hxx>
 #include <document.hxx>
diff --git a/sc/source/ui/dbgui/sortkeydlg.cxx b/sc/source/ui/dbgui/sortkeydlg.cxx
index 670fb4c04de8..db218cf8678f 100644
--- a/sc/source/ui/dbgui/sortkeydlg.cxx
+++ b/sc/source/ui/dbgui/sortkeydlg.cxx
@@ -9,8 +9,7 @@
 
 #include <memory>
 #include <sortkeydlg.hxx>
-#include <sortdlg.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/svapp.hxx>
 
 ScSortKeyItem::ScSortKeyItem(weld::Container* pParent)
     : m_xBuilder(Application::CreateBuilder(pParent, "modules/scalc/ui/sortkey.ui"))
diff --git a/sc/source/ui/dbgui/textimportoptions.cxx b/sc/source/ui/dbgui/textimportoptions.cxx
index 4414a132bef6..a8b1e66ca7a2 100644
--- a/sc/source/ui/dbgui/textimportoptions.cxx
+++ b/sc/source/ui/dbgui/textimportoptions.cxx
@@ -20,6 +20,7 @@
 #undef SC_DLLIMPLEMENTATION
 
 #include <textimportoptions.hxx>
+#include <svx/langbox.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/settings.hxx>
 #include <i18nlangtag/languagetag.hxx>
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index aedce9624ee5..2fa7ad90747d 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -23,7 +23,6 @@
 #include <i18nlangtag/languagetag.hxx>
 #include <svtools/collatorres.hxx>
 #include <unotools/collatorwrapper.hxx>
-#include <unotools/localedatawrapper.hxx>
 #include <comphelper/processfactory.hxx>
 
 #include <scitems.hxx>
@@ -31,7 +30,6 @@
 #include <viewdata.hxx>
 #include <document.hxx>
 #include <global.hxx>
-#include <globalnames.hxx>
 #include <dbdata.hxx>
 #include <userlist.hxx>
 #include <rangeutl.hxx>
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index 063be3a26fd4..f4bbec1a7351 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -30,7 +30,6 @@
 #include <strings.hrc>
 #include <subtotals.hrc>
 
-#include <subtdlg.hxx>
 #include <tpsubt.hxx>
 #include <memory>
 
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index d9d3f10ab920..94a40ecf9d7e 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -24,14 +24,10 @@
 #include <com/sun/star/sheet/TableValidationVisibility.hpp>
 #include <comphelper/string.hxx>
 #include <vcl/svapp.hxx>
-#include <vcl/builderfactory.hxx>
 #include <svl/aeitem.hxx>
 #include <svl/stritem.hxx>
 #include <svl/eitem.hxx>
 #include <svl/intitem.hxx>
-#include <basic/sbmeth.hxx>
-#include <basic/sbstar.hxx>
-#include <basic/sbmod.hxx>
 #include <sfx2/app.hxx>
 
 #include <scresid.hxx>
diff --git a/sc/source/ui/dialogs/searchresults.cxx b/sc/source/ui/dialogs/searchresults.cxx
index 48c5ac74f38b..34ac4dd989ee 100644
--- a/sc/source/ui/dialogs/searchresults.cxx
+++ b/sc/source/ui/dialogs/searchresults.cxx
@@ -10,13 +10,11 @@
 #include <searchresults.hxx>
 
 #include <svtools/simptabl.hxx>
-#include <vcl/treelistentry.hxx>
 #include <vcl/fixed.hxx>
 #include <sfx2/bindings.hxx>
 #include <sfx2/dispatch.hxx>
 #include <dociter.hxx>
 #include <document.hxx>
-#include <rangeutl.hxx>
 #include <tabvwsh.hxx>
 #include <strings.hrc>
 #include <sc.hrc>
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index 950b1a97cdbc..cf9841808e7b 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -17,11 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <sfx2/app.hxx>
-#include <sfx2/docfile.hxx>
 #include <sfx2/fcontnr.hxx>
 #include <sfx2/linkmgr.hxx>
-#include <svl/stritem.hxx>
 #include <vcl/weld.hxx>
 #include <unotools/charclass.hxx>
 
@@ -43,7 +40,6 @@
 #include <patattr.hxx>
 #include <docpool.hxx>
 
-#include <sc.hrc>
 #include <scabstdlg.hxx>
 #include <clipparam.hxx>
 
diff --git a/sc/source/ui/docshell/autostyl.cxx b/sc/source/ui/docshell/autostyl.cxx
index 41458d241159..28374ff02029 100644
--- a/sc/source/ui/docshell/autostyl.cxx
+++ b/sc/source/ui/docshell/autostyl.cxx
@@ -19,10 +19,9 @@
 
 #include <time.h>
 
-#include <attrib.hxx>
+#include <address.hxx>
 #include <autostyl.hxx>
 #include <docsh.hxx>
-#include <sc.hrc>
 
 static sal_uLong TimeNow()          // seconds
 {
diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx
index 4e3c700c73f1..0f7b21910127 100644
--- a/sc/source/ui/docshell/datastream.cxx
+++ b/sc/source/ui/docshell/datastream.cxx
@@ -11,16 +11,11 @@
 #include <datastreamgettime.hxx>
 
 #include <com/sun/star/frame/XLayoutManager.hpp>
-#include <com/sun/star/ui/XUIElement.hpp>
-#include <officecfg/Office/Common.hxx>
 #include <osl/conditn.hxx>
 #include <osl/time.h>
-#include <rtl/strbuf.hxx>
 #include <salhelper/thread.hxx>
 #include <sfx2/viewfrm.hxx>
-#include <datastreamdlg.hxx>
 #include <docsh.hxx>
-#include <rangelst.hxx>
 #include <tabvwsh.hxx>
 #include <viewdata.hxx>
 #include <stringutil.hxx>
@@ -33,6 +28,8 @@
 
 #include <queue>
 
+namespace com::sun::star::ui { class XUIElement; }
+
 namespace sc {
 
 static o3tl::enumarray<DebugTime, double> fTimes { 0.0, 0.0, 0.0 };
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index 05fe11477c6f..c2a80647386e 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -27,7 +27,6 @@
 #include <unotools/charclass.hxx>
 
 #include <dbdocfun.hxx>
-#include <sc.hrc>
 #include <dbdata.hxx>
 #include <undodat.hxx>
 #include <docsh.hxx>
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 9e69ee18f0ea..c5c9fcc23b1e 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -25,9 +25,7 @@
 #include <sfx2/linkmgr.hxx>
 #include <sfx2/bindings.hxx>
 #include <vcl/weld.hxx>
-#include <vcl/virdev.hxx>
 #include <vcl/waitobj.hxx>
-#include <svl/PasswordHelper.hxx>
 #include <svx/svdocapt.hxx>
 #include <sal/log.hxx>
 #include <unotools/charclass.hxx>
@@ -55,11 +53,9 @@
 #include <drwlayer.hxx>
 #include <editutil.hxx>
 #include <globstr.hrc>
-#include <globalnames.hxx>
 #include <olinetab.hxx>
 #include <patattr.hxx>
 #include <rangenam.hxx>
-#include <rangeutl.hxx>
 #include <refundo.hxx>
 #include <scresid.hxx>
 #include <stlpool.hxx>
@@ -71,11 +67,9 @@
 #include <undocell.hxx>
 #include <undodraw.hxx>
 #include <undotab.hxx>
-#include <waitoff.hxx>
 #include <sizedev.hxx>
 #include <scmod.hxx>
 #include <inputhdl.hxx>
-#include <inputwin.hxx>
 #include <editable.hxx>
 #include <compiler.hxx>
 #include <scui_def.hxx>
diff --git a/sc/source/ui/docshell/docfuncutil.cxx b/sc/source/ui/docshell/docfuncutil.cxx
index 29dc960457a1..304bd44b01a5 100644
--- a/sc/source/ui/docshell/docfuncutil.cxx
+++ b/sc/source/ui/docshell/docfuncutil.cxx
@@ -19,7 +19,6 @@
 
 #include <docfuncutil.hxx>
 #include <document.hxx>
-#include <markdata.hxx>
 #include <undobase.hxx>
 #include <global.hxx>
 #include <undoblk.hxx>
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 06c1b6a47860..d35afd2175c2 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -38,7 +38,7 @@
 #include <sfx2/dinfdlg.hxx>
 #include <sfx2/docfile.hxx>
 #include <sfx2/event.hxx>
-#include <sfx2/fcontnr.hxx>
+#include <sfx2/docfilt.hxx>
 #include <sfx2/objface.hxx>
 #include <sfx2/viewfrm.hxx>
 #include <svl/documentlockfile.hxx>
@@ -61,16 +61,6 @@
 #include <com/sun/star/ui/theModuleUIConfigurationManagerSupplier.hpp>
 #include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
 #include <com/sun/star/util/VetoException.hpp>
-#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
-#include <com/sun/star/sheet/XSpreadsheet.hpp>
-#include <com/sun/star/container/XIndexAccess.hpp>
-#include <com/sun/star/table/XTableChartsSupplier.hpp>
-#include <com/sun/star/table/XTableCharts.hpp>
-#include <com/sun/star/table/XTableChart.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
-#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>
 
@@ -81,7 +71,6 @@
 #include <svx/dialogs.hrc>
 
 #include <formulacell.hxx>
-#include <postit.hxx>
 #include <global.hxx>
 #include <filter.hxx>
 #include <scmod.hxx>
@@ -98,8 +87,6 @@
 #include <autostyl.hxx>
 #include <attrib.hxx>
 #include <asciiopt.hxx>
-#include <waitoff.hxx>
-#include <docpool.hxx>
 #include <progress.hxx>
 #include <pntlock.hxx>
 #include <docuno.hxx>
@@ -114,7 +101,6 @@
 #include <hints.hxx>
 #include <xmlwrap.hxx>
 #include <drwlayer.hxx>
-#include <refreshtimer.hxx>
 #include <dbdata.hxx>
 #include <scextopt.hxx>
 #include <compiler.hxx>
@@ -127,18 +113,15 @@
 #include "docshimp.hxx"
 #include <sizedev.hxx>
 #include <refreshtimerprotector.hxx>
-#include <orcus/orcus_import_ods.hpp>
-#include <orcusfiltersimpl.hxx>
 
 #include <officecfg/Office/Calc.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/string.hxx>
 #include <unotools/configmgr.hxx>
 #include <uiitems.hxx>
-#include <cellsuno.hxx>
 #include <dpobject.hxx>
 #include <markdata.hxx>
-#include <optuno.hxx>
+#include <docoptio.hxx>
 #include <orcusfilters.hxx>
 #include <datastream.hxx>
 #include <documentlinkmgr.hxx>
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index f354ec9d1e22..638b8a6365ae 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -17,15 +17,12 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <scitems.hxx>
 #include <rtl/bootstrap.hxx>
 #include <osl/file.hxx>
 #include <svx/drawitem.hxx>
 #include <svl/asiancfg.hxx>
 #include <editeng/forbiddencharacterstable.hxx>
-#include <editeng/unolingu.hxx>
-#include <orcus/orcus_import_ods.hpp>
-#include <orcusfiltersimpl.hxx>
+#include <orcusfilters.hxx>
 #include <config_folders.h>
 #include <unotools/configmgr.hxx>
 #include <comphelper/processfactory.hxx>
@@ -33,9 +30,8 @@
 #include <drwlayer.hxx>
 #include <stlpool.hxx>
 #include <docsh.hxx>
-#include "docshimp.hxx"
 #include <docfunc.hxx>
-#include <sc.hrc>
+#include <svx/svxids.hrc>
 #include <filter.hxx>
 #include <functional>
 
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index a7642d4e1299..4506ec13e52b 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -25,7 +25,6 @@
 #include <editeng/flstitem.hxx>
 #include <editeng/paperinf.hxx>
 #include <editeng/sizeitem.hxx>
-#include <rtl/strbuf.hxx>
 #include <sal/log.hxx>
 #include <sfx2/viewfrm.hxx>
 #include <sfx2/app.hxx>
@@ -55,7 +54,6 @@
 #include <chgviset.hxx>
 #include <progress.hxx>
 #include <redcom.hxx>
-#include <sc.hrc>
 #include <inputopt.hxx>
 #include <drwlayer.hxx>
 #include <inputhdl.hxx>
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index b382bd81e29a..222cbf62ca58 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -21,19 +21,14 @@
 
 #include <boost/property_tree/json_parser.hpp>
 
-#include <com/sun/star/embed/XEmbeddedObject.hpp>
 #include <com/sun/star/frame/Desktop.hpp>
 
 using namespace ::com::sun::star;
 
-#include <math.h>
-
 #include <scitems.hxx>
 #include <editeng/flstitem.hxx>
-#include <editeng/langitem.hxx>
 #include <sfx2/fcontnr.hxx>
 #include <sfx2/infobar.hxx>
-#include <sfx2/linkmgr.hxx>
 #include <sfx2/objface.hxx>
 #include <sfx2/docfile.hxx>
 #include <svtools/ehdl.hxx>
@@ -48,7 +43,6 @@ using namespace ::com::sun::star;
 #include <svx/dataaccessdescriptor.hxx>
 #include <svx/drawitem.hxx>
 #include <svx/fmshell.hxx>
-#include <svx/svdoole2.hxx>
 #include <sfx2/passwd.hxx>
 #include <sfx2/filedlghelper.hxx>
 #include <sfx2/dispatch.hxx>
@@ -56,7 +50,6 @@ using namespace ::com::sun::star;
 #include <svl/PasswordHelper.hxx>
 #include <svl/documentlockfile.hxx>
 #include <svl/sharecontrolfile.hxx>
-#include <svl/slstitm.hxx>
 #include <unotools/securityoptions.hxx>
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
 #include <sal/log.hxx>
@@ -66,7 +59,6 @@ using namespace ::com::sun::star;
 #include <comphelper/processfactory.hxx>
 #include <docuno.hxx>
 
-#include <com/sun/star/sdbc/XResultSet.hpp>
 #include <docsh.hxx>
 #include "docshimp.hxx"
 #include <docfunc.hxx>
@@ -82,11 +74,8 @@ using namespace ::com::sun::star;
 #include <viewdata.hxx>
 #include <tabvwsh.hxx>
 #include <impex.hxx>
-#include <attrib.hxx>
 #include <undodat.hxx>
-#include <autostyl.hxx>
 #include <undocell.hxx>
-#include <undotab.hxx>
 #include <inputhdl.hxx>
 #include <dbdata.hxx>
 #include <servobj.hxx>
@@ -103,11 +92,9 @@ using namespace ::com::sun::star;
 #include <undostyl.hxx>
 #include <rangeseq.hxx>
 #include <chgtrack.hxx>
-#include <printopt.hxx>
 #include <com/sun/star/document/UpdateDocMode.hpp>
 #include <scresid.hxx>
 #include <scabstdlg.hxx>
-#include <externalrefmgr.hxx>
 #include <sharedocdlg.hxx>
 #include <conditio.hxx>
 #include <sheetevents.hxx>
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index 7835569e1014..a9e9190deb67 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -22,7 +22,6 @@
 
 #include <cassert>
 
-#include <scitems.hxx>
 #include <vcl/weld.hxx>
 #include <vcl/waitobj.hxx>
 #include <sfx2/app.hxx>
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 26e3fe5078b5..f2a844389786 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -24,7 +24,6 @@
 
 #include <docsh.hxx>
 
-#include <stlsheet.hxx>
 #include <stlpool.hxx>
 #include <global.hxx>
 #include <viewdata.hxx>
@@ -35,7 +34,6 @@
 #include <scmod.hxx>
 #include <compiler.hxx>
 #include <interpre.hxx>
-#include <calcconfig.hxx>
 #include <formulaopt.hxx>
 
 #include <vcl/svapp.hxx>
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 8a40750ae63c..268b23c3642b 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -37,7 +37,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/XDriver.hpp>
 #include <com/sun/star/sdbc/XDriverAccess.hpp>
 #include <com/sun/star/sdbc/DriverManager.hpp>
 #include <com/sun/star/sdbc/XResultSetUpdate.hpp>
@@ -52,17 +51,13 @@
 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/container/XEnumerationAccess.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
 #include <com/sun/star/ucb/NameClash.hpp>
 #include <com/sun/star/ucb/TransferInfo.hpp>
 #include <com/sun/star/ucb/XCommandInfo.hpp>
 
 #include <scerrors.hxx>
 #include <docsh.hxx>
-#include <filter.hxx>
 #include <progress.hxx>
-#include <formulacell.hxx>
 #include <editutil.hxx>
 #include <cellform.hxx>
 #include <dbdocutl.hxx>
diff --git a/sc/source/ui/docshell/editable.cxx b/sc/source/ui/docshell/editable.cxx
index b66d47e77442..8d461a0806b7 100644
--- a/sc/source/ui/docshell/editable.cxx
+++ b/sc/source/ui/docshell/editable.cxx
@@ -21,7 +21,6 @@
 #include <document.hxx>
 #include <viewfunc.hxx>
 #include <globstr.hrc>
-#include <markdata.hxx>
 
 ScEditableTester::ScEditableTester() :
     mbIsEditable(true),
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index e7fc510ef308..36b4aac3fc79 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -38,17 +38,13 @@
 
 #include <osl/file.hxx>
 #include <sfx2/app.hxx>
-#include <sfx2/docfilt.hxx>
 #include <sfx2/docfile.hxx>
 #include <sfx2/event.hxx>
 #include <sfx2/fcontnr.hxx>
-#include <sfx2/sfxsids.hrc>
 #include <sfx2/objsh.hxx>
-#include <svl/broadcast.hxx>
 #include <svl/itemset.hxx>
 #include <svl/stritem.hxx>
 #include <svl/urihelper.hxx>
-#include <svl/zformat.hxx>
 #include <svl/sharedstringpool.hxx>
 #include <sfx2/linkmgr.hxx>
 #include <tools/urlobj.hxx>
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 090df66b30cd..913de710ba08 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -17,8 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <sc.hrc>
-
 #include <comphelper/processfactory.hxx>
 #include <i18nlangtag/languagetag.hxx>
 #include <sot/formats.hxx>
@@ -28,17 +26,14 @@
 #include <unotools/charclass.hxx>
 
 #include <global.hxx>
-#include <scerrors.hxx>
 #include <docsh.hxx>
 #include <undoblk.hxx>
 #include <rangenam.hxx>
-#include <viewdata.hxx>
 #include <tabvwsh.hxx>
 #include <filter.hxx>
 #include <asciiopt.hxx>
 #include <formulacell.hxx>
 #include <cellform.hxx>
-#include <docoptio.hxx>
 #include <progress.hxx>
 #include <scitems.hxx>
 #include <editable.hxx>
diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx
index cad48943ed54..574165aea714 100644
--- a/sc/source/ui/docshell/olinefun.cxx
+++ b/sc/source/ui/docshell/olinefun.cxx
@@ -24,12 +24,10 @@
 #include <docsh.hxx>
 #include <olinetab.hxx>
 #include <tabvwsh.hxx>
-#include <inputhdl.hxx>
 #include <undodat.hxx>
 #include <globstr.hrc>
 #include <sc.hrc>
 
-#include <sfx2/lokhelper.hxx>
 #include <comphelper/lok.hxx>
 
 
diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx
index 48cf3a38a970..d0df8fe42348 100644
--- a/sc/source/ui/docshell/servobj.cxx
+++ b/sc/source/ui/docshell/servobj.cxx
@@ -25,7 +25,6 @@
 #include <impex.hxx>
 #include <brdcst.hxx>
 #include <rangenam.hxx>
-#include <sc.hrc>
 #include <unotools/charclass.hxx>
 
 using namespace formula;
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index 8a04cade2223..83a0e4f87c76 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -39,7 +39,6 @@
 #include <tablink.hxx>
 
 #include <scextopt.hxx>
-#include <table.hxx>
 #include <document.hxx>
 #include <docsh.hxx>
 #include <globstr.hrc>
@@ -50,7 +49,6 @@
 #include <hints.hxx>
 #include <dociter.hxx>
 #include <formula/opcode.hxx>
-#include <formulacell.hxx>
 #include <formulaiter.hxx>
 #include <tokenarray.hxx>
 
diff --git a/sc/source/ui/drawfunc/chartsh.cxx b/sc/source/ui/drawfunc/chartsh.cxx
index 9ab065d3fa80..0e9bfe3521f1 100644
--- a/sc/source/ui/drawfunc/chartsh.cxx
+++ b/sc/source/ui/drawfunc/chartsh.cxx
@@ -21,19 +21,12 @@
 #include <svx/svdobj.hxx>
 #include <svx/graphichelper.hxx>
 
-#include <svl/srchitem.hxx>
-#include <sfx2/app.hxx>
 #include <sfx2/objface.hxx>
-#include <sfx2/request.hxx>
 #include <vcl/EnumContext.hxx>
-#include <svl/whiter.hxx>
 
 #include <chartsh.hxx>
-#include <drwlayer.hxx>
 #include <sc.hrc>
 #include <viewdata.hxx>
-#include <document.hxx>
-#include <docpool.hxx>
 #include <drawview.hxx>
 #include <gridwin.hxx>
 
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 4d68e8365fd2..33af4c4f1289 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -21,11 +21,8 @@
 #include <svx/dialogs.hrc>
 #include <sc.hrc>
 
-#include <scitems.hxx>
-
 #include <editeng/eeitem.hxx>
 #include <svx/fontwork.hxx>
-#include <svl/srchitem.hxx>
 #include <svx/svdpage.hxx>
 #include <sfx2/app.hxx>
 #include <sfx2/objface.hxx>
@@ -39,12 +36,9 @@
 #include <strings.hrc>
 #include <viewdata.hxx>
 #include <document.hxx>
-#include <docpool.hxx>
 #include <drawview.hxx>
 #include <scresid.hxx>
 #include <svx/svdobj.hxx>
-#include <svx/drawitem.hxx>
-#include <svx/xtable.hxx>
 #include <tabvwsh.hxx>
 #include <gridwin.hxx>
 #include <sfx2/bindings.hxx>
@@ -57,7 +51,6 @@
 #include <sfx2/evntconf.hxx>
 #include <sfx2/viewsh.hxx>
 #include <com/sun/star/util/XModifiable.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
 #include <memory>
 
 
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index 08cda1bac046..c7946f956f74 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -19,16 +19,13 @@
 
 #include <com/sun/star/embed/EmbedMisc.hpp>
 
-#include <scitems.hxx>
 #include <editeng/eeitem.hxx>
 #include <editeng/sizeitem.hxx>
 #include <svx/svdpagv.hxx>
 #include <svx/xdef.hxx>
-#include <sfx2/app.hxx>
 #include <sfx2/objsh.hxx>
 #include <sfx2/viewfrm.hxx>
 #include <svl/ptitem.hxx>
-#include <svl/whiter.hxx>
 #include <svx/svdobj.hxx>
 #include <svx/svdouno.hxx>
 #include <svx/extrusionbar.hxx>
@@ -48,7 +45,6 @@
 #include <drtxtob.hxx>
 #include <gridwin.hxx>
 #include <svx/svdoole2.hxx>
-#include <svx/svdocapt.hxx>
 
 using namespace com::sun::star;
 
diff --git a/sc/source/ui/drawfunc/drawsh4.cxx b/sc/source/ui/drawfunc/drawsh4.cxx
index a571411c945a..7184889a6773 100644
--- a/sc/source/ui/drawfunc/drawsh4.cxx
+++ b/sc/source/ui/drawfunc/drawsh4.cxx
@@ -17,19 +17,12 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <scitems.hxx>
-#include <svx/drawitem.hxx>
-#include <svx/fontwork.hxx>
 #include <svx/svdotext.hxx>
 #include <svx/xdef.hxx>
-#include <sfx2/objsh.hxx>
-#include <sfx2/viewfrm.hxx>
 #include <svx/svdoashp.hxx>
 #include <drawsh.hxx>
 #include <drawview.hxx>
 #include <viewdata.hxx>
-#include <tabvwsh.hxx>
-#include <sc.hrc>
 
 void ScDrawShell::GetFormTextState(SfxItemSet& rSet)
 {
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index 920d62f9b43f..5b1dd28f08ea 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -25,16 +25,9 @@
 #include <tools/urlobj.hxx>
 #include <cliputil.hxx>
 #include <svx/svxdlg.hxx>
-#include <svx/dialogs.hrc>
-#include <svx/fmglob.hxx>
 #include <svx/hlnkitem.hxx>
-#include <svx/fontwork.hxx>
-#include <svx/svdocapt.hxx>
 #include <svx/svdoole2.hxx>
 #include <svx/svdouno.hxx>
-#include <svx/svdpage.hxx>
-#include <svx/svdundo.hxx>
-#include <svx/xdef.hxx>
 #include <svx/extrusionbar.hxx>
 #include <svx/fontworkbar.hxx>
 #include <sfx2/docfile.hxx>
@@ -42,7 +35,6 @@
 #include <com/sun/star/form/FormButtonType.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/beans/XPropertySetInfo.hpp>
-#include <com/sun/star/awt/XControlModel.hpp>
 
 #include <drawsh.hxx>
 #include <drawview.hxx>
@@ -52,7 +44,6 @@
 #include <undotab.hxx>
 #include <drwlayer.hxx>
 #include <userdat.hxx>
-#include <postit.hxx>
 #include <drtxtob.hxx>
 #include <memory>
 
diff --git a/sc/source/ui/drawfunc/drformsh.cxx b/sc/source/ui/drawfunc/drformsh.cxx
index 43f37575fc1f..4da5061b8e0e 100644
--- a/sc/source/ui/drawfunc/drformsh.cxx
+++ b/sc/source/ui/drawfunc/drformsh.cxx
@@ -17,22 +17,13 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <editeng/eeitem.hxx>
-#include <svx/fontwork.hxx>
-#include <svl/srchitem.hxx>
-#include <sfx2/app.hxx>
 #include <sfx2/objface.hxx>
-#include <sfx2/request.hxx>
-#include <svl/whiter.hxx>
+#include <sfx2/msg.hxx>
+#include <sfx2/toolbarids.hxx>
+#include <sfx2/shell.hxx>
 
+#include <drawsh.hxx>
 #include <drformsh.hxx>
-#include <drwlayer.hxx>
-#include <sc.hrc>
-#include <viewdata.hxx>
-#include <document.hxx>
-#include <docpool.hxx>
-#include <drawview.hxx>
-#include <svx/svdobj.hxx>
 #include <vcl/EnumContext.hxx>
 
 #define ShellClass_ScDrawFormShell
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 90708dee1fb6..340c5afe9ee7 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <com/sun/star/lang/Locale.hpp>
 #include <comphelper/string.hxx>
 #include <scitems.hxx>
 
@@ -37,16 +36,12 @@
 #include <editeng/ulspitem.hxx>
 #include <svx/hlnkitem.hxx>
 #include <svx/svdoutl.hxx>
-#include <editeng/unolingu.hxx>
-#include <editeng/outlobj.hxx>
 #include <editeng/postitem.hxx>
 #include <editeng/scripttypeitem.hxx>
 #include <editeng/shdditem.hxx>
-#include <svl/srchitem.hxx>
 #include <editeng/udlnitem.hxx>
 #include <editeng/wghtitem.hxx>
 #include <editeng/writingmodeitem.hxx>
-#include <sfx2/app.hxx>
 #include <sfx2/dispatch.hxx>
 #include <sfx2/objface.hxx>
 #include <sfx2/objsh.hxx>
@@ -58,7 +53,6 @@
 #include <svl/languageoptions.hxx>
 
 #include <svx/svxdlg.hxx>
-#include <svx/dialogs.hrc>
 #include <vcl/EnumContext.hxx>
 
 #include <sc.hrc>
@@ -66,7 +60,6 @@
 #include <scresid.hxx>
 #include <scmod.hxx>
 #include <drtxtob.hxx>
-#include <fudraw.hxx>
 #include <viewdata.hxx>
 #include <document.hxx>
 #include <drawview.hxx>
@@ -77,8 +70,6 @@
 #define ShellClass_ScDrawTextObjectBar
 #include <scslots.hxx>
 
-#include <memory>
-
 using namespace ::com::sun::star;
 
 SFX_IMPL_INTERFACE(ScDrawTextObjectBar, SfxShell)
diff --git a/sc/source/ui/drawfunc/drtxtob1.cxx b/sc/source/ui/drawfunc/drtxtob1.cxx
index 92f09f3f61a6..183362cf0b9e 100644
--- a/sc/source/ui/drawfunc/drtxtob1.cxx
+++ b/sc/source/ui/drawfunc/drtxtob1.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <scitems.hxx>
 #include <editeng/eeitem.hxx>
 
 #include <svx/svxdlg.hxx>
@@ -27,17 +26,16 @@
 #include <editeng/outliner.hxx>
 #include <editeng/spltitem.hxx>
 #include <editeng/widwitem.hxx>
-#include <sot/exchange.hxx>
+#include <editeng/editids.hrc>
+#include <svx/svxids.hrc>
 #include <vcl/transfer.hxx>
 
-#include <sc.hrc>
 #include <drtxtob.hxx>
 #include <drawview.hxx>
 #include <viewdata.hxx>
 #include <gridwin.hxx>
 
 #include <scabstdlg.hxx>
-#include <memory>
 
 bool ScDrawTextObjectBar::ExecuteCharDlg( const SfxItemSet& rArgs,
                                                 SfxItemSet& rOutSet , sal_uInt16 nSlot)
diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx
index 192f05e6bd34..3af7fa3a95a8 100644
--- a/sc/source/ui/drawfunc/drtxtob2.cxx
+++ b/sc/source/ui/drawfunc/drtxtob2.cxx
@@ -17,20 +17,13 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <scitems.hxx>
 #include <editeng/adjustitem.hxx>
-#include <svx/drawitem.hxx>
 #include <svx/fontwork.hxx>
 #include <editeng/frmdiritem.hxx>
-#include <editeng/outlobj.hxx>
-#include <svx/svdocapt.hxx>
-#include <svx/xtextit.hxx>
 #include <editeng/writingmodeitem.hxx>
 #include <sfx2/bindings.hxx>
 #include <sfx2/viewfrm.hxx>
-#include <sfx2/objsh.hxx>
 #include <sfx2/request.hxx>
-#include <sot/formats.hxx>
 #include <svl/whiter.hxx>
 #include <svx/svdoashp.hxx>
 #include <sc.hrc>
@@ -38,10 +31,6 @@
 #include <viewdata.hxx>
 #include <drawview.hxx>
 #include <tabvwsh.hxx>
-#include <impex.hxx>
-#include <docsh.hxx>
-#include <transobj.hxx>
-#include <drwtrans.hxx>
 #include <drwlayer.hxx>
 
 sal_uInt16 ScGetFontWorkId()
diff --git a/sc/source/ui/drawfunc/fuconarc.cxx b/sc/source/ui/drawfunc/fuconarc.cxx
index 1c93f4a38882..4a05ea4470d5 100644
--- a/sc/source/ui/drawfunc/fuconarc.cxx
+++ b/sc/source/ui/drawfunc/fuconarc.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <fuconarc.hxx>
-#include <sc.hrc>
 #include <tabvwsh.hxx>
 #include <drawview.hxx>
 
diff --git a/sc/source/ui/drawfunc/fuconcustomshape.cxx b/sc/source/ui/drawfunc/fuconcustomshape.cxx
index 6d168ad82740..3ed220a31352 100644
--- a/sc/source/ui/drawfunc/fuconcustomshape.cxx
+++ b/sc/source/ui/drawfunc/fuconcustomshape.cxx
@@ -27,9 +27,7 @@
 #include <svx/svdoashp.hxx>
 #include <editeng/eeitem.hxx>
 #include <svx/sdtagitm.hxx>
-#include <fuconuno.hxx>
 #include <tabvwsh.hxx>
-#include <sc.hrc>
 #include <drawview.hxx>
 #include <editeng/adjustitem.hxx>
 
diff --git a/sc/source/ui/drawfunc/fuconpol.cxx b/sc/source/ui/drawfunc/fuconpol.cxx
index ed345c5ae5c2..138cf5da8f14 100644
--- a/sc/source/ui/drawfunc/fuconpol.cxx
+++ b/sc/source/ui/drawfunc/fuconpol.cxx
@@ -19,7 +19,6 @@
 
 #include <fuconpol.hxx>
 #include <tabvwsh.hxx>
-#include <sc.hrc>
 #include <drawview.hxx>
 
 // Create default drawing objects via keyboard
diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx
index 5ecc2b057bc1..4761c7a01899 100644
--- a/sc/source/ui/drawfunc/fuconrec.cxx
+++ b/sc/source/ui/drawfunc/fuconrec.cxx
@@ -19,14 +19,12 @@
 
 #include <fuconrec.hxx>
 #include <tabvwsh.hxx>
-#include <sc.hrc>
 #include <drawview.hxx>
 
 #include <editeng/outlobj.hxx>
 // Create default drawing objects via keyboard
 #include <svx/svdopath.hxx>
 #include <svx/svdocapt.hxx>
-#include <svx/dialogs.hrc>
 #include <svx/strings.hrc>
 #include <svx/xlnwtit.hxx>
 #include <svx/xlnstwit.hxx>
diff --git a/sc/source/ui/drawfunc/fuconstr.cxx b/sc/source/ui/drawfunc/fuconstr.cxx
index 1f0abb286391..4e5c54cd6b5b 100644
--- a/sc/source/ui/drawfunc/fuconstr.cxx
+++ b/sc/source/ui/drawfunc/fuconstr.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <editeng/outliner.hxx>
 #include <editeng/outlobj.hxx>
 #include <svx/svdotext.hxx>
 #include <svx/svdouno.hxx>
@@ -27,10 +26,7 @@
 #include <fudraw.hxx>
 #include <tabvwsh.hxx>
 #include <futext.hxx>
-#include <sc.hrc>
 #include <drawview.hxx>
-#include <document.hxx>
-#include <gridwin.hxx>
 
 //  maximal permitted mouse movement to start Drag&Drop
 //! fusel,fuconstr,futext - combine them!
diff --git a/sc/source/ui/drawfunc/fuconuno.cxx b/sc/source/ui/drawfunc/fuconuno.cxx
index 948b1568ddb3..16c18d075b01 100644
--- a/sc/source/ui/drawfunc/fuconuno.cxx
+++ b/sc/source/ui/drawfunc/fuconuno.cxx
@@ -19,7 +19,6 @@
 
 #include <fuconuno.hxx>
 #include <tabvwsh.hxx>
-#include <sc.hrc>
 #include <drawview.hxx>
 
 FuConstUnoControl::FuConstUnoControl(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* pViewP,
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index dfcce237c551..383d03c01c04 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -22,10 +22,6 @@
 #include <svx/svdobj.hxx>
 #include <svx/svdoole2.hxx>
 #include <svx/svdouno.hxx>
-#include <svx/svdocapt.hxx>
-#include <svx/svdpage.hxx>
-#include <svx/svditer.hxx>
-#include <svx/svdundo.hxx>
 #include <sfx2/dispatch.hxx>
 #include <sfx2/viewfrm.hxx>
 
@@ -36,7 +32,6 @@
 #include <drwlayer.hxx>
 #include <userdat.hxx>
 #include <docsh.hxx>
-#include <postit.hxx>
 #include <drawview.hxx>
 
 // base class for draw module specific functions
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 0bbc619ca1da..ebd42bd9db0b 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -41,7 +41,6 @@
 #include <drawview.hxx>
 #include <document.hxx>
 #include <scresid.hxx>
-#include <progress.hxx>
 #include <strings.hrc>
 #include <globstr.hrc>
 
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index e59d85af74a0..6593623a10d8 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -25,15 +25,10 @@
 #include <sot/exchange.hxx>
 #include <svl/globalnameitem.hxx>
 #include <sfx2/viewfrm.hxx>
-#include <sfx2/docfile.hxx>
 #include <svl/stritem.hxx>
 #include <svx/svdoole2.hxx>
-#include <tools/urlobj.hxx>
-#include <vcl/syschild.hxx>
-#include <svl/urihelper.hxx>
 #include <unotools/moduleoptions.hxx>
 #include <svtools/insdlg.hxx>
-#include <svtools/soerr.hxx>
 #include <svtools/embedhlp.hxx>
 #include <svx/svxdlg.hxx>
 #include <comphelper/classids.hxx>
@@ -41,17 +36,13 @@
 #include <svx/svdpage.hxx>
 #include <svx/svdundo.hxx>
 #include <sfx2/msgpool.hxx>
-#include <svx/charthelper.hxx>
 #include <scmod.hxx>
 #include <sal/log.hxx>
 
-#include <cppuhelper/component_context.hxx>
-#include <comphelper/processfactory.hxx>
 #include <comphelper/storagehelper.hxx>
 #include <comphelper/propertysequence.hxx>
 #include <com/sun/star/embed/EmbedVerbs.hpp>
 #include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/chart2/data/XDataProvider.hpp>
 #include <com/sun/star/chart2/data/XDataReceiver.hpp>
 #include <com/sun/star/chart2/XChartDocument.hpp>
 #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
@@ -66,15 +57,13 @@
 #include <fuinsert.hxx>
 #include <tabvwsh.hxx>
 #include <sc.hrc>
-#include <chartarr.hxx>
+#include <chartpos.hxx>
 #include <docsh.hxx>
 #include <document.hxx>
 #include <undotab.hxx>
-#include <chartlis.hxx>
 #include <uiitems.hxx>
 #include <drawview.hxx>
 #include <markdata.hxx>
-#include <gridwin.hxx>
 #include <dpobject.hxx>
 #include <memory>
 
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index 2c450ea7a3d2..9d063a6d80ac 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -17,9 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <com/sun/star/embed/EmbedStates.hpp>
-
-#include <editeng/eeitem.hxx>
 #include <editeng/flditem.hxx>
 #include <svx/svddrgmt.hxx>
 #include <svx/svdoole2.hxx>
@@ -30,8 +27,8 @@
 #include <svx/svdomedia.hxx>
 #include <svx/svdpagv.hxx>
 #include <editeng/outlobj.hxx>
-#include <svx/svdocapt.hxx>
 #include <sfx2/app.hxx>
+#include <sfx2/ipclient.hxx>
 
 #include <fusel.hxx>
 #include <sc.hrc>
@@ -39,11 +36,9 @@
 #include <futext.hxx>
 #include <drawview.hxx>
 #include <tabvwsh.hxx>
-#include <drawpage.hxx>
 #include <drwlayer.hxx>
 #include <userdat.hxx>
 #include <scmod.hxx>
-#include <client.hxx>
 #include <charthelper.hxx>
 #include <docuno.hxx>
 #include <docsh.hxx>
diff --git a/sc/source/ui/drawfunc/fusel2.cxx b/sc/source/ui/drawfunc/fusel2.cxx
index 85989355a41e..b4ab7cefa6db 100644
--- a/sc/source/ui/drawfunc/fusel2.cxx
+++ b/sc/source/ui/drawfunc/fusel2.cxx
@@ -18,17 +18,12 @@
  */
 
 #include <svx/svditer.hxx>
-#include <svx/svdocapt.hxx>
 #include <svx/svdpagv.hxx>
-#include <sfx2/dispatch.hxx>
-#include <editeng/outliner.hxx>
 
 #include <fusel.hxx>
 #include <tabvwsh.hxx>
 #include <document.hxx>
 #include <detfunc.hxx>
-#include <futext.hxx>
-#include <sc.hrc>
 #include <attrib.hxx>
 #include <scitems.hxx>
 #include <userdat.hxx>
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index a298bab0aed6..f1a4afcd91c4 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -24,7 +24,6 @@
 #include <svx/sdtacitm.hxx>
 #include <svx/svdotext.hxx>
 #include <editeng/unolingu.hxx>
-#include <svx/svdocapt.hxx>
 #include <sfx2/bindings.hxx>
 #include <sfx2/dispatch.hxx>
 #include <sfx2/viewfrm.hxx>
@@ -38,9 +37,6 @@
 #include <tabvwsh.hxx>
 #include <drawview.hxx>
 
-// Create default drawing objects via keyboard
-#include <scresid.hxx>
-
 // maximum of mouse movement which allows to start Drag&Drop
 //! fusel,fuconstr,futext - combined!
 #define SC_MAXDRAGMOVE  3
diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx
index 67280ed649fb..43e649b687cc 100644
--- a/sc/source/ui/drawfunc/futext3.cxx
+++ b/sc/source/ui/drawfunc/futext3.cxx
@@ -17,30 +17,20 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <editeng/editeng.hxx>
-#include <editeng/outlobj.hxx>
 #include <svx/svdocapt.hxx>
-#include <svx/svdpage.hxx>
 #include <svx/svdundo.hxx>
-#include <svx/svdview.hxx>
-#include <editeng/editobj.hxx>
 #include <vcl/cursor.hxx>
-#include <sfx2/objsh.hxx>
-#include <editeng/writingmodeitem.hxx>
 
 #include <global.hxx>
 #include <drwlayer.hxx>
 #include <userdat.hxx>
 #include <tabvwsh.hxx>
 #include <document.hxx>
-#include <editutil.hxx>
 #include <futext.hxx>
 #include <docsh.hxx>
 #include <postit.hxx>
 #include <globstr.hrc>
 #include <scresid.hxx>
-#include <attrib.hxx>
-#include <scitems.hxx>
 #include <drawview.hxx>
 #include <undocell.hxx>
 
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index 64f2e4339838..e1c39b39e3a3 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -17,25 +17,23 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <sfx2/app.hxx>
 #include <sfx2/objface.hxx>
-#include <sfx2/request.hxx>
 #include <vcl/EnumContext.hxx>
 #include <sfx2/opengrf.hxx>
-#include <svl/whiter.hxx>
 #include <svx/svdograf.hxx>
 #include <svx/grfflt.hxx>
 #include <svx/grafctrl.hxx>
 #include <svx/compressgraphicdialog.hxx>
 #include <svx/graphichelper.hxx>
+#include <svx/svxids.hrc>
 
 #include <graphsh.hxx>
 #include <strings.hrc>
 #include <viewdata.hxx>
 #include <drawview.hxx>
+#include <gridwin.hxx>
 #include <scresid.hxx>
 #include <svx/extedit.hxx>
-#include <tabvwsh.hxx>
 
 #define ShellClass_ScGraphicShell
 #include <scslots.hxx>
diff --git a/sc/source/ui/drawfunc/mediash.cxx b/sc/source/ui/drawfunc/mediash.cxx
index 5e236fe3cd36..b70c5cb31d23 100644
--- a/sc/source/ui/drawfunc/mediash.cxx
+++ b/sc/source/ui/drawfunc/mediash.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <memory>
-#include <sfx2/app.hxx>
 #include <sfx2/objface.hxx>
 #include <sfx2/request.hxx>
 #include <avmedia/mediaitem.hxx>
diff --git a/sc/source/ui/drawfunc/oleobjsh.cxx b/sc/source/ui/drawfunc/oleobjsh.cxx
index 5ccf2c705db7..981bf3a30a79 100644
--- a/sc/source/ui/drawfunc/oleobjsh.cxx
+++ b/sc/source/ui/drawfunc/oleobjsh.cxx
@@ -17,22 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <editeng/eeitem.hxx>
-#include <svx/fontwork.hxx>
-#include <svl/srchitem.hxx>
-#include <sfx2/app.hxx>
 #include <sfx2/objface.hxx>
-#include <sfx2/request.hxx>
-#include <svl/whiter.hxx>
 
 #include <oleobjsh.hxx>
-#include <drwlayer.hxx>
-#include <sc.hrc>
-#include <viewdata.hxx>
-#include <document.hxx>
-#include <docpool.hxx>
-#include <drawview.hxx>
-#include <svx/svdobj.hxx>
 #include <vcl/EnumContext.hxx>
 
 #define ShellClass_ScOleObjectShell
diff --git a/sc/source/ui/inc/csvgrid.hxx b/sc/source/ui/inc/csvgrid.hxx
index c233997b5f35..641613342a03 100644
--- a/sc/source/ui/inc/csvgrid.hxx
+++ b/sc/source/ui/inc/csvgrid.hxx
@@ -21,20 +21,20 @@
 #define INCLUDED_SC_SOURCE_UI_INC_CSVGRID_HXX
 
 #include <vcl/menu.hxx>
+#include <vcl/virdev.hxx>
 #include <unotools/options.hxx>
 
 #include <vector>
 #include <memory>
 #include <scdllapi.h>
+#include <editutil.hxx>
 #include "csvcontrol.hxx"
 #include "csvsplits.hxx"
 
 namespace svtools { class ColorConfig; }
 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 5238d86f754a..fc7efc863d04 100644
--- a/sc/source/ui/inc/csvruler.hxx
+++ b/sc/source/ui/inc/csvruler.hxx
@@ -24,8 +24,9 @@
 #include "csvsplits.hxx"
 #include <scdllapi.h>
 
+#include <vcl/virdev.hxx>
+
 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/dpgroupdlg.hxx b/sc/source/ui/inc/dpgroupdlg.hxx
index a8e33b36fbe6..0c49b97605c6 100644
--- a/sc/source/ui/inc/dpgroupdlg.hxx
+++ b/sc/source/ui/inc/dpgroupdlg.hxx
@@ -20,14 +20,12 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_DPGROUPDLG_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_DPGROUPDLG_HXX
 
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/field.hxx>
 #include <vcl/weld.hxx>
-#include <svtools/ctrlbox.hxx>
-#include "editfield.hxx"
 #include <dpnumgroupinfo.hxx>
 
+class DoubleField;
+class SvtCalendarBox;
+
 class ScDPGroupEditHelper
 {
 public:
diff --git a/sc/source/ui/inc/drawsh.hxx b/sc/source/ui/inc/drawsh.hxx
index b25b6b6e9000..85e644a51640 100644
--- a/sc/source/ui/inc/drawsh.hxx
+++ b/sc/source/ui/inc/drawsh.hxx
@@ -33,6 +33,8 @@ class SdrMarkList;
 class SfxModule;
 class SdrObject;
 
+namespace weld { class Window; }
+
 namespace svx { namespace sidebar {
 class SelectionChangeHandler;
 } }
diff --git a/sc/source/ui/inc/notemark.hxx b/sc/source/ui/inc/notemark.hxx
index ee682ad55853..bb82f530a323 100644
--- a/sc/source/ui/inc/notemark.hxx
+++ b/sc/source/ui/inc/notemark.hxx
@@ -29,7 +29,6 @@
 namespace vcl { class Window; }
 
 class SdrModel;
-class ScDrawView;
 class SdrCaptionObj;
 
 class ScNoteMarker
diff --git a/sc/source/ui/inc/protectiondlg.hxx b/sc/source/ui/inc/protectiondlg.hxx
index e0dd803e3f61..ff3a41f4d797 100644
--- a/sc/source/ui/inc/protectiondlg.hxx
+++ b/sc/source/ui/inc/protectiondlg.hxx
@@ -23,7 +23,6 @@
 #include <vcl/weld.hxx>
 #include <scdllapi.h>
 
-namespace vcl { class Window; }
 class ScTableProtection;
 
 class ScTableProtectionDlg : public weld::GenericDialogController
diff --git a/sc/source/ui/inc/scuiimoptdlg.hxx b/sc/source/ui/inc/scuiimoptdlg.hxx
index 8d9699c20375..fff65114ec98 100644
--- a/sc/source/ui/inc/scuiimoptdlg.hxx
+++ b/sc/source/ui/inc/scuiimoptdlg.hxx
@@ -21,10 +21,11 @@
 #define INCLUDED_SC_SOURCE_UI_INC_SCUIIMOPTDLG_HXX
 
 #include <vcl/weld.hxx>
-#include <svx/txencbox.hxx>
 
 class ScDelimiterTable;
 class ScImportOptions;
+class TextEncodingBox;
+class TextEncodingTreeView;
 
 class ScImportOptionsDlg : public weld::GenericDialogController
 {
diff --git a/sc/source/ui/inc/searchresults.hxx b/sc/source/ui/inc/searchresults.hxx
index 843cb980f05e..74acb8413bff 100644
--- a/sc/source/ui/inc/searchresults.hxx
+++ b/sc/source/ui/inc/searchresults.hxx
@@ -12,10 +12,10 @@
 
 #include <vcl/dialog.hxx>
 #include <sfx2/childwin.hxx>
+#include <svtools/simptabl.hxx>
 
 class ScDocument;
 class ScRangeList;
-class SvSimpleTable;
 class SvTreeListBox;
 
 namespace sc {
diff --git a/sc/source/ui/inc/textimportoptions.hxx b/sc/source/ui/inc/textimportoptions.hxx
index 9c01e895a6cc..2e8320e6e1c7 100644
--- a/sc/source/ui/inc/textimportoptions.hxx
+++ b/sc/source/ui/inc/textimportoptions.hxx
@@ -22,7 +22,8 @@
 
 #include <vcl/weld.hxx>
 #include <i18nlangtag/lang.h>
-#include <svx/langbox.hxx>
+
+class LanguageBox;
 
 class ScTextImportOptionsDlg : public weld::GenericDialogController
 {


More information about the Libreoffice-commits mailing list