diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-09-18 11:08:14 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-09-18 21:33:11 +0200 |
commit | 77a58b5f7c85e8036606791ee6fe2fb763eaab0d (patch) | |
tree | 78c135ebccf04b575d646eee055928c5077b398d | |
parent | 20c7dd09f2485838a0d230efe0a1c36d5b22723f (diff) |
use more concrete UNO types in sd
Change-Id: I07e1db5a771c0a2391afbd715c91ea5919e19ac0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173606
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sd/source/ui/inc/DrawController.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/tools/EventMultiplexer.cxx | 24 | ||||
-rw-r--r-- | sd/source/ui/unoidl/DrawController.cxx | 8 |
3 files changed, 20 insertions, 14 deletions
diff --git a/sd/source/ui/inc/DrawController.hxx b/sd/source/ui/inc/DrawController.hxx index c935888fa92c..f856df0d00b2 100644 --- a/sd/source/ui/inc/DrawController.hxx +++ b/sd/source/ui/inc/DrawController.hxx @@ -223,6 +223,8 @@ public: virtual css::uno::Reference<css::drawing::framework::XModuleController> SAL_CALL getModuleController() override; + 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/tools/EventMultiplexer.cxx b/sd/source/ui/tools/EventMultiplexer.cxx index 5e20b9cc1f33..20f3b6e5e518 100644 --- a/sd/source/ui/tools/EventMultiplexer.cxx +++ b/sd/source/ui/tools/EventMultiplexer.cxx @@ -24,6 +24,7 @@ #include <DrawController.hxx> #include <SlideSorterViewShell.hxx> #include <framework/FrameworkHelper.hxx> +#include <framework/ConfigurationController.hxx> #include <sal/log.hxx> #include <tools/debug.hxx> @@ -122,7 +123,7 @@ private: css::uno::WeakReference<css::frame::XController> mxControllerWeak; css::uno::WeakReference<css::frame::XFrame> mxFrameWeak; SdDrawDocument* mpDocument; - css::uno::WeakReference<css::drawing::framework::XConfigurationController> + unotools::WeakReference<sd::framework::ConfigurationController> mxConfigurationControllerWeak; void ReleaseListeners(); @@ -214,15 +215,13 @@ EventMultiplexer::Implementation::Implementation (ViewShellBase& rBase) // Listen for configuration changes. DrawController& rDrawController = *mrBase.GetDrawController(); - Reference<XConfigurationController> xConfigurationController ( - rDrawController.getConfigurationController()); - mxConfigurationControllerWeak = xConfigurationController; + rtl::Reference<sd::framework::ConfigurationController> xConfigurationController ( + rDrawController.getConfigurationControllerImpl()); + mxConfigurationControllerWeak = xConfigurationController.get(); if (!xConfigurationController.is()) return; - Reference<XComponent> xComponent (xConfigurationController, UNO_QUERY); - if (xComponent.is()) - xComponent->addEventListener(static_cast<beans::XPropertyChangeListener*>(this)); + xConfigurationController->addEventListener(static_cast<beans::XPropertyChangeListener*>(this)); xConfigurationController->addConfigurationChangeListener( this, @@ -268,13 +267,10 @@ void EventMultiplexer::Implementation::ReleaseListeners() } // Stop listening for configuration changes. - Reference<XConfigurationController> xConfigurationController (mxConfigurationControllerWeak); + rtl::Reference<sd::framework::ConfigurationController> xConfigurationController (mxConfigurationControllerWeak.get()); if (xConfigurationController.is()) { - Reference<XComponent> xComponent (xConfigurationController, UNO_QUERY); - if (xComponent.is()) - xComponent->removeEventListener(static_cast<beans::XPropertyChangeListener*>(this)); - + xConfigurationController->removeEventListener(static_cast<beans::XPropertyChangeListener*>(this)); xConfigurationController->removeConfigurationChangeListener(this); } } @@ -418,10 +414,10 @@ void SAL_CALL EventMultiplexer::Implementation::disposing ( } } - Reference<XConfigurationController> xConfigurationController ( + rtl::Reference<sd::framework::ConfigurationController> xConfigurationController ( mxConfigurationControllerWeak); if (xConfigurationController.is() - && rEventObject.Source == xConfigurationController) + && rEventObject.Source == cppu::getXWeak(xConfigurationController.get())) { mxConfigurationControllerWeak.clear(); } diff --git a/sd/source/ui/unoidl/DrawController.cxx b/sd/source/ui/unoidl/DrawController.cxx index 813b07477076..d35578616777 100644 --- a/sd/source/ui/unoidl/DrawController.cxx +++ b/sd/source/ui/unoidl/DrawController.cxx @@ -561,6 +561,14 @@ Reference<XConfigurationController> SAL_CALL return mxConfigurationController; } +rtl::Reference<sd::framework::ConfigurationController> + DrawController::getConfigurationControllerImpl() +{ + ThrowIfDisposed(); + + return mxConfigurationController; +} + Reference<XModuleController> SAL_CALL DrawController::getModuleController() { |