summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorGabor Kelemen <kelemen.gabor2@nisz.hu>2020-01-15 22:52:44 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-01-21 13:52:11 +0100
commit1eaa1e2adeb50bb14d550e70fb77edfd2da11807 (patch)
tree1cc607ecb3ced0a3d28dd244aa84693171d0b638 /sfx2
parent46c0dbea12bd8329aa37ca5503db12b4162ef6c6 (diff)
tdf#42949 Fix IWYU warnings in sfx2/source/[s-v]*/*cxx and sfx2/qa
Also quickly recheck other parts of sfx2 after recent welding there Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Iff847f142557b5b253887add12c005821554ef65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86891 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/IwyuFilter_sfx2.yaml31
-rw-r--r--sfx2/qa/cppunit/test_controlleritem.cxx1
-rw-r--r--sfx2/qa/cppunit/test_metadatable.cxx4
-rw-r--r--sfx2/qa/cppunit/test_misc.cxx1
-rw-r--r--sfx2/qa/unit/sfx2-dialogs-test.cxx3
-rw-r--r--sfx2/source/control/charmapcontrol.cxx1
-rw-r--r--sfx2/source/control/charwin.cxx3
-rw-r--r--sfx2/source/control/recentdocsviewitem.cxx1
-rw-r--r--sfx2/source/dialog/charmappopup.cxx1
-rw-r--r--sfx2/source/sidebar/ControlFactory.cxx2
-rw-r--r--sfx2/source/sidebar/ControllerItem.cxx9
-rw-r--r--sfx2/source/sidebar/Deck.cxx2
-rw-r--r--sfx2/source/sidebar/DeckTitleBar.cxx1
-rw-r--r--sfx2/source/sidebar/DrawHelper.cxx1
-rw-r--r--sfx2/source/sidebar/FocusManager.cxx3
-rw-r--r--sfx2/source/sidebar/MenuButton.cxx2
-rw-r--r--sfx2/source/sidebar/Panel.cxx3
-rw-r--r--sfx2/source/sidebar/PanelTitleBar.cxx2
-rw-r--r--sfx2/source/sidebar/ResourceManager.cxx1
-rw-r--r--sfx2/source/sidebar/SidebarChildWindow.cxx1
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx5
-rw-r--r--sfx2/source/sidebar/SidebarDockingWindow.cxx1
-rw-r--r--sfx2/source/sidebar/SidebarPanelBase.cxx1
-rw-r--r--sfx2/source/sidebar/SidebarToolBox.cxx1
-rw-r--r--sfx2/source/sidebar/TabBar.cxx6
-rw-r--r--sfx2/source/sidebar/TabItem.cxx1
-rw-r--r--sfx2/source/sidebar/Theme.cxx1
-rw-r--r--sfx2/source/sidebar/TitleBar.cxx5
-rw-r--r--sfx2/source/sidebar/Tools.cxx2
-rw-r--r--sfx2/source/sidebar/UnoPanels.cxx1
-rw-r--r--sfx2/source/sidebar/UnoSidebar.cxx1
-rw-r--r--sfx2/source/statbar/stbitem.cxx3
-rw-r--r--sfx2/source/toolbox/tbxitem.cxx26
-rw-r--r--sfx2/source/toolbox/weldutils.cxx1
-rw-r--r--sfx2/source/view/classificationcontroller.cxx2
-rw-r--r--sfx2/source/view/classificationhelper.cxx2
-rw-r--r--sfx2/source/view/frame.cxx20
-rw-r--r--sfx2/source/view/frame2.cxx12
-rw-r--r--sfx2/source/view/frmload.cxx15
-rw-r--r--sfx2/source/view/ipclient.cxx11
-rw-r--r--sfx2/source/view/lokcharthelper.cxx4
-rw-r--r--sfx2/source/view/lokhelper.cxx3
-rw-r--r--sfx2/source/view/printer.cxx7
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx12
-rw-r--r--sfx2/source/view/userinputinterception.cxx7
-rw-r--r--sfx2/source/view/viewfac.cxx2
-rw-r--r--sfx2/source/view/viewfrm.cxx18
-rw-r--r--sfx2/source/view/viewfrm2.cxx6
-rw-r--r--sfx2/source/view/viewprn.cxx2
-rw-r--r--sfx2/source/view/viewsh.cxx14
50 files changed, 46 insertions, 219 deletions
diff --git a/sfx2/IwyuFilter_sfx2.yaml b/sfx2/IwyuFilter_sfx2.yaml
index 0c07246d9a86..90f5378813eb 100644
--- a/sfx2/IwyuFilter_sfx2.yaml
+++ b/sfx2/IwyuFilter_sfx2.yaml
@@ -95,3 +95,34 @@ blacklist:
sfx2/source/doc/sfxbasemodel.cxx:
# Don't propose hxx -> h change in URE libs
- cppuhelper/interfacecontainer.hxx
+ sfx2/source/sidebar/ControllerFactory.cxx:
+ # Actually used
+ - com/sun/star/frame/XFrame.hpp
+ # Needed for instantiation of function template specialization
+ - com/sun/star/lang/XMultiServiceFactory.hpp
+ sfx2/source/sidebar/Panel.cxx:
+ # Actually used
+ - com/sun/star/ui/XUIElement.hpp
+ sfx2/source/sidebar/SidebarToolBox.cxx:
+ # Actually used
+ - com/sun/star/frame/XFrame.hpp
+ - com/sun/star/frame/XToolbarController.hpp
+ sfx2/source/sidebar/SidebarController.cxx:
+ # Actually used
+ - com/sun/star/awt/XWindowPeer.hpp
+ - com/sun/star/frame/XDispatch.hpp
+ - com/sun/star/ui/ContextChangeEventObject.hpp
+ sfx2/source/view/viewfrm2.cxx:
+ # Neede for direct member access
+ - com/sun/star/embed/VerbDescriptor.hpp
+ sfx2/source/view/classificationhelper.cxx:
+ # Actually used
+ - com/sun/star/beans/XPropertyContainer.hpp
+ - com/sun/star/document/XDocumentProperties.hpp
+ sfx2/source/view/userinputinterception.cxx:
+ # Actually used
+ - com/sun/star/awt/XKeyHandler.hpp
+ - com/sun/star/awt/XMouseClickHandler.hpp
+ sfx2/source/view/viewsh.cxx:
+ # Needed for TypedWhichId define
+ - svl/eitem.hxx
diff --git a/sfx2/qa/cppunit/test_controlleritem.cxx b/sfx2/qa/cppunit/test_controlleritem.cxx
index f32d3ddfdbba..9576e7b192a5 100644
--- a/sfx2/qa/cppunit/test_controlleritem.cxx
+++ b/sfx2/qa/cppunit/test_controlleritem.cxx
@@ -14,7 +14,6 @@
#include <cppunit/plugin/TestPlugIn.h>
#include <sfx2/ctrlitem.hxx>
-#include <sfx2/bindings.hxx>
namespace {
diff --git a/sfx2/qa/cppunit/test_metadatable.cxx b/sfx2/qa/cppunit/test_metadatable.cxx
index 5073f87202b7..5d3d71d5a23f 100644
--- a/sfx2/qa/cppunit/test_metadatable.cxx
+++ b/sfx2/qa/cppunit/test_metadatable.cxx
@@ -23,11 +23,7 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/plugin/TestPlugIn.h>
-#include <rtl/ustrbuf.hxx>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#include <com/sun/star/util/DateTime.hpp>
-#include <com/sun/star/util/Date.hpp>
-#include <com/sun/star/util/Duration.hpp>
#include <sfx2/Metadatable.hxx>
#include <sfx2/XmlIdRegistry.hxx>
diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index 768a017f03ac..587cec0047fe 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -16,7 +16,6 @@
#include <memory>
#include <cppunit/TestAssert.h>
-#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/plugin/TestPlugIn.h>
diff --git a/sfx2/qa/unit/sfx2-dialogs-test.cxx b/sfx2/qa/unit/sfx2-dialogs-test.cxx
index b702161e6c6a..239da477fa6d 100644
--- a/sfx2/qa/unit/sfx2-dialogs-test.cxx
+++ b/sfx2/qa/unit/sfx2-dialogs-test.cxx
@@ -9,9 +9,6 @@
#include <sal/config.h>
#include <test/screenshot_test.hxx>
-#include <rtl/strbuf.hxx>
-#include <osl/file.hxx>
-#include <sfx2/app.hxx>
#include <vcl/abstdlg.hxx>
using namespace ::com::sun::star;
diff --git a/sfx2/source/control/charmapcontrol.cxx b/sfx2/source/control/charmapcontrol.cxx
index 152aa78c8ad2..f4fff6f14a52 100644
--- a/sfx2/source/control/charmapcontrol.cxx
+++ b/sfx2/source/control/charmapcontrol.cxx
@@ -22,7 +22,6 @@
#include <sfx2/charmapcontrol.hxx>
#include <sfx2/charmappopup.hxx>
#include <sfx2/viewfrm.hxx>
-#include <vcl/event.hxx>
using namespace css;
diff --git a/sfx2/source/control/charwin.cxx b/sfx2/source/control/charwin.cxx
index 3c2e72317db3..c054880ed2c7 100644
--- a/sfx2/source/control/charwin.cxx
+++ b/sfx2/source/control/charwin.cxx
@@ -24,9 +24,6 @@
#include <sfx2/charwin.hxx>
#include <comphelper/dispatchcommand.hxx>
#include <comphelper/processfactory.hxx>
-#include <sfx2/sfxresid.hxx>
-#include <sfx2/strings.hrc>
-#include <sfx2/viewfrm.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx
index 85d84ddc699d..42af6f7527e9 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -11,7 +11,6 @@
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
-#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <drawinglayer/primitive2d/discretebitmapprimitive2d.hxx>
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <i18nutil/paper.hxx>
diff --git a/sfx2/source/dialog/charmappopup.cxx b/sfx2/source/dialog/charmappopup.cxx
index 7831d49db35d..7d01a5a661c4 100644
--- a/sfx2/source/dialog/charmappopup.cxx
+++ b/sfx2/source/dialog/charmappopup.cxx
@@ -19,7 +19,6 @@
#include <sfx2/charmappopup.hxx>
#include <sfx2/charmapcontrol.hxx>
#include <vcl/toolbox.hxx>
-#include <vcl/weld.hxx>
CharmapPopup::CharmapPopup(const css::uno::Reference<css::uno::XComponentContext>& rContext)
: PopupWindowController(rContext, nullptr, OUString())
diff --git a/sfx2/source/sidebar/ControlFactory.cxx b/sfx2/source/sidebar/ControlFactory.cxx
index 96bd62aefc2d..317f552fe438 100644
--- a/sfx2/source/sidebar/ControlFactory.cxx
+++ b/sfx2/source/sidebar/ControlFactory.cxx
@@ -20,8 +20,6 @@
#include <sfx2/sidebar/MenuButton.hxx>
#include <sfx2/sidebar/TabItem.hxx>
-#include <sfx2/sidebar/SidebarToolBox.hxx>
-#include <vcl/toolbox.hxx>
namespace sfx2 { namespace sidebar {
diff --git a/sfx2/source/sidebar/ControllerItem.cxx b/sfx2/source/sidebar/ControllerItem.cxx
index 088677115893..11698a1c264f 100644
--- a/sfx2/source/sidebar/ControllerItem.cxx
+++ b/sfx2/source/sidebar/ControllerItem.cxx
@@ -19,16 +19,9 @@
#include <memory>
#include <sfx2/sidebar/ControllerItem.hxx>
-#include <sfx2/msgpool.hxx>
-#include <sfx2/viewsh.hxx>
#include <sfx2/bindings.hxx>
-#include <unotools/cmdoptions.hxx>
-#include <vcl/commandinfoprovider.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/toolbox.hxx>
-#include <vcl/help.hxx>
-#include <cppuhelper/compbase.hxx>
+#include <com/sun/star/lang/XComponent.hpp>
using namespace css;
using namespace css::uno;
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 1f23749e3d4a..520a39418a91 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -25,9 +25,7 @@
#include <sfx2/sidebar/PanelTitleBar.hxx>
#include <sfx2/sidebar/Paint.hxx>
#include <sfx2/sidebar/Panel.hxx>
-#include <sfx2/sidebar/Tools.hxx>
#include <sfx2/sidebar/Theme.hxx>
-#include <sfx2/viewsh.hxx>
#include <sfx2/lokhelper.hxx>
#include <vcl/event.hxx>
diff --git a/sfx2/source/sidebar/DeckTitleBar.cxx b/sfx2/source/sidebar/DeckTitleBar.cxx
index 95e11dded6e3..a3bad46ff40b 100644
--- a/sfx2/source/sidebar/DeckTitleBar.cxx
+++ b/sfx2/source/sidebar/DeckTitleBar.cxx
@@ -18,7 +18,6 @@
*/
#include <sfx2/sidebar/DeckTitleBar.hxx>
-#include <sfx2/sidebar/SidebarDockingWindow.hxx>
#include <sfx2/sidebar/Theme.hxx>
#include <sfx2/sfxresid.hxx>
#include <sfx2/strings.hrc>
diff --git a/sfx2/source/sidebar/DrawHelper.cxx b/sfx2/source/sidebar/DrawHelper.cxx
index 70c04b6b9bf0..17c352a3d76c 100644
--- a/sfx2/source/sidebar/DrawHelper.cxx
+++ b/sfx2/source/sidebar/DrawHelper.cxx
@@ -20,7 +20,6 @@
#include <sfx2/sidebar/DrawHelper.hxx>
#include <sfx2/sidebar/Paint.hxx>
-#include <vcl/lineinfo.hxx>
#include <tools/svborder.hxx>
namespace sfx2 { namespace sidebar {
diff --git a/sfx2/source/sidebar/FocusManager.cxx b/sfx2/source/sidebar/FocusManager.cxx
index d924cdad47cf..2b478e918d89 100644
--- a/sfx2/source/sidebar/FocusManager.cxx
+++ b/sfx2/source/sidebar/FocusManager.cxx
@@ -21,7 +21,6 @@
#include <sfx2/sidebar/Panel.hxx>
#include <sfx2/sidebar/DeckTitleBar.hxx>
#include <sfx2/sidebar/PanelTitleBar.hxx>
-#include <sfx2/sidebar/Tools.hxx>
#include <sfx2/sidebar/TitleBar.hxx>
#include <vcl/button.hxx>
#include <vcl/event.hxx>
@@ -29,8 +28,6 @@
#include <vcl/svapp.hxx>
#include <toolkit/helper/vclunohelper.hxx>
-#include <sfx2/app.hxx>
-
namespace sfx2 { namespace sidebar {
FocusManager::FocusLocation::FocusLocation (const PanelComponent eComponent, const sal_Int32 nIndex)
diff --git a/sfx2/source/sidebar/MenuButton.cxx b/sfx2/source/sidebar/MenuButton.cxx
index b42e904e5000..7b5b7bedd677 100644
--- a/sfx2/source/sidebar/MenuButton.cxx
+++ b/sfx2/source/sidebar/MenuButton.cxx
@@ -20,8 +20,6 @@
#include <sfx2/sidebar/MenuButton.hxx>
#include <sfx2/sidebar/DrawHelper.hxx>
-#include <sfx2/sidebar/Paint.hxx>
-#include <sfx2/sidebar/Tools.hxx>
#include <sfx2/sidebar/Theme.hxx>
#include <vcl/event.hxx>
diff --git a/sfx2/source/sidebar/Panel.cxx b/sfx2/source/sidebar/Panel.cxx
index 12caa0807c1d..d83f2d16af04 100644
--- a/sfx2/source/sidebar/Panel.cxx
+++ b/sfx2/source/sidebar/Panel.cxx
@@ -32,9 +32,6 @@
#include <sfx2/sidebar/Deck.hxx>
#endif
-#include <tools/svborder.hxx>
-
-#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/ui/XToolPanel.hpp>
#include <com/sun/star/ui/XSidebarPanel.hpp>
diff --git a/sfx2/source/sidebar/PanelTitleBar.cxx b/sfx2/source/sidebar/PanelTitleBar.cxx
index 4c3eca532164..5b3a3d63dbf2 100644
--- a/sfx2/source/sidebar/PanelTitleBar.cxx
+++ b/sfx2/source/sidebar/PanelTitleBar.cxx
@@ -25,9 +25,7 @@
#include <sfx2/sidebar/Theme.hxx>
#include <sfx2/sidebar/ControllerFactory.hxx>
#include <sfx2/sidebar/Tools.hxx>
-#include <tools/svborder.hxx>
#include <vcl/event.hxx>
-#include <vcl/gradient.hxx>
#include <vcl/image.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/diagnose_ex.h>
diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx
index e1e011422da7..aa1422dffef3 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -30,7 +30,6 @@
#include <comphelper/sequence.hxx>
#include <comphelper/types.hxx>
-#include <rtl/ustrbuf.hxx>
#include <tools/diagnose_ex.h>
#include <sal/log.hxx>
#include <vcl/EnumContext.hxx>
diff --git a/sfx2/source/sidebar/SidebarChildWindow.cxx b/sfx2/source/sidebar/SidebarChildWindow.cxx
index 99f30bed1fef..14078245e0ef 100644
--- a/sfx2/source/sidebar/SidebarChildWindow.cxx
+++ b/sfx2/source/sidebar/SidebarChildWindow.cxx
@@ -23,7 +23,6 @@
#include <sfx2/sidebar/SidebarDockingWindow.hxx>
#include <sfx2/sfxsids.hrc>
#include <helpids.h>
-#include <sfx2/dockwin.hxx>
#include <comphelper/lok.hxx>
namespace sfx2 { namespace sidebar {
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index da772fa9b4eb..bc33163c64f8 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -29,13 +29,10 @@
#include <sfx2/sidebar/Tools.hxx>
#include <sfx2/sidebar/SidebarDockingWindow.hxx>
#include <sfx2/sidebar/Context.hxx>
-#include <sfx2/sidebar/ContextList.hxx>
#include <sfx2/lokhelper.hxx>
#include <sfx2/sfxresid.hxx>
-#include <sfx2/sfxsids.hrc>
-#include <sfx2/titledockwin.hxx>
#include <sfx2/strings.hrc>
#include <framework/ContextChangeEventMultiplexerTunnel.hxx>
#include <vcl/floatwin.hxx>
@@ -58,11 +55,9 @@
#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/ui/ContextChangeEventMultiplexer.hpp>
#include <com/sun/star/ui/ContextChangeEventObject.hpp>
#include <com/sun/star/ui/theUIElementFactoryManager.hpp>
-#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/util/URL.hpp>
#include <com/sun/star/rendering/XSpriteCanvas.hpp>
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index 36796ef5f448..e8172495ffed 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -27,7 +27,6 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
#include <svtools/acceleratorexecute.hxx>
-#include <tools/link.hxx>
#include <tools/gen.hxx>
#include <vcl/event.hxx>
#include <comphelper/lok.hxx>
diff --git a/sfx2/source/sidebar/SidebarPanelBase.cxx b/sfx2/source/sidebar/SidebarPanelBase.cxx
index 0906dc962d57..0321b9bca3e5 100644
--- a/sfx2/source/sidebar/SidebarPanelBase.cxx
+++ b/sfx2/source/sidebar/SidebarPanelBase.cxx
@@ -21,7 +21,6 @@
#include <sfx2/sidebar/ILayoutableWindow.hxx>
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
#include <sfx2/sidebar/SidebarModelUpdate.hxx>
-#include <vcl/ctrl.hxx>
#include <vcl/layout.hxx>
#include <comphelper/processfactory.hxx>
diff --git a/sfx2/source/sidebar/SidebarToolBox.cxx b/sfx2/source/sidebar/SidebarToolBox.cxx
index 8acd83f0aae0..03f66a98c0f8 100644
--- a/sfx2/source/sidebar/SidebarToolBox.cxx
+++ b/sfx2/source/sidebar/SidebarToolBox.cxx
@@ -21,7 +21,6 @@
#include <sfx2/sidebar/ControllerFactory.hxx>
#include <sfx2/viewfrm.hxx>
-#include <vcl/builderfactory.hxx>
#include <vcl/commandinfoprovider.hxx>
#include <vcl/event.hxx>
#include <vcl/settings.hxx>
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index 4cc79c8bcd4c..023233ff3d22 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -18,7 +18,6 @@
*/
#include <sfx2/sidebar/TabBar.hxx>
-#include <sfx2/sidebar/TabItem.hxx>
#include <sfx2/sidebar/ControlFactory.hxx>
#include <sfx2/sidebar/DeckDescriptor.hxx>
#include <sfx2/sidebar/Paint.hxx>
@@ -33,16 +32,11 @@
#include <comphelper/processfactory.hxx>
#include <vcl/commandevent.hxx>
#include <vcl/event.hxx>
-#include <vcl/gradient.hxx>
#include <vcl/image.hxx>
#include <vcl/svapp.hxx>
#include <tools/svborder.hxx>
#include <svtools/acceleratorexecute.hxx>
-#include <com/sun/star/graphic/XGraphicProvider.hpp>
-
-#include <sfx2/app.hxx>
-
using namespace css;
using namespace css::uno;
diff --git a/sfx2/source/sidebar/TabItem.cxx b/sfx2/source/sidebar/TabItem.cxx
index 92743e178b7b..d2535b583acf 100644
--- a/sfx2/source/sidebar/TabItem.cxx
+++ b/sfx2/source/sidebar/TabItem.cxx
@@ -21,7 +21,6 @@
#include <sfx2/sidebar/DrawHelper.hxx>
#include <sfx2/sidebar/Paint.hxx>
-#include <sfx2/sidebar/Tools.hxx>
#include <sfx2/sidebar/Theme.hxx>
#include <vcl/event.hxx>
diff --git a/sfx2/source/sidebar/Theme.cxx b/sfx2/source/sidebar/Theme.cxx
index 90ab20e46f15..9f5b067d9f8e 100644
--- a/sfx2/source/sidebar/Theme.cxx
+++ b/sfx2/source/sidebar/Theme.cxx
@@ -22,7 +22,6 @@
#include <sfx2/sidebar/Tools.hxx>
#include <sfx2/app.hxx>
-#include <tools/svborder.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <tools/diagnose_ex.h>
diff --git a/sfx2/source/sidebar/TitleBar.cxx b/sfx2/source/sidebar/TitleBar.cxx
index 8f45bb751c0c..df58d0d346ff 100644
--- a/sfx2/source/sidebar/TitleBar.cxx
+++ b/sfx2/source/sidebar/TitleBar.cxx
@@ -19,13 +19,8 @@
#include <sfx2/sidebar/TitleBar.hxx>
#include <sfx2/sidebar/Paint.hxx>
-#include <sfx2/sidebar/Accessible.hxx>
#include <sfx2/sidebar/AccessibleTitleBar.hxx>
-#include <tools/svborder.hxx>
-#include <vcl/gradient.hxx>
-#include <vcl/lineinfo.hxx>
-
#include <com/sun/star/accessibility/AccessibleRole.hpp>
namespace
diff --git a/sfx2/source/sidebar/Tools.cxx b/sfx2/source/sidebar/Tools.cxx
index cebfc93013d9..191b9b047035 100644
--- a/sfx2/source/sidebar/Tools.cxx
+++ b/sfx2/source/sidebar/Tools.cxx
@@ -29,8 +29,6 @@
#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
-#include <cstring>
-
using namespace css;
using namespace css::uno;
diff --git a/sfx2/source/sidebar/UnoPanels.cxx b/sfx2/source/sidebar/UnoPanels.cxx
index a8c1f41a691e..07d3c2455e4b 100644
--- a/sfx2/source/sidebar/UnoPanels.cxx
+++ b/sfx2/source/sidebar/UnoPanels.cxx
@@ -13,7 +13,6 @@
#include <sfx2/sidebar/ResourceManager.hxx>
#include <sfx2/sidebar/SidebarController.hxx>
-#include <sfx2/sidebar/UnoDecks.hxx>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <com/sun/star/ui/XPanel.hpp>
#include <sfx2/sidebar/UnoPanel.hxx>
diff --git a/sfx2/source/sidebar/UnoSidebar.cxx b/sfx2/source/sidebar/UnoSidebar.cxx
index 20b3ed6cc6f8..812fe9c877ea 100644
--- a/sfx2/source/sidebar/UnoSidebar.cxx
+++ b/sfx2/source/sidebar/UnoSidebar.cxx
@@ -11,7 +11,6 @@
#include <sfx2/sidebar/UnoSidebar.hxx>
#include <sfx2/sidebar/Tools.hxx>
-#include <sfx2/sidebar/ResourceManager.hxx>
#include <sfx2/sidebar/SidebarController.hxx>
#include <sfx2/sidebar/UnoDecks.hxx>
diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx
index 5559034e0259..45590eeb72bc 100644
--- a/sfx2/source/statbar/stbitem.cxx
+++ b/sfx2/source/statbar/stbitem.cxx
@@ -25,7 +25,6 @@
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/frame/status/ItemStatus.hpp>
-#include <com/sun/star/frame/status/ItemState.hpp>
#include <com/sun/star/awt/MouseButton.hpp>
#include <vcl/commandevent.hxx>
@@ -35,9 +34,7 @@
#include <sfx2/app.hxx>
#include <sfx2/stbitem.hxx>
-#include <sfxtypes.hxx>
#include <sfx2/msg.hxx>
-#include <sfx2/bindings.hxx>
#include <sfx2/msgpool.hxx>
#include <sfx2/module.hxx>
#include <sfx2/dispatch.hxx>
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index 28813ad2f04b..d362cc9d37c9 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -22,65 +22,41 @@
#include <ctime>
#endif
-#include <string>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/awt/XPopupMenu.hpp>
#include <com/sun/star/awt/XWindow.hpp>
-#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/util/URL.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <com/sun/star/document/MacroExecMode.hpp>
-#include <com/sun/star/document/UpdateDocMode.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/status/ItemStatus.hpp>
#include <com/sun/star/ui/XUIElementFactory.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/ui/XUIFunctionListener.hpp>
-#include <com/sun/star/ui/theUIElementFactoryManager.hpp>
#include <com/sun/star/frame/status/Visibility.hpp>
#include <svl/eitem.hxx>
#include <svl/stritem.hxx>
#include <svl/intitem.hxx>
-#include <svl/imageitm.hxx>
#include <svl/visitem.hxx>
-#include <svl/urlbmk.hxx>
#include <vcl/svapp.hxx>
#include <vcl/toolbox.hxx>
-#include <unotools/moduleoptions.hxx>
-#include <svtools/imagemgr.hxx>
#include <svtools/framestatuslistener.hxx>
#include <comphelper/processfactory.hxx>
-#include <framework/addonmenu.hxx>
-#include <framework/addonsoptions.hxx>
-#include <framework/menuconfiguration.hxx>
-#include <framework/sfxhelperfunctions.hxx>
#include <vcl/taskpanelist.hxx>
#include <vcl/event.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/globname.hxx>
-#include <svtools/menuoptions.hxx>
-#include <svtools/miscopt.hxx>
#include <sfx2/tbxctrl.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/msg.hxx>
#include <sfx2/msgpool.hxx>
-#include <statcach.hxx>
#include <sfx2/viewfrm.hxx>
-#include <sfxtypes.hxx>
#include <sfx2/module.hxx>
-#include <sfx2/docfile.hxx>
-#include <sfx2/docfac.hxx>
-#include <sfx2/frmhtmlw.hxx>
#include <sfx2/app.hxx>
#include <sfx2/unoctitm.hxx>
-#include <workwin.hxx>
#include <ctrlfactoryimpl.hxx>
using namespace ::com::sun::star;
diff --git a/sfx2/source/toolbox/weldutils.cxx b/sfx2/source/toolbox/weldutils.cxx
index 327373d45819..281b7594660a 100644
--- a/sfx2/source/toolbox/weldutils.cxx
+++ b/sfx2/source/toolbox/weldutils.cxx
@@ -8,7 +8,6 @@
*/
#include <com/sun/star/frame/XSubToolbarController.hpp>
-#include <comphelper/dispatchcommand.hxx>
#include <sfx2/sidebar/ControllerFactory.hxx>
#include <sfx2/weldutils.hxx>
#include <vcl/commandinfoprovider.hxx>
diff --git a/sfx2/source/view/classificationcontroller.cxx b/sfx2/source/view/classificationcontroller.cxx
index 4a61909fc4f8..54683695d908 100644
--- a/sfx2/source/view/classificationcontroller.cxx
+++ b/sfx2/source/view/classificationcontroller.cxx
@@ -22,8 +22,8 @@
#include <vcl/toolbox.hxx>
#include <vcl/fixed.hxx>
#include <vcl/event.hxx>
-#include <sfx2/viewfrm.hxx>
#include <sfx2/classificationhelper.hxx>
+#include <sfx2/objsh.hxx>
#include <sfx2/strings.hrc>
#include <sfx2/sfxresid.hxx>
#include <cppuhelper/supportsservice.hxx>
diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx
index 66d27a07375c..011ccba16dd8 100644
--- a/sfx2/source/view/classificationhelper.cxx
+++ b/sfx2/source/view/classificationhelper.cxx
@@ -25,7 +25,6 @@
#include <sal/log.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <sfx2/infobar.hxx>
-#include <sfx2/objsh.hxx>
#include <comphelper/processfactory.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/ucbstreamhelper.hxx>
@@ -41,7 +40,6 @@
#include <vcl/settings.hxx>
#include <vcl/weld.hxx>
#include <svl/fstathelper.hxx>
-#include <config_folders.h>
#include <officecfg/Office/Common.hxx>
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 2606de10e688..d96120fc6791 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -17,56 +17,40 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <com/sun/star/embed/EmbedStates.hpp>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/awt/XWindow.hpp>
-#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/util/CloseVetoException.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <vcl/menu.hxx>
#include <svl/intitem.hxx>
-#include <svl/eitem.hxx>
#include <svl/stritem.hxx>
#include <tools/globname.hxx>
#include <tools/svborder.hxx>
-#include <com/sun/star/awt/PosSize.hpp>
+#include <osl/diagnose.h>
#include <appdata.hxx>
#include <sfx2/app.hxx>
#include <sfx2/event.hxx>
-#include <sfx2/unoctitm.hxx>
#include <sfx2/frame.hxx>
-#include <arrdecl.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/frmdescr.hxx>
-#include <openflag.hxx>
#include <sfx2/sfxsids.hrc>
#include <sfx2/viewsh.hxx>
#include <sfx2/viewfrm.hxx>
-#include <sfx2/request.hxx>
-#include <sfx2/fcontnr.hxx>
#include "impframe.hxx"
#include <workwin.hxx>
-#include <sfx2/sfxuno.hxx>
-#include <sfx2/msgpool.hxx>
-#include <objshimp.hxx>
#include <sfx2/ipclient.hxx>
-#include <childwinimpl.hxx>
#include <vector>
-#ifdef DBG_UTIL
-#include <sfx2/frmhtmlw.hxx>
-#endif
-
using namespace com::sun::star;
static std::vector<SfxFrame*>* pFramesArr_Impl=nullptr;
diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx
index ba228e37e0d5..8dfb7f64985d 100644
--- a/sfx2/source/view/frame2.cxx
+++ b/sfx2/source/view/frame2.cxx
@@ -19,18 +19,11 @@
#include "impframe.hxx"
-#include <objshimp.hxx>
-#include <sfx2/sfxhelp.hxx>
#include <workwin.hxx>
-#include <sfx2/app.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
-#include <sfx2/docfac.hxx>
#include <sfx2/docfile.hxx>
-#include <sfx2/event.hxx>
-#include <sfx2/objface.hxx>
-#include <sfx2/request.hxx>
#include <sfx2/sfxsids.hrc>
#include <sfx2/sfxuno.hxx>
#include <sfx2/viewsh.hxx>
@@ -44,11 +37,6 @@
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/processfactory.hxx>
-#include <svl/eitem.hxx>
-#include <svl/intitem.hxx>
-#include <svl/itemset.hxx>
-#include <svl/rectitem.hxx>
-#include <svl/stritem.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/event.hxx>
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index d098ac5c00e2..82b438d8e7fa 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -18,12 +18,9 @@
*/
-#include <sal/macros.h>
-#include <objshimp.hxx>
#include <sfx2/app.hxx>
-#include <sfx2/dispatch.hxx>
+#include <sfx2/bindings.hxx>
#include <sfx2/docfac.hxx>
-#include <sfx2/docfile.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/doctempl.hxx>
#include <sfx2/fcontnr.hxx>
@@ -31,9 +28,6 @@
#include <sfx2/objsh.hxx>
#include <sfx2/request.hxx>
#include <sfx2/sfxsids.hrc>
-#include <sfx2/sfxuno.hxx>
-#include <sfx2/viewfrm.hxx>
-#include <sfx2/viewsh.hxx>
#include <sfx2/viewfac.hxx>
#include <com/sun/star/container/XContainerQuery.hpp>
@@ -59,17 +53,10 @@
#include <cppuhelper/supportsservice.hxx>
#include <framework/interaction.hxx>
#include <rtl/ref.hxx>
-#include <rtl/ustring.h>
#include <sal/log.hxx>
-#include <sot/storinfo.hxx>
-#include <svtools/ehdl.hxx>
#include <svl/eitem.hxx>
-#include <svl/itemset.hxx>
#include <unotools/moduleoptions.hxx>
-#include <svtools/sfxecode.hxx>
-#include <svl/stritem.hxx>
#include <tools/diagnose_ex.h>
-#include <ucbhelper/simpleinteractionrequest.hxx>
#include <vcl/svapp.hxx>
using namespace com::sun::star;
diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index e4f675d64a00..fe17638fe599 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -20,24 +20,19 @@
#include <com/sun/star/embed/Aspects.hpp>
#include <com/sun/star/embed/EmbedStates.hpp>
#include <com/sun/star/embed/UnreachableStateException.hpp>
-#include <com/sun/star/embed/XVisualObject.hpp>
#include <com/sun/star/embed/XEmbeddedClient.hpp>
#include <com/sun/star/embed/XInplaceClient.hpp>
#include <com/sun/star/embed/XInplaceObject.hpp>
-#include <com/sun/star/embed/XComponentSupplier.hpp>
#include <com/sun/star/embed/XWindowSupplier.hpp>
-#include <com/sun/star/embed/XEmbedPersist.hpp>
#include <com/sun/star/embed/EmbedVerbs.hpp>
#include <com/sun/star/embed/XEmbeddedOleObject.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
-#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/embed/XStateChangeListener.hpp>
#include <com/sun/star/embed/StateChangeInProgressException.hpp>
#include <com/sun/star/embed/XLinkageSupport.hpp>
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/task/ErrorCodeIOException.hpp>
#include <com/sun/star/task/StatusIndicatorFactory.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
@@ -50,29 +45,23 @@
#include <sfx2/viewsh.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/objsh.hxx>
-#include <sfx2/dispatch.hxx>
-#include <workwin.hxx>
#include <guisaveas.hxx>
#include <cppuhelper/implbase.hxx>
#include <svtools/ehdl.hxx>
-#include <sal/log.hxx>
#include <vcl/timer.hxx>
#include <vcl/window.hxx>
-#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <toolkit/helper/convert.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
#include <tools/fract.hxx>
#include <tools/gen.hxx>
-#include <svl/rectitem.hxx>
#include <svtools/soerr.hxx>
#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/exc_hlp.hxx>
-#include <sfx2/lokhelper.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#define SFX_CLIENTACTIVATE_TIMEOUT 100
diff --git a/sfx2/source/view/lokcharthelper.cxx b/sfx2/source/view/lokcharthelper.cxx
index 2622aba832cc..f0f12f1cab2e 100644
--- a/sfx2/source/view/lokcharthelper.cxx
+++ b/sfx2/source/view/lokcharthelper.cxx
@@ -16,13 +16,9 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/fract.hxx>
#include <tools/mapunit.hxx>
-#include <vcl/ITiledRenderable.hxx>
-#include <vcl/svapp.hxx>
#include <vcl/virdev.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
-#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 524d0b1768e3..c3a72154eddb 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -17,6 +17,7 @@
#include <vcl/commandevent.hxx>
#include <sal/log.hxx>
#include <sfx2/app.hxx>
+#include <sfx2/msg.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/request.hxx>
#include <sfx2/sfxsids.hrc>
@@ -24,8 +25,6 @@
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <comphelper/lok.hxx>
#include <editeng/outliner.hxx>
-#include <sfx2/bindings.hxx>
-#include <sfx2/objface.hxx>
#include <sfx2/msgpool.hxx>
#include <shellimpl.hxx>
diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx
index 1ec88004473d..4721ff052118 100644
--- a/sfx2/source/view/printer.cxx
+++ b/sfx2/source/view/printer.cxx
@@ -17,18 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <vcl/virdev.hxx>
-#include <vcl/metric.hxx>
-#include <unotools/printwarningoptions.hxx>
-#include <svtools/printoptions.hxx>
#include <tools/debug.hxx>
#include <utility>
-#include <vector>
#include <sfx2/printer.hxx>
-#include <sfx2/printopt.hxx>
-#include <sfxtypes.hxx>
#include <sfx2/prnmon.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/tabdlg.hxx>
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 305e5b5825eb..32150062aba9 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -20,10 +20,6 @@
#include <time.h>
#include <sfx2/sfxbasecontroller.hxx>
-#include <com/sun/star/awt/KeyEvent.hpp>
-#include <com/sun/star/awt/KeyModifier.hpp>
-#include <com/sun/star/awt/MouseEvent.hpp>
-#include <com/sun/star/awt/MouseButton.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/util/XCloseBroadcaster.hpp>
@@ -44,10 +40,7 @@
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
-#include <cppuhelper/interfacecontainer.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <basic/sbstar.hxx>
-#include <uno/mapping.hxx>
+#include <comphelper/interfacecontainer2.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/docfac.hxx>
#include <sfx2/viewfrm.hxx>
@@ -57,20 +50,17 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/userinputinterception.hxx>
-#include "viewimp.hxx"
#include <sfx2/unoctitm.hxx>
#include <sfx2/childwin.hxx>
#include <sfx2/sfxsids.hrc>
#include <sfx2/sfxresid.hxx>
#include <workwin.hxx>
-#include <sfx2/objface.hxx>
#include <sfx2/infobar.hxx>
#include <osl/mutex.hxx>
#include <tools/diagnose_ex.h>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/sequence.hxx>
-#include <rtl/ustrbuf.hxx>
#include <toolkit/helper/convert.hxx>
#include <framework/titlehelper.hxx>
#include <comphelper/processfactory.hxx>
diff --git a/sfx2/source/view/userinputinterception.cxx b/sfx2/source/view/userinputinterception.cxx
index 7be578aecca4..e507a16a9ff9 100644
--- a/sfx2/source/view/userinputinterception.cxx
+++ b/sfx2/source/view/userinputinterception.cxx
@@ -21,8 +21,13 @@
#include <sfx2/userinputinterception.hxx>
#include <com/sun/star/awt/MouseButton.hpp>
+#include <com/sun/star/awt/MouseEvent.hpp>
+#include <com/sun/star/awt/InputEvent.hpp>
+#include <com/sun/star/awt/KeyEvent.hpp>
#include <com/sun/star/awt/KeyModifier.hpp>
-#include <com/sun/star/awt/XUserInputInterception.hpp>
+#include <com/sun/star/awt/XKeyHandler.hpp>
+#include <com/sun/star/awt/XMouseClickHandler.hpp>
+#include <com/sun/star/uno/XInterface.hpp>
#include <comphelper/interfacecontainer2.hxx>
#include <cppuhelper/weak.hxx>
diff --git a/sfx2/source/view/viewfac.cxx b/sfx2/source/view/viewfac.cxx
index 61cadd48053f..b83f4184725e 100644
--- a/sfx2/source/view/viewfac.cxx
+++ b/sfx2/source/view/viewfac.cxx
@@ -17,11 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <sfx2/app.hxx>
#include <sfx2/viewfac.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/viewsh.hxx>
-#include <rtl/ustrbuf.hxx>
SfxViewShell *SfxViewFactory::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldSh )
{
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index b56c66f94036..6100c6dab509 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -41,14 +41,11 @@
#include <svl/visitem.hxx>
#include <svl/stritem.hxx>
#include <svl/eitem.hxx>
-#include <svl/slstitm.hxx>
#include <svl/whiter.hxx>
#include <svl/undo.hxx>
#include <vcl/stdtext.hxx>
#include <vcl/weld.hxx>
-#include <svtools/sfxecode.hxx>
#include <svtools/miscopt.hxx>
-#include <svtools/ehdl.hxx>
#include <tools/diagnose_ex.h>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/frame/XFramesSupplier.hpp>
@@ -64,8 +61,6 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/uri/UriReferenceFactory.hpp>
#include <com/sun/star/uri/XVndSunStarScriptUrl.hpp>
-#include <com/sun/star/embed/XStorage.hpp>
-#include <com/sun/star/embed/EmbedStates.hpp>
#include <com/sun/star/document/XViewDataSupplier.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/task/InteractionHandler.hpp>
@@ -80,14 +75,10 @@
#include <comphelper/docpasswordhelper.hxx>
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/ucb/XContent.hpp>
#include <basic/basmgr.hxx>
#include <basic/sbmod.hxx>
#include <basic/sbmeth.hxx>
-#include <basic/sbx.hxx>
-#include <svtools/asynclink.hxx>
-#include <svl/sharecontrolfile.hxx>
#include <svtools/strings.hrc>
#include <svtools/svtresid.hxx>
#include <framework/framelistanalyzer.hxx>
@@ -113,32 +104,23 @@ using ::com::sun::star::container::XIndexContainer;
#include <sfx2/objface.hxx>
#include <openflag.hxx>
#include <objshimp.hxx>
-#include <openuriexternally.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
-#include <arrdecl.hxx>
-#include <sfxtypes.hxx>
#include <sfx2/request.hxx>
#include <sfx2/docfac.hxx>
#include <sfx2/ipclient.hxx>
#include <sfx2/sfxresid.hxx>
-#include <sfx2/objitem.hxx>
#include <sfx2/viewfac.hxx>
#include <sfx2/event.hxx>
#include <sfx2/fcontnr.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/module.hxx>
-#include <sfx2/msgpool.hxx>
-#include "viewimp.hxx"
-#include <sfx2/sfxbasecontroller.hxx>
-#include <sfx2/frmdescr.hxx>
#include <sfx2/sfxuno.hxx>
#include <sfx2/progress.hxx>
#include <sfx2/sidebar/Sidebar.hxx>
#include <workwin.hxx>
-#include <helper.hxx>
#include <sfx2/minfitem.hxx>
#include <sfx2/strings.hrc>
#include "impviewframe.hxx"
diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx
index 8c29f0467a47..facdd8d5d9c4 100644
--- a/sfx2/source/view/viewfrm2.cxx
+++ b/sfx2/source/view/viewfrm2.cxx
@@ -20,7 +20,6 @@
#include "impviewframe.hxx"
#include <statcach.hxx>
-#include <sfx2/viewfac.hxx>
#include <workwin.hxx>
#include <sfx2/app.hxx>
@@ -40,12 +39,9 @@
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/embed/VerbDescriptor.hpp>
-#include <svtools/asynclink.hxx>
+#include <osl/diagnose.h>
#include <svl/eitem.hxx>
-#include <svl/intitem.hxx>
-#include <svl/rectitem.hxx>
#include <svl/stritem.hxx>
-#include <tools/diagnose_ex.h>
#include <tools/urlobj.hxx>
#include <vcl/window.hxx>
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 793ad0458e0b..339766ef53ab 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -30,7 +30,6 @@
#include <svtools/prnsetup.hxx>
#include <svl/flagitem.hxx>
#include <svl/stritem.hxx>
-#include <svl/intitem.hxx>
#include <svl/eitem.hxx>
#include <sfx2/app.hxx>
#include <unotools/useroptions.hxx>
@@ -46,7 +45,6 @@
#include <sfx2/sfxresid.hxx>
#include <sfx2/request.hxx>
#include <sfx2/objsh.hxx>
-#include <sfxtypes.hxx>
#include <sfx2/event.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/docfilt.hxx>
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 9e25fb002aea..10f149dff58a 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -28,8 +28,6 @@
#include <vcl/weld.hxx>
#include <svl/intitem.hxx>
#include <svtools/langhelp.hxx>
-#include <svtools/sfxecode.hxx>
-#include <svtools/ehdl.hxx>
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/io/IOException.hpp>
@@ -48,18 +46,12 @@
#include <com/sun/star/uno/Reference.hxx>
#include <cppuhelper/implbase.hxx>
-#include <osl/file.hxx>
#include <tools/diagnose_ex.h>
#include <tools/urlobj.hxx>
#include <unotools/tempfile.hxx>
-#include <unotools/pathoptions.hxx>
-#include <svtools/miscopt.hxx>
#include <svtools/soerr.hxx>
-#include <svtools/embedhlp.hxx>
#include <tools/svborder.hxx>
-#include <basic/basmgr.hxx>
-#include <basic/sbuno.hxx>
#include <framework/actiontriggerhelper.hxx>
#include <comphelper/lok.hxx>
#include <comphelper/namedvaluecollection.hxx>
@@ -77,24 +69,18 @@
#include "viewimp.hxx"
#include <sfx2/sfxresid.hxx>
#include <sfx2/request.hxx>
-#include <sfx2/templdlg.hxx>
#include <sfx2/printer.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/dispatch.hxx>
-#include <arrdecl.hxx>
-#include <sfx2/docfac.hxx>
#include <sfx2/strings.hrc>
#include <sfx2/sfxbasecontroller.hxx>
#include <sfx2/mailmodelapi.hxx>
#include <bluthsndapi.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/event.hxx>
-#include <sfx2/fcontnr.hxx>
#include <sfx2/ipclient.hxx>
#include <sfx2/sfxsids.hrc>
-#include <workwin.hxx>
#include <sfx2/objface.hxx>
-#include <sfx2/docfilt.hxx>
#include <sfx2/lokhelper.hxx>
#include <openuriexternally.hxx>
#include <shellimpl.hxx>