filter/source/svg/svgfilter.cxx | 1 offapi/UnoApi_offapi.mk | 1 offapi/com/sun/star/drawing/framework/XConfigurationController.idl | 244 ---------- sd/IwyuFilter_sd.yaml | 1 sd/inc/pch/precompiled_sd.hxx | 1 sd/inc/pch/precompiled_sdui.hxx | 1 sd/source/console/PresenterController.cxx | 3 sd/source/console/PresenterController.hxx | 5 sd/source/console/PresenterFrameworkObserver.cxx | 7 sd/source/console/PresenterFrameworkObserver.hxx | 10 sd/source/console/PresenterHelpView.cxx | 6 sd/source/console/PresenterNotesView.cxx | 4 sd/source/console/PresenterPaneFactory.cxx | 2 sd/source/console/PresenterPaneFactory.hxx | 1 sd/source/console/PresenterScreen.cxx | 2 sd/source/console/PresenterScreen.hxx | 3 sd/source/console/PresenterSlideShowView.cxx | 4 sd/source/console/PresenterSlideSorter.cxx | 5 sd/source/console/PresenterToolBar.cxx | 4 sd/source/console/PresenterViewFactory.cxx | 1 sd/source/console/PresenterViewFactory.hxx | 4 sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx | 2 sd/source/ui/framework/configuration/ConfigurationController.cxx | 22 sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx | 10 sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.hxx | 9 sd/source/ui/framework/configuration/ConfigurationUpdater.cxx | 4 sd/source/ui/framework/configuration/ResourceFactoryManager.cxx | 1 sd/source/ui/framework/factories/BasicPaneFactory.cxx | 2 sd/source/ui/framework/factories/BasicToolBarFactory.cxx | 13 sd/source/ui/framework/factories/BasicViewFactory.cxx | 1 sd/source/ui/framework/factories/PresentationFactory.cxx | 3 sd/source/ui/framework/module/CenterViewFocusModule.cxx | 4 sd/source/ui/framework/module/CenterViewFocusModule.hxx | 10 sd/source/ui/framework/module/NotesPaneModule.cxx | 3 sd/source/ui/framework/module/NotesPaneModule.hxx | 6 sd/source/ui/framework/module/ShellStackGuard.cxx | 2 sd/source/ui/framework/module/ShellStackGuard.hxx | 10 sd/source/ui/framework/module/SlideSorterModule.cxx | 13 sd/source/ui/framework/module/SlideSorterModule.hxx | 8 sd/source/ui/framework/module/ToolBarModule.cxx | 3 sd/source/ui/framework/module/ToolBarModule.hxx | 8 sd/source/ui/framework/module/ViewTabBarModule.cxx | 3 sd/source/ui/framework/module/ViewTabBarModule.hxx | 8 sd/source/ui/framework/tools/FrameworkHelper.cxx | 32 - sd/source/ui/inc/DrawController.hxx | 6 sd/source/ui/inc/ViewTabBar.hxx | 4 sd/source/ui/inc/framework/ConfigurationController.hxx | 57 +- sd/source/ui/inc/framework/FrameworkHelper.hxx | 7 sd/source/ui/inc/framework/factories/BasicToolBarFactory.hxx | 7 sd/source/ui/inc/framework/factories/BasicViewFactory.hxx | 5 sd/source/ui/slideshow/PaneHider.cxx | 2 sd/source/ui/slideshow/PaneHider.hxx | 8 sd/source/ui/tools/EventMultiplexer.cxx | 2 sd/source/ui/unoidl/DrawController.cxx | 10 sd/source/ui/view/ViewShellBase.cxx | 25 - sd/source/ui/view/ViewTabBar.cxx | 11 sd/source/ui/view/drviews3.cxx | 8 sd/source/ui/view/viewshel.cxx | 4 sd/workben/custompanel/ctp_panel.cxx | 3 sd/workben/custompanel/ctp_panel.hxx | 3 60 files changed, 181 insertions(+), 468 deletions(-)
New commits: commit 1c754934d58877a8f508aea0029820fd531b69a9 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Tue Jun 17 19:22:24 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Jun 18 19:17:52 2025 +0200 [API CHANGE] remove css::drawing::framework::XConfigurationController this is internal to sd, no need to use UNO here Change-Id: I7b1a68a45dc9e1a812e3f3724c08989021df29f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186648 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx index a65178295754..ef7a1a1e2953 100644 --- a/filter/source/svg/svgfilter.cxx +++ b/filter/source/svg/svgfilter.cxx @@ -32,7 +32,6 @@ #include <com/sun/star/io/IOException.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> #include <com/sun/star/drawing/XSlideSorterSelectionSupplier.hpp> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/drawing/framework/XConfiguration.hpp> #include <com/sun/star/drawing/framework/AnchorBindingMode.hpp> #include <com/sun/star/drawing/framework/XResourceId.hpp> diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index e9b5e89a42f0..9dd39f3ecb25 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -2397,7 +2397,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/drawing/framework,\ XConfiguration \ XConfigurationChangeListener \ XConfigurationChangeRequest \ - XConfigurationController \ XConfigurationControllerBroadcaster \ XConfigurationControllerRequestQueue \ XModuleController \ diff --git a/offapi/com/sun/star/drawing/framework/XConfigurationController.idl b/offapi/com/sun/star/drawing/framework/XConfigurationController.idl deleted file mode 100644 index b9b2b38f2b77..000000000000 --- a/offapi/com/sun/star/drawing/framework/XConfigurationController.idl +++ /dev/null @@ -1,244 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -module com { module sun { module star { module drawing { module framework { - -interface XConfigurationChangeListener; -interface XConfigurationChangeRequest; -interface XResourceId; -interface XResource; - -/** The configuration controller is responsible for the management of the - set of active resources. - - <p>There are two configurations of resources:<ul> - <li>The current configuration contains the set of currently active - resources.</li> - <li>The requested configuration describes what the current configuration - should be. The requested configuration is changed usually by calling - requestResourceActivation() and - requestResourceDeactivation().</li> - </ul></p> - - <p>When the two configurations differ then the current configuration is - updated eventually to reflect the requested configuration. An update - takes place when the following three conditions are fulfilled. - <ol> - <li>when the last pending request for configuration changes has been - processed,</li> - <li>when the update() method is called.</li> - <li>when the configuration manager it is unlocked after formerly being - locked.</li> - </ol></p> - - <p>Requests for configuration changes are handled in a two step process: - <ol> - <li>First the requested configuration is updated iteratively: Every - request that is being made by calling - requestResourceActivation() or - requestResourceDeactivation() results in one or more - function objects, that each implement the - XConfigurationChangeRequest interface. These are inserted - into a queue. The request objects in the queue are processed - asynchronously one at a time in the order in which they are inserted. - Only when one request object is processed a change to the requested - configuration is made. These changes are broadcasted to registered - XConfigurationChangeListener objects. Listeners may - decide to make requests that then are added to the queue. For example - when the view in the center pane is replaced by another view, some - listeners may want to turn some side panes on or off, or show other - views in the side panes.</p> - <p>This process goes on until the queue of request objects becomes - empty. Until this point only the requested configuration has been - modified. No resources have been activated or deactivated.</p></li> - - <li><p>The second update step activates or deactivates resources so that - the current configuration (the one that comprises the actually active - resources) reflects the requested configuration.</p> - <p>The order in which resources are activated or deactivated depends on - the dependency between the resources. For example a view depends on the - pane it is displayed in. Resources that other resources depend on are - activated first and deactivated last. The order is undefined for - unrelated resources.</p> - <p>Note that the second update step may not be able to activate (or even to - deactivate) all the requested resources. Either because they are - temporarily or permanently unavailable. For example, during the - start-up of a new Impress application the side panes are displayed - with a visible delay because they are not provided sooner by the - underlying framework. Such unavailable resources are not forgotten but - remain in the requested configuration. Every time the configuration - controller updates its current configuration these resources are - requested once more.</li></ol></p> - - <p>The configuration controller sends the following events: - <ul> - <li>ResourceActivationRequested is sent when the - activation of a resource has been requested and the resource is not yet - active in the requested configuration. The event is sent when the - configuration change request is executed, not when the - requestResourceActivation() call is made.</p> - <p>The ConfigurationChangeEvent::ResourceId member is set to the requested - resource. The ResourceObject member is not - set.</p></li> - <li>ResourceDeactivationRequested is sent when the - deactivation of a resource has been requested and the resource is active - in the requested configuration. The event is sent when the - configuration change request is executed that is created when for - example requestResourceDeactivation() is called.</p> - <p>The ResourceId member is set to the requested - resource. The ResourceObject member is not - set.</p></li> - <li>ConfigurationUpdateStart is sent before the update of - the current configuration starts.</p> - <p>The requested configuration is available in the - ConfigurationChangeEvent::Configuration member. The - ResourceId and ResourceObject members - are not set.</p></li> - <li>ConfigurationUpdateEnd is sent after the update of - the current configuration ends.</p> - <p>The requested configuration is - available in the ConfigurationChangeEvent::Configuration member. - The ResourceId and ResourceObject members are not set.</p></li> - <li>ResourceActivation is sent when a resource is - activated, i.e. when a new object of a resource is created (or taken - from a cache).</p> - <p>The ResourceId and ResourceObject - members are set to the XResourceId and object reference of - the activated resource.</p></li> - <li>ResourceDeactivation is sent when a resource is - deactivated, i.e. when an object that previously was part of the - configuration is removed from the configuration.</p> - <p>The ResourceId and ResourceObject - members are set to XResourceId and object reference of the - deactivated resource.</p></li> - </ul></p> -*/ -interface XConfigurationController -{ - interface XConfigurationControllerRequestQueue; - interface XConfigurationControllerBroadcaster; - interface XResourceFactoryManager; - - /** Request the activation of a resource. - <p>The request is processed asynchronously. Notifications about - configuration changes are sent after this call returns.</p> - @param xResourceId - The resource whose activation is requested. - @param eMode - <p>When eMode is REPLACE then, before adding the - resource activation to the request queue, similar resources - linked to the same anchor are removed. This makes it easier to - switch between resources whose activation is mutually exclusive. - For example, there can only be one view per pane, so before - activating a new view the old one has to be deactivated.</p> - <p>When eMode is ADD then the resource is requested - without further changes.</p> - */ - void requestResourceActivation ( - [in] XResourceId xResourceId, - [in] ResourceActivationMode eMode); - - /** Request the deactivation of a resource. - <p>The request is processed asynchronously. Notifications about - configuration changes are sent after this call returns.</p> - <p>Requesting the deactivation - of a resource that is not active is not an error.</p> - @param xResourceId - The resource whose deactivation is requested. - */ - void requestResourceDeactivation ( - [in] XResourceId xResourceId); - - - /** Return the active resource specified by the given resource id. - @param xResourceId - A valid resource id. This should, but does not have to be, the - resource id of an active resource. - @return - When the given resource id specifies an active resource then - that resource is returned. Otherwise an empty reference is - returned. - */ - XResource getResource ( - [in] XResourceId xResourceId); - - /** Lock the processing of configuration change requests. - <p>This is only necessary when more than one change request is being - made in a row. It prevents an update being made (with all the visible UI - changes) before all change requests are being made.</p> - <p>Recursive lock() calls are recognized: the - configuration controller is locked while lock() was - called more often than unlock().</p> - */ - void lock (); - - /** Unlock the processing of configuration change requests. - <p>When unlock() is called as many times as - lock() and the queue of configuration change - requests is not empty the configuration controller continues the - processing of the change requests. An update of the current - configuration will eventually being made.</p> - */ - void unlock (); - - /** Explicitly request an update of the current configuration. - <p>Call it when a resource is activated or deactivated - without the control and knowledge of the drawing framework. Calling - this method (from outside the drawing framework) should hardly every - be necessary.</p> - */ - void update (); - - /** Return a copy of the requested configuration. - <p>Modifications to the returned configuration have no effect on the - drawing framework.</p> - */ - XConfiguration getRequestedConfiguration (); - - /** Return a copy of the current configuration. - <p>Modifications to the returned configuration have no effect on the - drawing framework.</p> - */ - XConfiguration getCurrentConfiguration (); - - /** Replace the requested configuration with the given configuration and - schedule an update of the current configuration. - <p>Together with the getCurrentConfiguration() and - getRequestedConfiguration() methods this - allows the saving and restoring of configurations. However, the - given configuration can have other origins then these methods.</p> - <p>The given configuration is transformed into a list of change - requests so that the resulting requested configuration equals the - given configuration. This has the advantage that not only the - resource activations and deactivations but all configuration - changes are properly broadcasted.</p> - <p>Note that because of the configuration change notifications - listeners can make more configuration change requests, so that the - resulting requested configuration can be different from the given - configuration.</p> - @param xConfiguration - This typically is a configuration that was obtained with an - earlier getRequestedConfiguration() call. - */ - void restoreConfiguration ([in] XConfiguration xConfiguration); -}; - -}; }; }; }; }; // ::com::sun::star::drawing::framework - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/IwyuFilter_sd.yaml b/sd/IwyuFilter_sd.yaml index abf26c6534b1..a202e9ff9fa9 100644 --- a/sd/IwyuFilter_sd.yaml +++ b/sd/IwyuFilter_sd.yaml @@ -222,7 +222,6 @@ excludelist: - com/sun/star/lang/XServiceInfo.hpp sd/source/ui/inc/framework/ConfigurationController.hxx: # base class has to be a complete type - - com/sun/star/drawing/framework/XConfigurationController.hpp - com/sun/star/lang/XInitialization.hpp sd/source/ui/inc/framework/DrawModule.hxx: # Needed for css shortcut diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx index d801d642767b..2756044d2073 100644 --- a/sd/inc/pch/precompiled_sd.hxx +++ b/sd/inc/pch/precompiled_sd.hxx @@ -206,7 +206,6 @@ #include <com/sun/star/drawing/XMasterPagesSupplier.hpp> #include <com/sun/star/drawing/framework/ResourceId.hpp> #include <com/sun/star/drawing/framework/XConfiguration.hpp> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/drawing/framework/XView.hpp> #include <com/sun/star/embed/Aspects.hpp> #include <com/sun/star/embed/ElementModes.hpp> diff --git a/sd/inc/pch/precompiled_sdui.hxx b/sd/inc/pch/precompiled_sdui.hxx index 19a512e5a070..0a08c9a737f1 100644 --- a/sd/inc/pch/precompiled_sdui.hxx +++ b/sd/inc/pch/precompiled_sdui.hxx @@ -256,7 +256,6 @@ #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> #include <com/sun/star/drawing/XLayerSupplier.hpp> #include <com/sun/star/drawing/XMasterPagesSupplier.hpp> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/embed/Aspects.hpp> #include <com/sun/star/embed/XStorage.hpp> #include <com/sun/star/embed/XVisualObject.hpp> diff --git a/sd/source/console/PresenterController.cxx b/sd/source/console/PresenterController.cxx index 764bea6ca778..ad590c2ef549 100644 --- a/sd/source/console/PresenterController.cxx +++ b/sd/source/console/PresenterController.cxx @@ -33,6 +33,7 @@ #include "PresenterViewFactory.hxx" #include "PresenterWindowManager.hxx" #include <DrawController.hxx> +#include <framework/ConfigurationController.hxx> #include <com/sun/star/awt/Key.hpp> #include <com/sun/star/awt/KeyModifier.hpp> @@ -743,7 +744,7 @@ void SAL_CALL PresenterController::disposing ( if (rEvent.Source.get() == static_cast<cppu::OWeakObject*>(mxController.get())) mxController = nullptr; - else if (rEvent.Source == mxConfigurationController) + else if (rEvent.Source == cppu::getXWeak(mxConfigurationController.get())) mxConfigurationController = nullptr; else if (rEvent.Source == mxSlideShowController) mxSlideShowController = nullptr; diff --git a/sd/source/console/PresenterController.hxx b/sd/source/console/PresenterController.hxx index ff3a6d95f775..f528ea469a2d 100644 --- a/sd/source/console/PresenterController.hxx +++ b/sd/source/console/PresenterController.hxx @@ -33,7 +33,6 @@ #include <com/sun/star/presentation/XSlideShowController.hpp> #include <com/sun/star/frame/XFrameActionListener.hpp> #include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/drawing/framework/XPane.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/util/XURLTransformer.hpp> @@ -43,6 +42,7 @@ #include <memory> namespace sd { class DrawController; } +namespace sd::framework { class ConfigurationController; } namespace sdext::presenter { @@ -176,8 +176,7 @@ private: css::uno::Reference<css::uno::XComponentContext> mxComponentContext; css::uno::Reference<css::rendering::XSpriteCanvas> mxCanvas; rtl::Reference<::sd::DrawController> mxController; - css::uno::Reference<css::drawing::framework::XConfigurationController> - mxConfigurationController; + rtl::Reference<::sd::framework::ConfigurationController> mxConfigurationController; css::uno::Reference<css::presentation::XSlideShowController> mxSlideShowController; css::uno::Reference<css::drawing::framework::XResourceId> mxMainPaneId; rtl::Reference<PresenterPaneContainer> mpPaneContainer; diff --git a/sd/source/console/PresenterFrameworkObserver.cxx b/sd/source/console/PresenterFrameworkObserver.cxx index d2d18682e756..55e1c2548427 100644 --- a/sd/source/console/PresenterFrameworkObserver.cxx +++ b/sd/source/console/PresenterFrameworkObserver.cxx @@ -18,6 +18,7 @@ */ #include "PresenterFrameworkObserver.hxx" +#include <framework/ConfigurationController.hxx> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <utility> @@ -29,7 +30,7 @@ using namespace ::com::sun::star::drawing::framework; namespace sdext::presenter { PresenterFrameworkObserver::PresenterFrameworkObserver ( - css::uno::Reference<css::drawing::framework::XConfigurationController> xController, + rtl::Reference<sd::framework::ConfigurationController> xController, const Action& rAction) : PresenterFrameworkObserverInterfaceBase(m_aMutex), mxConfigurationController(std::move(xController)), @@ -56,7 +57,7 @@ PresenterFrameworkObserver::~PresenterFrameworkObserver() } void PresenterFrameworkObserver::RunOnUpdateEnd ( - const css::uno::Reference<css::drawing::framework::XConfigurationController>&rxController, + const rtl::Reference<sd::framework::ConfigurationController>&rxController, const Action& rAction) { new PresenterFrameworkObserver( @@ -86,7 +87,7 @@ void SAL_CALL PresenterFrameworkObserver::disposing (const lang::EventObject& rE if ( ! rEvent.Source.is()) return; - if (rEvent.Source == mxConfigurationController) + if (rEvent.Source == cppu::getXWeak(mxConfigurationController.get())) { mxConfigurationController = nullptr; if (maAction) diff --git a/sd/source/console/PresenterFrameworkObserver.hxx b/sd/source/console/PresenterFrameworkObserver.hxx index 6700ad0a2322..2e3baa4286cc 100644 --- a/sd/source/console/PresenterFrameworkObserver.hxx +++ b/sd/source/console/PresenterFrameworkObserver.hxx @@ -21,12 +21,14 @@ #define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERFRAMEWORKOBSERVER_HXX #include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <cppuhelper/basemutex.hxx> #include <cppuhelper/compbase.hxx> +#include <rtl/ref.hxx> #include <functional> +namespace sd::framework { class ConfigurationController; } + namespace sdext::presenter { typedef ::cppu::WeakComponentImplHelper < @@ -47,7 +49,7 @@ public: PresenterFrameworkObserver& operator=(const PresenterFrameworkObserver&) = delete; static void RunOnUpdateEnd ( - const css::uno::Reference<css::drawing::framework::XConfigurationController>&rxController, + const rtl::Reference<::sd::framework::ConfigurationController>& rxController, const Action& rAction); virtual void SAL_CALL disposing() override; @@ -56,7 +58,7 @@ public: const css::drawing::framework::ConfigurationChangeEvent& rEvent) override; private: - css::uno::Reference<css::drawing::framework::XConfigurationController> mxConfigurationController; + rtl::Reference<sd::framework::ConfigurationController> mxConfigurationController; Action maAction; /** Create a new PresenterFrameworkObserver object. @@ -67,7 +69,7 @@ private: e.g. when some resource has been created. */ PresenterFrameworkObserver ( - css::uno::Reference<css::drawing::framework::XConfigurationController> xController, + rtl::Reference<sd::framework::ConfigurationController> xController, const Action& rAction); virtual ~PresenterFrameworkObserver() override; diff --git a/sd/source/console/PresenterHelpView.cxx b/sd/source/console/PresenterHelpView.cxx index 1ad579007552..fb8d54c6f6b1 100644 --- a/sd/source/console/PresenterHelpView.cxx +++ b/sd/source/console/PresenterHelpView.cxx @@ -24,9 +24,9 @@ #include "PresenterCanvasHelper.hxx" #include "PresenterGeometryHelper.hxx" #include <DrawController.hxx> +#include <framework/ConfigurationController.hxx> #include <com/sun/star/awt/XWindowPeer.hpp> #include <com/sun/star/container/XNameAccess.hpp> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/rendering/CompositeOperation.hpp> #include <com/sun/star/rendering/TextDirection.hpp> #include <com/sun/star/util/Color.hpp> @@ -133,8 +133,8 @@ PresenterHelpView::PresenterHelpView ( try { // Get the content window via the pane anchor. - Reference<XConfigurationController> xCC ( - rxController->getConfigurationController(), UNO_SET_THROW); + rtl::Reference<sd::framework::ConfigurationController> xCC ( + rxController->getConfigurationController()); mxPane.set(xCC->getResource(rxViewId->getAnchor()), UNO_QUERY_THROW); mxWindow = mxPane->getWindow(); diff --git a/sd/source/console/PresenterNotesView.cxx b/sd/source/console/PresenterNotesView.cxx index f3f678422656..05c403202041 100644 --- a/sd/source/console/PresenterNotesView.cxx +++ b/sd/source/console/PresenterNotesView.cxx @@ -26,11 +26,11 @@ #include "PresenterScrollBar.hxx" #include "PresenterTextView.hxx" #include <DrawController.hxx> +#include <framework/ConfigurationController.hxx> #include <com/sun/star/accessibility/AccessibleTextType.hpp> #include <com/sun/star/awt/Key.hpp> #include <com/sun/star/awt/KeyModifier.hpp> #include <com/sun/star/awt/PosSize.hpp> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/drawing/framework/XPane.hpp> #include <com/sun/star/lang/XServiceName.hpp> #include <com/sun/star/presentation/XPresentationPage.hpp> @@ -64,7 +64,7 @@ PresenterNotesView::PresenterNotesView ( { try { - Reference<XConfigurationController> xCC (rxController->getConfigurationController(), UNO_SET_THROW); + rtl::Reference<sd::framework::ConfigurationController> xCC (rxController->getConfigurationController()); Reference<XPane> xPane (xCC->getResource(rxViewId->getAnchor()), UNO_QUERY_THROW); mxParentWindow = xPane->getWindow(); diff --git a/sd/source/console/PresenterPaneFactory.cxx b/sd/source/console/PresenterPaneFactory.cxx index 8cb39d194c5b..7ec09d881819 100644 --- a/sd/source/console/PresenterPaneFactory.cxx +++ b/sd/source/console/PresenterPaneFactory.cxx @@ -63,7 +63,7 @@ void PresenterPaneFactory::Register (const rtl::Reference<::sd::DrawController>& try { // Get the configuration controller. - xCC = rxController->getConfigurationControllerImpl(); + xCC = rxController->getConfigurationController(); mxConfigurationControllerWeak = xCC.get(); if ( ! xCC.is()) { diff --git a/sd/source/console/PresenterPaneFactory.hxx b/sd/source/console/PresenterPaneFactory.hxx index 3b00ae505dd8..e701041538d4 100644 --- a/sd/source/console/PresenterPaneFactory.hxx +++ b/sd/source/console/PresenterPaneFactory.hxx @@ -23,7 +23,6 @@ #include <cppuhelper/compbase.hxx> #include <cppuhelper/basemutex.hxx> #include <com/sun/star/frame/XController.hpp> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/drawing/framework/XPane.hpp> #include <com/sun/star/drawing/framework/XResourceFactory.hpp> #include <com/sun/star/uno/XComponentContext.hpp> diff --git a/sd/source/console/PresenterScreen.cxx b/sd/source/console/PresenterScreen.cxx index 29f41eaa5666..2ee43f9cb047 100644 --- a/sd/source/console/PresenterScreen.cxx +++ b/sd/source/console/PresenterScreen.cxx @@ -359,7 +359,7 @@ void PresenterScreen::InitializePresenterScreen() } // Get the XController from the first argument. - rtl::Reference<::sd::framework::ConfigurationController> xCC( mxController->getConfigurationControllerImpl()); + rtl::Reference<::sd::framework::ConfigurationController> xCC( mxController->getConfigurationController()); mxConfigurationControllerWeak = xCC.get(); Reference<XComponentContext> xContext(mxContextWeak); diff --git a/sd/source/console/PresenterScreen.hxx b/sd/source/console/PresenterScreen.hxx index 62c9601d05ac..13a1e04442ca 100644 --- a/sd/source/console/PresenterScreen.hxx +++ b/sd/source/console/PresenterScreen.hxx @@ -28,8 +28,9 @@ #include <com/sun/star/frame/XModel2.hpp> #include <com/sun/star/task/XJob.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/presentation/XPresentation2.hpp> +#include <com/sun/star/drawing/framework/XConfiguration.hpp> +#include <com/sun/star/drawing/framework/XResourceFactory.hpp> #include <rtl/ref.hxx> #include <unotools/weakref.hxx> diff --git a/sd/source/console/PresenterSlideShowView.cxx b/sd/source/console/PresenterSlideShowView.cxx index e2efaa4e3aea..fe6089203988 100644 --- a/sd/source/console/PresenterSlideShowView.cxx +++ b/sd/source/console/PresenterSlideShowView.cxx @@ -24,6 +24,7 @@ #include "PresenterPaneContainer.hxx" #include <PresenterHelper.hxx> #include <DrawController.hxx> +#include <framework/ConfigurationController.hxx> #include <com/sun/star/awt/InvalidateStyle.hpp> #include <com/sun/star/awt/PosSize.hpp> #include <com/sun/star/awt/Pointer.hpp> @@ -31,7 +32,6 @@ #include <com/sun/star/awt/WindowAttribute.hpp> #include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/awt/XWindowPeer.hpp> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/presentation/XPresentationSupplier.hpp> #include <com/sun/star/presentation/XPresentation2.hpp> #include <com/sun/star/rendering/CompositeOperation.hpp> @@ -108,7 +108,7 @@ void PresenterSlideShowView::LateInit() // Use view id and controller to retrieve window and canvas from // configuration controller. - Reference<XConfigurationController> xCC (mxController->getConfigurationController()); + rtl::Reference<sd::framework::ConfigurationController> xCC (mxController->getConfigurationController()); if (xCC.is()) { diff --git a/sd/source/console/PresenterSlideSorter.cxx b/sd/source/console/PresenterSlideSorter.cxx index 3fa3473ff435..9e2b28dd6601 100644 --- a/sd/source/console/PresenterSlideSorter.cxx +++ b/sd/source/console/PresenterSlideSorter.cxx @@ -30,7 +30,7 @@ #include "PresenterUIPainter.hxx" #include "PresenterWindowManager.hxx" #include <DrawController.hxx> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> +#include <framework/ConfigurationController.hxx> #include <com/sun/star/rendering/XBitmapCanvas.hpp> #include <com/sun/star/rendering/CompositeOperation.hpp> #include <com/sun/star/rendering/TextDirection.hpp> @@ -255,8 +255,7 @@ PresenterSlideSorter::PresenterSlideSorter ( try { // Get pane and window. - Reference<XConfigurationController> xCC ( - rxController->getConfigurationController(), UNO_SET_THROW); + rtl::Reference<sd::framework::ConfigurationController> xCC (rxController->getConfigurationController()); Reference<lang::XMultiComponentFactory> xFactory ( mxComponentContext->getServiceManager(), UNO_SET_THROW); diff --git a/sd/source/console/PresenterToolBar.cxx b/sd/source/console/PresenterToolBar.cxx index 0c11030815fb..1e08d1ae9299 100644 --- a/sd/source/console/PresenterToolBar.cxx +++ b/sd/source/console/PresenterToolBar.cxx @@ -28,10 +28,10 @@ #include "PresenterTimer.hxx" #include "PresenterWindowManager.hxx" #include <DrawController.hxx> +#include <framework/ConfigurationController.hxx> #include <cppuhelper/compbase.hxx> #include <com/sun/star/awt/XWindowPeer.hpp> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/drawing/framework/XPane.hpp> #include <com/sun/star/geometry/AffineMatrix2D.hpp> #include <com/sun/star/rendering/CompositeOperation.hpp> @@ -932,7 +932,7 @@ PresenterToolBarView::PresenterToolBarView ( { try { - Reference<XConfigurationController> xCC(rxController->getConfigurationController(),UNO_SET_THROW); + rtl::Reference<sd::framework::ConfigurationController> xCC(rxController->getConfigurationController()); mxPane.set(xCC->getResource(rxViewId->getAnchor()), UNO_QUERY_THROW); mxWindow = mxPane->getWindow(); diff --git a/sd/source/console/PresenterViewFactory.cxx b/sd/source/console/PresenterViewFactory.cxx index 4b85a1a8eb43..2bdb99329e23 100644 --- a/sd/source/console/PresenterViewFactory.cxx +++ b/sd/source/console/PresenterViewFactory.cxx @@ -26,6 +26,7 @@ #include "PresenterSlideSorter.hxx" #include "PresenterToolBar.hxx" #include <DrawController.hxx> +#include <framework/ConfigurationController.hxx> #include <utility> using namespace ::com::sun::star; diff --git a/sd/source/console/PresenterViewFactory.hxx b/sd/source/console/PresenterViewFactory.hxx index cf2a66a5553c..be7c20c49931 100644 --- a/sd/source/console/PresenterViewFactory.hxx +++ b/sd/source/console/PresenterViewFactory.hxx @@ -23,7 +23,6 @@ #include "PresenterController.hxx" #include <cppuhelper/compbase.hxx> #include <cppuhelper/basemutex.hxx> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/drawing/framework/XResourceFactory.hpp> #include <com/sun/star/drawing/framework/XView.hpp> #include <com/sun/star/uno/XComponentContext.hpp> @@ -114,8 +113,7 @@ public: private: css::uno::Reference<css::uno::XComponentContext> mxComponentContext; - css::uno::Reference<css::drawing::framework::XConfigurationController> - mxConfigurationController; + rtl::Reference<sd::framework::ConfigurationController> mxConfigurationController; unotools::WeakReference<::sd::DrawController> mxControllerWeak; ::rtl::Reference<PresenterController> mpPresenterController; typedef ::std::pair<css::uno::Reference<css::drawing::framework::XView>, diff --git a/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx b/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx index 823df7d8f86e..7becd63a3aba 100644 --- a/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx +++ b/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx @@ -45,7 +45,7 @@ class ConfigurationUpdater; processes the configuration change requests. When after processing one entry the queue is empty then the - XConfigurationController::update() method is called so that the changes + ConfigurationController::update() method is called so that the changes made to the local XConfiguration reference are reflected by the UI. Queue entries are processed asynchronously by calling PostUserEvent(). diff --git a/sd/source/ui/framework/configuration/ConfigurationController.cxx b/sd/source/ui/framework/configuration/ConfigurationController.cxx index 568e04f867d2..db7ab5deaf34 100644 --- a/sd/source/ui/framework/configuration/ConfigurationController.cxx +++ b/sd/source/ui/framework/configuration/ConfigurationController.cxx @@ -82,7 +82,7 @@ public: //===== ConfigurationController::Lock ========================================= -ConfigurationController::Lock::Lock (const Reference<XConfigurationController>& rxController) +ConfigurationController::Lock::Lock (const rtl::Reference<ConfigurationController>& rxController) : mxController(rxController) { OSL_ASSERT(mxController.is()); @@ -195,9 +195,7 @@ void SAL_CALL ConfigurationController::notifyEvent ( mpImplementation->mpBroadcaster->NotifyListeners(rEvent); } -//----- XConfigurationController ---------------------------------------------- - -void SAL_CALL ConfigurationController::lock() +void ConfigurationController::lock() { OSL_ASSERT(mpImplementation != nullptr); OSL_ASSERT(mpImplementation->mpConfigurationUpdater != nullptr); @@ -211,7 +209,7 @@ void SAL_CALL ConfigurationController::lock() = mpImplementation->mpConfigurationUpdater->GetLock(); } -void SAL_CALL ConfigurationController::unlock() +void ConfigurationController::unlock() { ::osl::MutexGuard aGuard (m_aMutex); @@ -226,7 +224,7 @@ void SAL_CALL ConfigurationController::unlock() mpImplementation->mpConfigurationUpdaterLock.reset(); } -void SAL_CALL ConfigurationController::requestResourceActivation ( +void ConfigurationController::requestResourceActivation ( const Reference<XResourceId>& rxResourceId, ResourceActivationMode eMode) { @@ -282,7 +280,7 @@ void SAL_CALL ConfigurationController::requestResourceActivation ( postChangeRequest(xRequest); } -void SAL_CALL ConfigurationController::requestResourceDeactivation ( +void ConfigurationController::requestResourceDeactivation ( const Reference<XResourceId>& rxResourceId) { ::osl::MutexGuard aGuard (m_aMutex); @@ -317,7 +315,7 @@ void SAL_CALL ConfigurationController::requestResourceDeactivation ( postChangeRequest(xRequest); } -Reference<XResource> SAL_CALL ConfigurationController::getResource ( +Reference<XResource> ConfigurationController::getResource ( const Reference<XResourceId>& rxResourceId) { ::osl::MutexGuard aGuard (m_aMutex); @@ -328,7 +326,7 @@ Reference<XResource> SAL_CALL ConfigurationController::getResource ( return aDescriptor.mxResource; } -void SAL_CALL ConfigurationController::update() +void ConfigurationController::update() { ::osl::MutexGuard aGuard (m_aMutex); ThrowIfDisposed(); @@ -363,7 +361,7 @@ void SAL_CALL ConfigurationController::postChangeRequest ( mpImplementation->mpQueueProcessor->AddRequest(rxRequest); } -Reference<XConfiguration> SAL_CALL ConfigurationController::getRequestedConfiguration() +Reference<XConfiguration> ConfigurationController::getRequestedConfiguration() { ::osl::MutexGuard aGuard (m_aMutex); ThrowIfDisposed(); @@ -375,7 +373,7 @@ Reference<XConfiguration> SAL_CALL ConfigurationController::getRequestedConfigur return Reference<XConfiguration>(); } -Reference<XConfiguration> SAL_CALL ConfigurationController::getCurrentConfiguration() +Reference<XConfiguration> ConfigurationController::getCurrentConfiguration() { ::osl::MutexGuard aGuard (m_aMutex); ThrowIfDisposed(); @@ -391,7 +389,7 @@ Reference<XConfiguration> SAL_CALL ConfigurationController::getCurrentConfigurat /** The given configuration is restored by generating the appropriate set of activation and deactivation requests. */ -void SAL_CALL ConfigurationController::restoreConfiguration ( +void ConfigurationController::restoreConfiguration ( const Reference<XConfiguration>& rxNewConfiguration) { ::osl::MutexGuard aGuard (m_aMutex); diff --git a/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx b/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx index 532c5e121899..c0288cb2bdb3 100644 --- a/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx +++ b/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx @@ -19,10 +19,10 @@ #include "ConfigurationControllerBroadcaster.hxx" #include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/drawing/framework/XResource.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <com/sun/star/lang/DisposedException.hpp> +#include <framework/ConfigurationController.hxx> #include <comphelper/diagnose_ex.hxx> using namespace ::com::sun::star; @@ -32,7 +32,7 @@ using namespace ::com::sun::star::drawing::framework; namespace sd::framework { ConfigurationControllerBroadcaster::ConfigurationControllerBroadcaster ( - const Reference<XConfigurationController>& rxController) + const rtl::Reference<ConfigurationController>& rxController) : mxConfigurationController(rxController) { } @@ -44,7 +44,7 @@ void ConfigurationControllerBroadcaster::AddListener( { if ( ! rxListener.is()) throw lang::IllegalArgumentException(u"invalid listener"_ustr, - mxConfigurationController, + cppu::getXWeak(mxConfigurationController.get()), 0); maListenerMap.try_emplace(rsEventType); @@ -60,7 +60,7 @@ void ConfigurationControllerBroadcaster::RemoveListener( { if ( ! rxListener.is()) throw lang::IllegalArgumentException(u"invalid listener"_ustr, - mxConfigurationController, + cppu::getXWeak(mxConfigurationController.get()), 0); ListenerList::iterator iList; @@ -146,7 +146,7 @@ void ConfigurationControllerBroadcaster::NotifyListeners ( void ConfigurationControllerBroadcaster::DisposeAndClear() { lang::EventObject aEvent; - aEvent.Source = mxConfigurationController; + aEvent.Source = cppu::getXWeak(mxConfigurationController.get()); while (!maListenerMap.empty()) { ListenerMap::iterator iMap (maListenerMap.begin()); diff --git a/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.hxx b/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.hxx index 5dfd6843d38a..4d72a45b3f6a 100644 --- a/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.hxx +++ b/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.hxx @@ -20,17 +20,17 @@ #pragma once #include <com/sun/star/uno/Reference.hxx> - +#include <rtl/ref.hxx> #include <unordered_map> #include <vector> namespace com::sun::star::drawing::framework { class XConfigurationChangeListener; } -namespace com::sun::star::drawing::framework { class XConfigurationController; } namespace com::sun::star::drawing::framework { class XResource; } namespace com::sun::star::drawing::framework { class XResourceId; } namespace com::sun::star::drawing::framework { struct ConfigurationChangeEvent; } namespace sd::framework { +class ConfigurationController; /** This class manages the set of XConfigurationChangeListeners and calls them when the ConfigurationController wants to broadcast an @@ -47,8 +47,7 @@ public: /** The given controller is used as origin of thrown exceptions. */ explicit ConfigurationControllerBroadcaster ( - const css::uno::Reference< - css::drawing::framework::XConfigurationController>& rxController); + const rtl::Reference<ConfigurationController>& rxController); /** Add a listener for one type of event. When one listener is interested in more than one event type this method has to be called @@ -110,7 +109,7 @@ public: void DisposeAndClear(); private: - css::uno::Reference<css::drawing::framework::XConfigurationController> mxConfigurationController; + rtl::Reference<ConfigurationController> mxConfigurationController; class ListenerDescriptor { public: diff --git a/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx b/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx index 2a0ef282f9f6..756dd8936e2b 100644 --- a/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx +++ b/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx @@ -23,8 +23,10 @@ #include "ConfigurationControllerBroadcaster.hxx" #include "ConfigurationControllerResourceManager.hxx" #include <framework/Configuration.hxx> +#include <framework/ConfigurationController.hxx> #include <framework/FrameworkHelper.hxx> #include <DrawController.hxx> +#include <com/sun/star/drawing/framework/ConfigurationChangeEvent.hpp> #include <comphelper/scopeguard.hxx> #include <comphelper/diagnose_ex.hxx> @@ -197,7 +199,7 @@ void ConfigurationUpdater::CleanRequestedConfiguration() CheckPureAnchors(mxRequestedConfiguration, aResourcesToDeactivate); if (!aResourcesToDeactivate.empty()) { - Reference<XConfigurationController> xCC ( + rtl::Reference<ConfigurationController> xCC ( mxControllerManager->getConfigurationController()); for (const auto& rxId : aResourcesToDeactivate) if (rxId.is()) diff --git a/sd/source/ui/framework/configuration/ResourceFactoryManager.cxx b/sd/source/ui/framework/configuration/ResourceFactoryManager.cxx index 47f020d178f5..ffcb02310756 100644 --- a/sd/source/ui/framework/configuration/ResourceFactoryManager.cxx +++ b/sd/source/ui/framework/configuration/ResourceFactoryManager.cxx @@ -20,6 +20,7 @@ #include "ResourceFactoryManager.hxx" #include <DrawController.hxx> #include <tools/wldcrd.hxx> +#include <com/sun/star/drawing/framework/XResourceFactory.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/util/URLTransformer.hpp> diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.cxx b/sd/source/ui/framework/factories/BasicPaneFactory.cxx index 7a53e408c619..e73ed69043e3 100644 --- a/sd/source/ui/framework/factories/BasicPaneFactory.cxx +++ b/sd/source/ui/framework/factories/BasicPaneFactory.cxx @@ -87,7 +87,7 @@ BasicPaneFactory::BasicPaneFactory( // Tunnel through the controller to obtain access to the ViewShellBase. mpViewShellBase = rxController->GetViewShellBase(); - rtl::Reference<sd::framework::ConfigurationController> xCC (rxController->getConfigurationControllerImpl()); + rtl::Reference<sd::framework::ConfigurationController> xCC (rxController->getConfigurationController()); mxConfigurationControllerWeak = xCC.get(); // Add pane factories for the two left panes (one for Impress and one for diff --git a/sd/source/ui/framework/factories/BasicToolBarFactory.cxx b/sd/source/ui/framework/factories/BasicToolBarFactory.cxx index fe2b3d0cb947..03c013e59b07 100644 --- a/sd/source/ui/framework/factories/BasicToolBarFactory.cxx +++ b/sd/source/ui/framework/factories/BasicToolBarFactory.cxx @@ -18,6 +18,7 @@ */ #include <framework/factories/BasicToolBarFactory.hxx> +#include <framework/ConfigurationController.hxx> #include <ViewTabBar.hxx> #include <framework/FrameworkHelper.hxx> @@ -25,7 +26,6 @@ #include <unotools/mediadescriptor.hxx> #include <com/sun/star/lang/IllegalArgumentException.hpp> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/frame/XController.hpp> using namespace ::com::sun::star; @@ -54,11 +54,8 @@ BasicToolBarFactory::BasicToolBarFactory(const rtl::Reference<::sd::DrawControll { mxConfigurationController->addResourceFactory( FrameworkHelper::msViewTabBarURL, this); + mxConfigurationController->addEventListener(static_cast<lang::XEventListener*>(this)); } - - Reference<lang::XComponent> xComponent (mxConfigurationController, UNO_QUERY); - if (xComponent.is()) - xComponent->addEventListener(static_cast<lang::XEventListener*>(this)); } else { @@ -86,11 +83,9 @@ void BasicToolBarFactory::disposing(std::unique_lock<std::mutex>&) void BasicToolBarFactory::Shutdown() { - Reference<lang::XComponent> xComponent (mxConfigurationController, UNO_QUERY); - if (xComponent.is()) - xComponent->removeEventListener(static_cast<lang::XEventListener*>(this)); if (mxConfigurationController.is()) { + mxConfigurationController->removeEventListener(static_cast<lang::XEventListener*>(this)); mxConfigurationController->removeResourceFactoryForReference(this); mxConfigurationController = nullptr; } @@ -101,7 +96,7 @@ void BasicToolBarFactory::Shutdown() void SAL_CALL BasicToolBarFactory::disposing ( const lang::EventObject& rEventObject) { - if (rEventObject.Source == mxConfigurationController) + if (rEventObject.Source == cppu::getXWeak(mxConfigurationController.get())) mxConfigurationController = nullptr; } diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx index e842aefbc330..eaacf0de1f95 100644 --- a/sd/source/ui/framework/factories/BasicViewFactory.cxx +++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx @@ -19,6 +19,7 @@ #include <framework/factories/BasicViewFactory.hxx> +#include <framework/ConfigurationController.hxx> #include <framework/ViewShellWrapper.hxx> #include <framework/FrameworkHelper.hxx> #include <com/sun/star/lang/IllegalArgumentException.hpp> diff --git a/sd/source/ui/framework/factories/PresentationFactory.cxx b/sd/source/ui/framework/factories/PresentationFactory.cxx index 303597ff5ec3..0edfbed9eaa2 100644 --- a/sd/source/ui/framework/factories/PresentationFactory.cxx +++ b/sd/source/ui/framework/factories/PresentationFactory.cxx @@ -18,6 +18,7 @@ */ #include <framework/PresentationFactory.hxx> +#include <framework/ConfigurationController.hxx> #include <DrawController.hxx> #include <com/sun/star/drawing/framework/XView.hpp> @@ -131,7 +132,7 @@ void PresentationFactory::install(const rtl::Reference<::sd::DrawController>& rx { try { - Reference<XConfigurationController> xCC (rxController->getConfigurationController()); + rtl::Reference<ConfigurationController> xCC (rxController->getConfigurationController()); if (xCC.is()) xCC->addResourceFactory( gsPresentationViewURL, diff --git a/sd/source/ui/framework/module/CenterViewFocusModule.cxx b/sd/source/ui/framework/module/CenterViewFocusModule.cxx index a3e8fd182ebb..fc9ba22e81fe 100644 --- a/sd/source/ui/framework/module/CenterViewFocusModule.cxx +++ b/sd/source/ui/framework/module/CenterViewFocusModule.cxx @@ -19,13 +19,13 @@ #include "CenterViewFocusModule.hxx" +#include <framework/ConfigurationController.hxx> #include <framework/FrameworkHelper.hxx> #include <framework/ViewShellWrapper.hxx> #include <DrawController.hxx> #include <ViewShellBase.hxx> #include <ViewShellManager.hxx> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <comphelper/servicehelper.hxx> using namespace ::com::sun::star; @@ -135,7 +135,7 @@ void SAL_CALL CenterViewFocusModule::disposing ( const lang::EventObject& rEvent) { if (mxConfigurationController.is()) - if (rEvent.Source == mxConfigurationController) + if (rEvent.Source == cppu::getXWeak(mxConfigurationController.get())) { mbValid = false; mxConfigurationController = nullptr; diff --git a/sd/source/ui/framework/module/CenterViewFocusModule.hxx b/sd/source/ui/framework/module/CenterViewFocusModule.hxx index ac24ca5a129c..6e3f9c74d47c 100644 --- a/sd/source/ui/framework/module/CenterViewFocusModule.hxx +++ b/sd/source/ui/framework/module/CenterViewFocusModule.hxx @@ -23,11 +23,6 @@ #include <comphelper/compbase.hxx> #include <rtl/ref.hxx> -namespace com::sun::star::drawing::framework -{ -class XConfigurationController; -} - namespace sd { class DrawController; @@ -36,6 +31,8 @@ class ViewShellBase; namespace sd::framework { +class ConfigurationController; + typedef comphelper::WeakComponentImplHelper<css::drawing::framework::XConfigurationChangeListener> CenterViewFocusModuleInterfaceBase; @@ -65,8 +62,7 @@ private: class ViewShellContainer; bool mbValid; - css::uno::Reference<css::drawing::framework::XConfigurationController> - mxConfigurationController; + rtl::Reference<ConfigurationController> mxConfigurationController; ViewShellBase* mpBase; /** This flag indicates whether in the last configuration change cycle a new view has been created and thus the center view has to be moved diff --git a/sd/source/ui/framework/module/NotesPaneModule.cxx b/sd/source/ui/framework/module/NotesPaneModule.cxx index 2a18863b8db4..504a2f15a364 100644 --- a/sd/source/ui/framework/module/NotesPaneModule.cxx +++ b/sd/source/ui/framework/module/NotesPaneModule.cxx @@ -186,7 +186,8 @@ void SAL_CALL NotesPaneModule::notifyConfigurationChange(const ConfigurationChan void SAL_CALL NotesPaneModule::disposing(const lang::EventObject& rEvent) { - if (mxConfigurationController.is() && rEvent.Source == mxConfigurationController) + if (mxConfigurationController.is() + && rEvent.Source == cppu::getXWeak(mxConfigurationController.get())) { SaveResourceState(); // Without the configuration controller this class can do nothing. diff --git a/sd/source/ui/framework/module/NotesPaneModule.hxx b/sd/source/ui/framework/module/NotesPaneModule.hxx index f4c41e53db6b..ca05ab4cc379 100644 --- a/sd/source/ui/framework/module/NotesPaneModule.hxx +++ b/sd/source/ui/framework/module/NotesPaneModule.hxx @@ -16,7 +16,6 @@ namespace com::sun::star::drawing::framework { -class XConfigurationController; class XView; } namespace sd @@ -31,6 +30,8 @@ class EventMultiplexerEvent; namespace sd::framework { +class ConfigurationController; + /** This module is responsible for handling visibility of NotesPane across modes */ class NotesPaneModule : public comphelper::WeakComponentImplHelper< @@ -61,8 +62,7 @@ public: virtual void SAL_CALL disposing(const css::lang::EventObject& rEvent) override; private: - css::uno::Reference<css::drawing::framework::XConfigurationController> - mxConfigurationController; + rtl::Reference<ConfigurationController> mxConfigurationController; css::uno::Reference<css::drawing::framework::XResourceId> mxBottomImpressPaneId; css::uno::Reference<css::drawing::framework::XResourceId> mxMainViewAnchorId; diff --git a/sd/source/ui/framework/module/ShellStackGuard.cxx b/sd/source/ui/framework/module/ShellStackGuard.cxx index 92c3e8d598c6..a5aba8acfc3a 100644 --- a/sd/source/ui/framework/module/ShellStackGuard.cxx +++ b/sd/source/ui/framework/module/ShellStackGuard.cxx @@ -97,7 +97,7 @@ void SAL_CALL ShellStackGuard::disposing ( const lang::EventObject& rEvent) { if (mxConfigurationController.is()) - if (rEvent.Source == mxConfigurationController) + if (rEvent.Source == cppu::getXWeak(mxConfigurationController.get())) { mxConfigurationController = nullptr; mpBase = nullptr; diff --git a/sd/source/ui/framework/module/ShellStackGuard.hxx b/sd/source/ui/framework/module/ShellStackGuard.hxx index d5980198a3ec..c76190a3bb58 100644 --- a/sd/source/ui/framework/module/ShellStackGuard.hxx +++ b/sd/source/ui/framework/module/ShellStackGuard.hxx @@ -28,11 +28,6 @@ #include <comphelper/compbase.hxx> #include <memory> -namespace com::sun::star::drawing::framework -{ -class XConfigurationController; -} - namespace sd { class DrawController; @@ -41,6 +36,8 @@ class ViewShellBase; namespace sd::framework { +class ConfigurationController; + typedef comphelper::WeakComponentImplHelper<css::drawing::framework::XConfigurationChangeListener> ShellStackGuardInterfaceBase; @@ -72,8 +69,7 @@ public: virtual void SAL_CALL disposing(const css::lang::EventObject& rEvent) override; private: - css::uno::Reference<css::drawing::framework::XConfigurationController> - mxConfigurationController; + rtl::Reference<ConfigurationController> mxConfigurationController; ViewShellBase* mpBase; std::unique_ptr<ConfigurationController::Lock> mpUpdateLock; Idle maPrinterPollingIdle; diff --git a/sd/source/ui/framework/module/SlideSorterModule.cxx b/sd/source/ui/framework/module/SlideSorterModule.cxx index 1619fb8c1960..221637e76708 100644 --- a/sd/source/ui/framework/module/SlideSorterModule.cxx +++ b/sd/source/ui/framework/module/SlideSorterModule.cxx @@ -63,9 +63,7 @@ SlideSorterModule::SlideSorterModule ( if (mxConfigurationController.is()) { - uno::Reference<lang::XComponent> const xComppnent( - mxConfigurationController, UNO_QUERY_THROW); - xComppnent->addEventListener(this); + mxConfigurationController->addEventListener(this); mxConfigurationController->addConfigurationChangeListener( this, FrameworkHelper::msResourceActivationRequestEvent, @@ -199,7 +197,7 @@ void SlideSorterModule::UpdateViewTabBar (const Reference<XTabBar>& rxTabBar) Reference<XTabBar> xBar (rxTabBar); if ( ! xBar.is()) { - Reference<XConfigurationController> xCC ( + rtl::Reference<ConfigurationController> xCC ( mxControllerManager->getConfigurationController()); if (xCC.is()) xBar.set(xCC->getResource(mxViewTabBarId), UNO_QUERY); @@ -239,10 +237,7 @@ void SlideSorterModule::disposing(std::unique_lock<std::mutex>&) { if (mxConfigurationController.is()) { - uno::Reference<lang::XComponent> const xComponent(mxConfigurationController, UNO_QUERY); - if (xComponent.is()) - xComponent->removeEventListener(this); - + mxConfigurationController->removeEventListener(this); mxConfigurationController->removeConfigurationChangeListener(this); mxConfigurationController = nullptr; } @@ -304,7 +299,7 @@ void SAL_CALL SlideSorterModule::disposing ( const lang::EventObject& rEvent) { if (mxConfigurationController.is() - && rEvent.Source == mxConfigurationController) + && rEvent.Source == cppu::getXWeak(mxConfigurationController.get())) { SaveResourceState(); // Without the configuration controller this class can do nothing. diff --git a/sd/source/ui/framework/module/SlideSorterModule.hxx b/sd/source/ui/framework/module/SlideSorterModule.hxx index 218b63139fb9..c77c10b7a88d 100644 --- a/sd/source/ui/framework/module/SlideSorterModule.hxx +++ b/sd/source/ui/framework/module/SlideSorterModule.hxx @@ -25,11 +25,12 @@ #include <memory> #include <set> -namespace com::sun::star::drawing::framework { class XConfigurationController; } namespace com::sun::star::drawing::framework { class XTabBar; } namespace sd { class DrawController; } -namespace sd::framework { +namespace sd::framework +{ +class ConfigurationController; typedef comphelper::WeakComponentImplHelper < css::drawing::framework::XConfigurationChangeListener @@ -71,8 +72,7 @@ public: const css::lang::EventObject& rEvent) override; private: - css::uno::Reference<css::drawing::framework::XConfigurationController> - mxConfigurationController; + rtl::Reference<ConfigurationController> mxConfigurationController; ::std::set<OUString> maActiveMainViewContainer; /// The resource managed by this class. css::uno::Reference<css::drawing::framework::XResourceId> mxResourceId; diff --git a/sd/source/ui/framework/module/ToolBarModule.cxx b/sd/source/ui/framework/module/ToolBarModule.cxx index 441324b07d88..80d75d5f8438 100644 --- a/sd/source/ui/framework/module/ToolBarModule.cxx +++ b/sd/source/ui/framework/module/ToolBarModule.cxx @@ -24,6 +24,7 @@ #include <DrawController.hxx> #include <EventMultiplexer.hxx> #include <comphelper/servicehelper.hxx> +#include <framework/ConfigurationController.hxx> #include <framework/FrameworkHelper.hxx> #include <vcl/EnumContext.hxx> @@ -244,7 +245,7 @@ void ToolBarModule::UpdateToolbars(const ViewShell* pViewShell) void SAL_CALL ToolBarModule::disposing (const lang::EventObject& rEvent) { if (mxConfigurationController.is() - && rEvent.Source == mxConfigurationController) + && rEvent.Source == cppu::getXWeak(mxConfigurationController.get())) { // Without the configuration controller this class can do nothing. mxConfigurationController = nullptr; diff --git a/sd/source/ui/framework/module/ToolBarModule.hxx b/sd/source/ui/framework/module/ToolBarModule.hxx index e68c5d9fe47f..ab51982610b8 100644 --- a/sd/source/ui/framework/module/ToolBarModule.hxx +++ b/sd/source/ui/framework/module/ToolBarModule.hxx @@ -30,7 +30,6 @@ namespace com::sun::star::drawing::framework { -class XConfigurationController; class XResourceId; } @@ -44,7 +43,9 @@ namespace sd::tools class EventMultiplexerEvent; } -namespace sd::framework { +namespace sd::framework +{ +class ConfigurationController; typedef comphelper::WeakComponentImplHelper < css::drawing::framework::XConfigurationChangeListener @@ -78,8 +79,7 @@ public: const css::lang::EventObject& rEvent) override; private: - css::uno::Reference< - css::drawing::framework::XConfigurationController> mxConfigurationController; + rtl::Reference<ConfigurationController> mxConfigurationController; ViewShellBase* mpBase; std::unique_ptr<ToolBarManager::UpdateLock, o3tl::default_delete<ToolBarManager::UpdateLock>> mpToolBarManagerLock; bool mbMainViewSwitchUpdatePending; diff --git a/sd/source/ui/framework/module/ViewTabBarModule.cxx b/sd/source/ui/framework/module/ViewTabBarModule.cxx index d8d33c0be37d..d8d0f6883a31 100644 --- a/sd/source/ui/framework/module/ViewTabBarModule.cxx +++ b/sd/source/ui/framework/module/ViewTabBarModule.cxx @@ -19,6 +19,7 @@ #include "ViewTabBarModule.hxx" +#include <framework/ConfigurationController.hxx> #include <framework/FrameworkHelper.hxx> #include <DrawController.hxx> #include <com/sun/star/drawing/framework/XTabBar.hpp> @@ -124,7 +125,7 @@ void SAL_CALL ViewTabBarModule::disposing ( const lang::EventObject& rEvent) { if (mxConfigurationController.is() - && rEvent.Source == mxConfigurationController) + && rEvent.Source == cppu::getXWeak(mxConfigurationController.get())) { // Without the configuration controller this class can do nothing. mxConfigurationController = nullptr; diff --git a/sd/source/ui/framework/module/ViewTabBarModule.hxx b/sd/source/ui/framework/module/ViewTabBarModule.hxx index 0bf4fd903439..31f96e2beb96 100644 --- a/sd/source/ui/framework/module/ViewTabBarModule.hxx +++ b/sd/source/ui/framework/module/ViewTabBarModule.hxx @@ -23,11 +23,12 @@ #include <comphelper/compbase.hxx> #include <rtl/ref.hxx> -namespace com::sun::star::drawing::framework { class XConfigurationController; } namespace com::sun::star::drawing::framework { class XTabBar; } namespace sd { class DrawController; } -namespace sd::framework { +namespace sd::framework +{ +class ConfigurationController; typedef comphelper::WeakComponentImplHelper < css::drawing::framework::XConfigurationChangeListener @@ -67,8 +68,7 @@ public: const css::lang::EventObject& rEvent) override; private: - css::uno::Reference< - css::drawing::framework::XConfigurationController> mxConfigurationController; + rtl::Reference<ConfigurationController> mxConfigurationController; css::uno::Reference<css::drawing::framework::XResourceId> mxViewTabBarId; /** This is the place where the view tab bar is filled. Only missing diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx index 7c0de73ff9d3..7fccd28e1c67 100644 --- a/sd/source/ui/framework/tools/FrameworkHelper.cxx +++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx @@ -55,7 +55,7 @@ typedef comphelper::WeakComponentImplHelper < css::drawing::framework::XConfigurationChangeListener > CallbackCallerInterfaceBase; -/** A CallbackCaller registers as listener at an XConfigurationController +/** A CallbackCaller registers as listener at the ConfigurationController object and waits for the notification of one type of event. When that event is received, or when the CallbackCaller detects at its construction that the event will not be sent in the near future, the @@ -74,7 +74,7 @@ public: the constructor.) @param rBase This ViewShellBase object is used to determine the - XConfigurationController at which to register. + ConfigurationController at which to register. @param rsEventType The event type which the callback is waiting for. @param pCallback @@ -97,7 +97,7 @@ public: private: OUString msEventType; - Reference<XConfigurationController> mxConfigurationController; + rtl::Reference<::sd::framework::ConfigurationController> mxConfigurationController; ::sd::framework::FrameworkHelper::ConfigurationChangeEventFilter maFilter; ::sd::framework::FrameworkHelper::Callback maCallback; }; @@ -210,7 +210,7 @@ namespace } return pViewShell; } - Reference< XResource > lcl_getFirstViewInPane( const Reference< XConfigurationController >& i_rConfigController, + Reference< XResource > lcl_getFirstViewInPane( const rtl::Reference< ConfigurationController >& i_rConfigController, const Reference< XResourceId >& i_rPaneId ) { try @@ -637,10 +637,8 @@ private: void FrameworkHelper::RequestSynchronousUpdate() { - rtl::Reference<ConfigurationController> pCC ( - dynamic_cast<ConfigurationController*>(mxConfigurationController.get())); - if (pCC.is()) - pCC->RequestSynchronousUpdate(); + if (mxConfigurationController) + mxConfigurationController->RequestSynchronousUpdate(); } void FrameworkHelper::WaitForEvent (const OUString& rsEventType) const @@ -680,7 +678,7 @@ void FrameworkHelper::RunOnEvent( void FrameworkHelper::disposing (const lang::EventObject& rEventObject) { - if (rEventObject.Source == mxConfigurationController) + if (rEventObject.Source == cppu::getXWeak(mxConfigurationController.get())) mxConfigurationController = nullptr; } @@ -753,16 +751,14 @@ FrameworkHelper::DisposeListener::DisposeListener ( ::std::shared_ptr<FrameworkHelper> pHelper) : mpHelper(std::move(pHelper)) { - Reference<XComponent> xComponent (mpHelper->mxConfigurationController, UNO_QUERY); - if (xComponent.is()) - xComponent->addEventListener(this); + if (mpHelper->mxConfigurationController.is()) + mpHelper->mxConfigurationController->addEventListener(this); } void FrameworkHelper::DisposeListener::disposing(std::unique_lock<std::mutex>&) { - Reference<XComponent> xComponent (mpHelper->mxConfigurationController, UNO_QUERY); - if (xComponent.is()) - xComponent->removeEventListener(this); + if (mpHelper->mxConfigurationController.is()) + mpHelper->mxConfigurationController->removeEventListener(this); mpHelper.reset(); } @@ -831,7 +827,7 @@ void CallbackCaller::disposing(std::unique_lock<std::mutex>&) { if (mxConfigurationController.is()) { - Reference<XConfigurationController> xCC (mxConfigurationController); + rtl::Reference<sd::framework::ConfigurationController> xCC (mxConfigurationController); mxConfigurationController = nullptr; xCC->removeConfigurationChangeListener(this); } @@ -844,7 +840,7 @@ void CallbackCaller::disposing(std::unique_lock<std::mutex>&) void SAL_CALL CallbackCaller::disposing (const lang::EventObject& rEvent) { - if (rEvent.Source == mxConfigurationController) + if (rEvent.Source == cppu::getXWeak(mxConfigurationController.get())) { mxConfigurationController = nullptr; maCallback(false); @@ -862,7 +858,7 @@ void SAL_CALL CallbackCaller::notifyConfigurationChange ( { // Reset the reference to the configuration controller so that // dispose() will not try to remove the listener a second time. - Reference<XConfigurationController> xCC (mxConfigurationController); + rtl::Reference<sd::framework::ConfigurationController> xCC (mxConfigurationController); mxConfigurationController = nullptr; // Removing this object from the controller may very likely lead diff --git a/sd/source/ui/inc/DrawController.hxx b/sd/source/ui/inc/DrawController.hxx index a9733a2b45b1..7f444c881123 100644 --- a/sd/source/ui/inc/DrawController.hxx +++ b/sd/source/ui/inc/DrawController.hxx @@ -26,7 +26,6 @@ #include <com/sun/star/view/XFormLayerAccess.hpp> #include <com/sun/star/drawing/XDrawView.hpp> #include <com/sun/star/drawing/XSlideSorterSelectionSupplier.hpp> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/drawing/framework/XModuleController.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <comphelper/uno3.hxx> @@ -212,8 +211,7 @@ public: virtual void SAL_CALL selectionChanged (const css::lang::EventObject& rEvent) override; - SD_DLLPUBLIC css::uno::Reference<css::drawing::framework::XConfigurationController> - getConfigurationController(); + SD_DLLPUBLIC const rtl::Reference<sd::framework::ConfigurationController> & getConfigurationController(); css::uno::Reference<css::drawing::framework::XModuleController> getModuleController(); @@ -221,8 +219,6 @@ public: // XSlideSorterSelectionSupplier virtual css::uno::Any SAL_CALL getSlideSorterSelection( ) override; - SD_DLLPUBLIC const rtl::Reference<sd::framework::ConfigurationController> & getConfigurationControllerImpl(); - private: /** This method must return the name to index table. This table contains all property names and types of this object. diff --git a/sd/source/ui/inc/ViewTabBar.hxx b/sd/source/ui/inc/ViewTabBar.hxx index 3428597f563e..f3aa7c244db3 100644 --- a/sd/source/ui/inc/ViewTabBar.hxx +++ b/sd/source/ui/inc/ViewTabBar.hxx @@ -28,7 +28,6 @@ #include <vector> -namespace com::sun::star::drawing::framework { class XConfigurationController; } namespace com::sun::star::drawing::framework { class XResourceId; } namespace vcl { class Window; } @@ -37,6 +36,7 @@ namespace sd { class ViewShellBase; class ViewTabBar; } +namespace sd::framework { class ConfigurationController; } namespace sd { @@ -148,7 +148,7 @@ public: private: VclPtr<TabBarControl> mpTabControl; rtl::Reference<::sd::DrawController> mxController; - css::uno::Reference<css::drawing::framework::XConfigurationController> mxConfigurationController; + rtl::Reference<::sd::framework::ConfigurationController> mxConfigurationController; typedef ::std::vector<css::drawing::framework::TabBarButton> TabBarButtonList; TabBarButtonList maTabBarButtons; css::uno::Reference<css::drawing::framework::XResourceId> mxViewTabBarId; diff --git a/sd/source/ui/inc/framework/ConfigurationController.hxx b/sd/source/ui/inc/framework/ConfigurationController.hxx index f0f69cbf23e6..8390724f46f7 100644 --- a/sd/source/ui/inc/framework/ConfigurationController.hxx +++ b/sd/source/ui/inc/framework/ConfigurationController.hxx @@ -20,7 +20,10 @@ #pragma once #include <sddllapi.h> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> +#include <com/sun/star/drawing/framework/ResourceActivationMode.hpp> +#include <com/sun/star/drawing/framework/XConfigurationControllerRequestQueue.hpp> +#include <com/sun/star/drawing/framework/XConfigurationControllerBroadcaster.hpp> +#include <com/sun/star/drawing/framework/XResourceFactoryManager.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <cppuhelper/basemutex.hxx> @@ -33,14 +36,16 @@ namespace sd { class DrawController; } namespace sd::framework { -typedef ::cppu::WeakComponentImplHelper < - css::drawing::framework::XConfigurationController - > ConfigurationControllerInterfaceBase; +typedef ::cppu::WeakComponentImplHelper< + css::drawing::framework::XConfigurationControllerRequestQueue, + css::drawing::framework::XConfigurationControllerBroadcaster, + css::drawing::framework::XResourceFactoryManager +> ConfigurationControllerInterfaceBase; /** The configuration controller is responsible for maintaining the current configuration. - @see css::drawing::framework::XConfigurationController + @see ConfigurationController for an extended documentation. */ class SD_DLLPUBLIC ConfigurationController final @@ -68,37 +73,33 @@ public: */ void RequestSynchronousUpdate(); - // XConfigurationController + void lock(); - virtual void SAL_CALL lock() override; + void unlock(); - virtual void SAL_CALL unlock() override; - - virtual void SAL_CALL requestResourceActivation ( + void requestResourceActivation ( const css::uno::Reference<css::drawing::framework::XResourceId>& rxResourceId, - css::drawing::framework::ResourceActivationMode eMode) override; + css::drawing::framework::ResourceActivationMode eMode); - virtual void SAL_CALL requestResourceDeactivation ( + void requestResourceDeactivation ( const css::uno::Reference<css::drawing::framework::XResourceId>& - rxResourceId) override; + rxResourceId); - virtual css::uno::Reference<css::drawing::framework::XResource> - SAL_CALL getResource ( - const css::uno::Reference<css::drawing::framework::XResourceId>& rxResourceId) override; + css::uno::Reference<css::drawing::framework::XResource> + getResource ( + const css::uno::Reference<css::drawing::framework::XResourceId>& rxResourceId); - virtual void SAL_CALL update() override; + void update(); - virtual css::uno::Reference< - css::drawing::framework::XConfiguration> - SAL_CALL getRequestedConfiguration() override; + css::uno::Reference<css::drawing::framework::XConfiguration> + getRequestedConfiguration(); - virtual css::uno::Reference< - css::drawing::framework::XConfiguration> - SAL_CALL getCurrentConfiguration() override; + css::uno::Reference<css::drawing::framework::XConfiguration> + getCurrentConfiguration(); - virtual void SAL_CALL restoreConfiguration ( + void restoreConfiguration ( const css::uno::Reference<css::drawing::framework::XConfiguration>& - rxConfiguration) override; + rxConfiguration); // XConfigurationControllerBroadcaster @@ -145,12 +146,10 @@ public: class Lock { public: - Lock (const css::uno::Reference< - css::drawing::framework::XConfigurationController>& rxController); + Lock (const rtl::Reference<ConfigurationController>& rxController); ~Lock(); private: - css::uno::Reference< - css::drawing::framework::XConfigurationController> mxController; + rtl::Reference<ConfigurationController> mxController; }; private: diff --git a/sd/source/ui/inc/framework/FrameworkHelper.hxx b/sd/source/ui/inc/framework/FrameworkHelper.hxx index 4bc3123356e5..a16843cc06ed 100644 --- a/sd/source/ui/inc/framework/FrameworkHelper.hxx +++ b/sd/source/ui/inc/framework/FrameworkHelper.hxx @@ -28,7 +28,6 @@ #include <memory> #include <mutex> -namespace com::sun::star::drawing::framework { class XConfigurationController; } namespace com::sun::star::drawing::framework { class XResourceId; } namespace com::sun::star::drawing::framework { class XView; } namespace com::sun::star::drawing::framework { struct ConfigurationChangeEvent; } @@ -39,6 +38,7 @@ class ViewShellBase; namespace sd::framework { +class ConfigurationController; /** The FrameworkHelper is a convenience class that simplifies the access to the drawing framework. @@ -283,7 +283,7 @@ public: const css::uno::Reference< css::drawing::framework::XResourceId>& rxAnchor); - const css::uno::Reference<css::drawing::framework::XConfigurationController>& + const rtl::Reference<ConfigurationController>& GetConfigurationController() const { return mxConfigurationController;} private: @@ -299,8 +299,7 @@ private: static std::mutex maInstanceMapMutex; ViewShellBase& mrBase; - css::uno::Reference<css::drawing::framework::XConfigurationController> - mxConfigurationController; + rtl::Reference<ConfigurationController> mxConfigurationController; class DisposeListener; friend class DisposeListener; diff --git a/sd/source/ui/inc/framework/factories/BasicToolBarFactory.hxx b/sd/source/ui/inc/framework/factories/BasicToolBarFactory.hxx index fc8b54c8e596..eba8de21f059 100644 --- a/sd/source/ui/inc/framework/factories/BasicToolBarFactory.hxx +++ b/sd/source/ui/inc/framework/factories/BasicToolBarFactory.hxx @@ -24,10 +24,11 @@ #include <comphelper/compbase.hxx> #include <rtl/ref.hxx> -namespace com::sun::star::drawing::framework { class XConfigurationController; } namespace sd { class DrawController; } -namespace sd::framework { +namespace sd::framework +{ +class ConfigurationController; typedef comphelper::WeakComponentImplHelper < css::drawing::framework::XResourceFactory, @@ -64,7 +65,7 @@ public: const css::lang::EventObject& rEventObject) override; private: - css::uno::Reference<css::drawing::framework::XConfigurationController> mxConfigurationController; + rtl::Reference<ConfigurationController> mxConfigurationController; rtl::Reference<::sd::DrawController> mxController; void Shutdown(); diff --git a/sd/source/ui/inc/framework/factories/BasicViewFactory.hxx b/sd/source/ui/inc/framework/factories/BasicViewFactory.hxx index f084eb41e1ac..3167974b7eb6 100644 --- a/sd/source/ui/inc/framework/factories/BasicViewFactory.hxx +++ b/sd/source/ui/inc/framework/factories/BasicViewFactory.hxx @@ -28,7 +28,6 @@ #include <vcl/vclptr.hxx> #include <memory> -namespace com::sun::star::drawing::framework { class XConfigurationController; } namespace com::sun::star::drawing::framework { class XPane; } namespace sd { @@ -41,6 +40,7 @@ class SfxViewFrame; namespace vcl { class Window; } namespace sd::framework { +class ConfigurationController; typedef comphelper::WeakComponentImplHelper < css::drawing::framework::XResourceFactory @@ -77,8 +77,7 @@ public: const css::uno::Reference<css::drawing::framework::XResource>& xView) override; private: - css::uno::Reference<css::drawing::framework::XConfigurationController> - mxConfigurationController; + rtl::Reference<ConfigurationController> mxConfigurationController; class ViewDescriptor; using ViewShellContainer = std::vector<std::shared_ptr<ViewDescriptor>>; ViewShellContainer maViewShellContainer; diff --git a/sd/source/ui/slideshow/PaneHider.cxx b/sd/source/ui/slideshow/PaneHider.cxx index 77c9c6f486af..f5138747f0e1 100644 --- a/sd/source/ui/slideshow/PaneHider.cxx +++ b/sd/source/ui/slideshow/PaneHider.cxx @@ -23,9 +23,9 @@ #include <ViewShellBase.hxx> #include <DrawController.hxx> #include "slideshowimpl.hxx" +#include <framework/ConfigurationController.hxx> #include <framework/FrameworkHelper.hxx> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/drawing/framework/XConfiguration.hpp> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/lang/DisposedException.hpp> diff --git a/sd/source/ui/slideshow/PaneHider.hxx b/sd/source/ui/slideshow/PaneHider.hxx index a2d3cabb0147..87251b105744 100644 --- a/sd/source/ui/slideshow/PaneHider.hxx +++ b/sd/source/ui/slideshow/PaneHider.hxx @@ -20,14 +20,15 @@ #pragma once #include <com/sun/star/uno/Reference.hxx> +#include <rtl/ref.hxx> namespace com::sun::star::drawing::framework { class XConfiguration; } -namespace com::sun::star::drawing::framework +namespace sd::framework { -class XConfigurationController; +class ConfigurationController; } namespace sd @@ -56,8 +57,7 @@ private: has been modified and have to be restored. */ - css::uno::Reference<css::drawing::framework::XConfigurationController> - mxConfigurationController; + rtl::Reference<sd::framework::ConfigurationController> mxConfigurationController; css::uno::Reference<css::drawing::framework::XConfiguration> mxConfiguration; }; diff --git a/sd/source/ui/tools/EventMultiplexer.cxx b/sd/source/ui/tools/EventMultiplexer.cxx index 20f3b6e5e518..530e46641f4e 100644 --- a/sd/source/ui/tools/EventMultiplexer.cxx +++ b/sd/source/ui/tools/EventMultiplexer.cxx @@ -216,7 +216,7 @@ EventMultiplexer::Implementation::Implementation (ViewShellBase& rBase) DrawController& rDrawController = *mrBase.GetDrawController(); rtl::Reference<sd::framework::ConfigurationController> xConfigurationController ( - rDrawController.getConfigurationControllerImpl()); + rDrawController.getConfigurationController()); mxConfigurationControllerWeak = xConfigurationController.get(); if (!xConfigurationController.is()) return; diff --git a/sd/source/ui/unoidl/DrawController.cxx b/sd/source/ui/unoidl/DrawController.cxx index a2a953161620..366a752ead96 100644 --- a/sd/source/ui/unoidl/DrawController.cxx +++ b/sd/source/ui/unoidl/DrawController.cxx @@ -550,7 +550,7 @@ void DrawController::ReleaseViewShellBase() mpBase = nullptr; } -Reference<XConfigurationController> +const rtl::Reference<framework::ConfigurationController> & DrawController::getConfigurationController() { ThrowIfDisposed(); @@ -558,14 +558,6 @@ Reference<XConfigurationController> return mxConfigurationController; } -const rtl::Reference<sd::framework::ConfigurationController> & - DrawController::getConfigurationControllerImpl() -{ - ThrowIfDisposed(); - - return mxConfigurationController; -} - Reference<XModuleController> DrawController::getModuleController() { ThrowIfDisposed(); diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 319ee4621a87..14407e327d4f 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -54,7 +54,6 @@ #include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> #include <com/sun/star/drawing/XMasterPagesSupplier.hpp> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/drawing/framework/ResourceId.hpp> #include <framework/FrameworkHelper.hxx> @@ -315,7 +314,7 @@ void ViewShellBase::LateInit (const OUString& rsDefaultView) try { rtl::Reference<::sd::DrawController> xControllerManager (GetDrawController()); - Reference<XConfigurationController> xConfigurationController; + rtl::Reference<::sd::framework::ConfigurationController> xConfigurationController; if (xControllerManager) xConfigurationController = xControllerManager->getConfigurationController(); if (xConfigurationController.is()) @@ -338,16 +337,10 @@ void ViewShellBase::LateInit (const OUString& rsDefaultView) // Process configuration events synchronously until the center view // has been created. - sd::framework::ConfigurationController* pConfigurationController - = dynamic_cast<sd::framework::ConfigurationController*>(xConfigurationController.get()); - if (pConfigurationController != nullptr) + while ( !xConfigurationController->getResource(xCenterViewId).is() + && xConfigurationController->hasPendingRequests()) { - while ( - ! pConfigurationController->getResource(xCenterViewId).is() - && pConfigurationController->hasPendingRequests()) - { - pConfigurationController->ProcessEvent(); - } + xConfigurationController->ProcessEvent(); } } } @@ -618,7 +611,7 @@ void ViewShellBase::Execute (SfxRequest& rRequest) DrawController* pDrawController(GetDrawController()); if (pDrawController) { - Reference<XConfigurationController> xConfigurationController ( + rtl::Reference<framework::ConfigurationController> xConfigurationController ( pDrawController->getConfigurationController()); if (xConfigurationController.is()) xConfigurationController->update(); @@ -775,7 +768,7 @@ void ViewShellBase::Activate (bool bIsMDIActivate) DrawController* pDrawController(GetDrawController()); if (pDrawController) { - Reference<XConfigurationController> xConfigurationController ( + rtl::Reference<framework::ConfigurationController> xConfigurationController ( pDrawController->getConfigurationController()); if (xConfigurationController.is()) xConfigurationController->update(); @@ -1333,7 +1326,7 @@ void ViewShellBase::Implementation::SetPaneVisibility ( pArguments->Get(nSlotId)).GetValue(); else { - Reference<XConfigurationController> xConfigurationController ( + rtl::Reference<sd::framework::ConfigurationController> xConfigurationController ( pDrawController->getConfigurationController()); if ( ! xConfigurationController.is()) throw RuntimeException(); @@ -1347,7 +1340,7 @@ void ViewShellBase::Implementation::SetPaneVisibility ( // Set the desired visibility state at the current configuration // and update it accordingly. - Reference<XConfigurationController> xConfigurationController ( + rtl::Reference<sd::framework::ConfigurationController> xConfigurationController ( pDrawController->getConfigurationController()); if ( ! xConfigurationController.is()) throw RuntimeException(); @@ -1378,7 +1371,7 @@ void ViewShellBase::Implementation::GetSlotState (SfxItemSet& rSet) DrawController* pDrawController(mrBase.GetDrawController()); if (!pDrawController) return; - Reference<XConfigurationController> xConfigurationController ( + rtl::Reference<sd::framework::ConfigurationController> xConfigurationController ( pDrawController->getConfigurationController()); if ( ! xConfigurationController.is()) throw RuntimeException(); diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx index 8c87e96d0989..f01359cc610c 100644 --- a/sd/source/ui/view/ViewTabBar.cxx +++ b/sd/source/ui/view/ViewTabBar.cxx @@ -20,6 +20,7 @@ #include <ViewTabBar.hxx> #include <ViewShellBase.hxx> +#include <framework/ConfigurationController.hxx> #include <framework/FrameworkHelper.hxx> #include <framework/Pane.hxx> #include <DrawController.hxx> @@ -73,7 +74,7 @@ ViewTabBar::ViewTabBar ( if (mxController) mpViewShellBase = mxController->GetViewShellBase(); - // Register as listener at XConfigurationController. + // Register as listener at ConfigurationController. if (mxController.is()) { mxConfigurationController = mxController->getConfigurationController(); @@ -113,7 +114,7 @@ void ViewTabBar::disposing(std::unique_lock<std::mutex>&) if (mxConfigurationController.is()) { - // Unregister listener from XConfigurationController. + // Unregister listener from ConfigurationController. try { mxConfigurationController->removeConfigurationChangeListener(this); @@ -161,7 +162,7 @@ vcl::Window* ViewTabBar::GetAnchorWindow( Reference<XPane> xPane; try { - Reference<XConfigurationController> xCC ( + rtl::Reference<framework::ConfigurationController> xCC ( rxController->getConfigurationController()); if (xCC.is()) xPane.set(xCC->getResource(rxViewTabBarId->getAnchor()), UNO_QUERY); @@ -202,7 +203,7 @@ void SAL_CALL ViewTabBar::notifyConfigurationChange ( void SAL_CALL ViewTabBar::disposing( const lang::EventObject& rEvent) { - if (rEvent.Source == mxConfigurationController) + if (rEvent.Source == cppu::getXWeak(mxConfigurationController.get())) { mxConfigurationController = nullptr; mxController = nullptr; @@ -259,7 +260,7 @@ bool ViewTabBar::ActivatePage(size_t nIndex) { try { - Reference<XConfigurationController> xConfigurationController ( + rtl::Reference<framework::ConfigurationController> xConfigurationController ( mxController->getConfigurationController()); if ( ! xConfigurationController.is()) throw RuntimeException(); diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index c9fd4840c51d..fa88ac6425c2 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -72,7 +72,7 @@ #include <ViewShellBase.hxx> #include <FormShellManager.hxx> #include <LayerTabBar.hxx> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> +#include <framework/ConfigurationController.hxx> #include <com/sun/star/drawing/framework/XConfiguration.hpp> #include <com/sun/star/drawing/XShape.hpp> #include <com/sun/star/frame/XFrame.hpp> @@ -384,8 +384,8 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) DrawController* pDrawController = GetViewShellBase().GetDrawController(); if (pDrawController) { - Reference<XConfigurationController> xConfigurationController ( - pDrawController->getConfigurationController(), UNO_SET_THROW ); + rtl::Reference<sd::framework::ConfigurationController> xConfigurationController ( + pDrawController->getConfigurationController() ); Reference<XConfiguration> xConfiguration ( xConfigurationController->getRequestedConfiguration(), UNO_SET_THROW ); @@ -407,7 +407,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) // Restore the configuration. if (auto pDrawController2 = dynamic_cast<DrawController*>( xController.get() )) { - xConfigurationController.set( pDrawController2->getConfigurationController() ); + xConfigurationController = pDrawController2->getConfigurationController(); if ( ! xConfigurationController.is()) throw RuntimeException(); xConfigurationController->restoreConfiguration(xConfiguration); diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index cbb19f4e9a74..b9cc4a7a10a4 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -19,6 +19,7 @@ #include <framework/FrameworkHelper.hxx> #include <framework/ViewShellWrapper.hxx> +#include <framework/ConfigurationController.hxx> #include <memory> #include <ViewShell.hxx> #include <ViewShellImplementation.hxx> @@ -93,7 +94,6 @@ #include <sdmod.hxx> #include <AccessibleDocumentViewBase.hxx> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/drawing/framework/XConfiguration.hpp> #include <com/sun/star/drawing/framework/XView.hpp> #include <com/sun/star/frame/XFrame.hpp> @@ -411,7 +411,7 @@ void ViewShell::BroadcastContextForActivation(const bool bIsActivated) if (!pDrawController) return {}; - Reference<::css::drawing::framework::XConfigurationController> xConfigurationController + rtl::Reference<sd::framework::ConfigurationController> xConfigurationController = pDrawController->getConfigurationController(); if (!xConfigurationController.is()) return {}; diff --git a/sd/workben/custompanel/ctp_panel.cxx b/sd/workben/custompanel/ctp_panel.cxx index ac174935888a..3a78c5d8bd10 100644 --- a/sd/workben/custompanel/ctp_panel.cxx +++ b/sd/workben/custompanel/ctp_panel.cxx @@ -40,7 +40,6 @@ namespace sd::colortoolpanel using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::uno::Type; - using ::com::sun::star::drawing::framework::XConfigurationController; using ::com::sun::star::drawing::framework::XResourceId; using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::drawing::framework::XPane; @@ -93,7 +92,7 @@ namespace sd::colortoolpanel //= class SingleColorPanel SingleColorPanel::SingleColorPanel( const Reference< XComponentContext >& i_rContext, - const Reference< XConfigurationController >& i_rConfigController, const Reference< XResourceId >& i_rResourceId ) + const rtl::Reference< ConfigurationController >& i_rConfigController, const Reference< XResourceId >& i_rResourceId ) :SingleColorPanel_Base( m_aMutex ) ,m_xContext( i_rContext ) ,m_xResourceId( i_rResourceId ) diff --git a/sd/workben/custompanel/ctp_panel.hxx b/sd/workben/custompanel/ctp_panel.hxx index a6d970693b70..03e844e31645 100644 --- a/sd/workben/custompanel/ctp_panel.hxx +++ b/sd/workben/custompanel/ctp_panel.hxx @@ -22,7 +22,6 @@ #include <com/sun/star/drawing/framework/XView.hpp> #include <com/sun/star/ui/XToolPanel.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/drawing/framework/XResourceId.hpp> #include <com/sun/star/awt/XPaintListener.hpp> @@ -44,7 +43,7 @@ namespace sd::colortoolpanel public: SingleColorPanel( const css::uno::Reference< css::uno::XComponentContext >& i_rContext, - const css::uno::Reference< css::drawing::framework::XConfigurationController >& i_rConfigController, + const rtl::Reference< ConfigurationController >& i_rConfigController, const css::uno::Reference< css::drawing::framework::XResourceId >& i_rResourceId );