sd/source/console/PresenterPaneFactory.cxx | 15 ++++++++------- sd/source/console/PresenterPaneFactory.hxx | 4 +++- sd/source/console/PresenterScreen.cxx | 14 +++++++------- sd/source/console/PresenterScreen.hxx | 4 +++- sd/source/ui/inc/DrawController.hxx | 2 +- sd/source/ui/inc/framework/ConfigurationController.hxx | 3 ++- 6 files changed, 24 insertions(+), 18 deletions(-)
New commits: commit b97b725312767dc5baf0a80c00c2ceda0f8dfa57 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Sep 18 12:27:24 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Sep 18 21:33:39 2024 +0200 use more concrete UNO types in sd Change-Id: If731da0f4839dc98b0dab1fa61669b92d5cc70f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173610 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sd/source/console/PresenterPaneFactory.cxx b/sd/source/console/PresenterPaneFactory.cxx index 5001bdec3ca3..22626286637b 100644 --- a/sd/source/console/PresenterPaneFactory.cxx +++ b/sd/source/console/PresenterPaneFactory.cxx @@ -24,6 +24,7 @@ #include "PresenterPaneContainer.hxx" #include "PresenterSpritePane.hxx" #include <DrawController.hxx> +#include <framework/ConfigurationController.hxx> #include <com/sun/star/lang/XComponent.hpp> #include <utility> @@ -58,12 +59,12 @@ PresenterPaneFactory::PresenterPaneFactory ( void PresenterPaneFactory::Register (const rtl::Reference<::sd::DrawController>& rxController) { - Reference<XConfigurationController> xCC; + rtl::Reference<::sd::framework::ConfigurationController> xCC; try { // Get the configuration controller. - xCC.set(rxController->getConfigurationController()); - mxConfigurationControllerWeak = xCC; + xCC = rxController->getConfigurationControllerImpl(); + mxConfigurationControllerWeak = xCC.get(); if ( ! xCC.is()) { throw RuntimeException(); @@ -77,7 +78,7 @@ void PresenterPaneFactory::Register (const rtl::Reference<::sd::DrawController>& OSL_ASSERT(false); if (xCC.is()) xCC->removeResourceFactoryForReference(this); - mxConfigurationControllerWeak = WeakReference<XConfigurationController>(); + mxConfigurationControllerWeak.clear(); throw; } @@ -89,10 +90,10 @@ PresenterPaneFactory::~PresenterPaneFactory() void SAL_CALL PresenterPaneFactory::disposing() { - Reference<XConfigurationController> xCC (mxConfigurationControllerWeak); + rtl::Reference<::sd::framework::ConfigurationController> xCC (mxConfigurationControllerWeak); if (xCC.is()) xCC->removeResourceFactoryForReference(this); - mxConfigurationControllerWeak = WeakReference<XConfigurationController>(); + mxConfigurationControllerWeak.clear(); // Dispose the panes in the cache. if (mpResourceCache != nullptr) @@ -190,7 +191,7 @@ Reference<XResource> PresenterPaneFactory::CreatePane ( if ( ! rxPaneId.is()) return nullptr; - Reference<XConfigurationController> xCC (mxConfigurationControllerWeak); + rtl::Reference<::sd::framework::ConfigurationController> xCC (mxConfigurationControllerWeak); if ( ! xCC.is()) return nullptr; diff --git a/sd/source/console/PresenterPaneFactory.hxx b/sd/source/console/PresenterPaneFactory.hxx index 1145cd5327af..3b00ae505dd8 100644 --- a/sd/source/console/PresenterPaneFactory.hxx +++ b/sd/source/console/PresenterPaneFactory.hxx @@ -28,10 +28,12 @@ #include <com/sun/star/drawing/framework/XResourceFactory.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <rtl/ref.hxx> +#include <unotools/weakref.hxx> #include <map> #include <memory> namespace sd { class DrawController; } +namespace sd::framework { class ConfigurationController; } namespace sdext::presenter { @@ -88,7 +90,7 @@ public: private: css::uno::WeakReference<css::uno::XComponentContext> mxComponentContextWeak; - css::uno::WeakReference<css::drawing::framework::XConfigurationController> + unotools::WeakReference<sd::framework::ConfigurationController> mxConfigurationControllerWeak; ::rtl::Reference<PresenterController> mpPresenterController; typedef ::std::map<OUString, css::uno::Reference<css::drawing::framework::XResource> > diff --git a/sd/source/console/PresenterScreen.cxx b/sd/source/console/PresenterScreen.cxx index 2b9b4bf2e5e7..ab46c2988c8a 100644 --- a/sd/source/console/PresenterScreen.cxx +++ b/sd/source/console/PresenterScreen.cxx @@ -27,6 +27,7 @@ #include "PresenterViewFactory.hxx" #include "PresenterWindowManager.hxx" #include <DrawController.hxx> +#include <framework/ConfigurationController.hxx> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/drawing/framework/ResourceId.hpp> @@ -257,7 +258,6 @@ PresenterScreen::PresenterScreen ( : PresenterScreenInterfaceBase(m_aMutex) , mxModel(std::move(xModel)) , mxController() -, mxConfigurationControllerWeak() , mxContextWeak(rxContext) , mpPresenterController() , mxSavedConfiguration() @@ -298,12 +298,12 @@ bool PresenterScreen::isPresenterScreenFullScreen(const css::uno::Reference<css: void SAL_CALL PresenterScreen::disposing() { - Reference<XConfigurationController> xCC (mxConfigurationControllerWeak); + rtl::Reference<::sd::framework::ConfigurationController> xCC (mxConfigurationControllerWeak); if (xCC.is() && mxSavedConfiguration.is()) { xCC->restoreConfiguration(mxSavedConfiguration); } - mxConfigurationControllerWeak = Reference<XConfigurationController>(nullptr); + mxConfigurationControllerWeak.clear(); Reference<lang::XComponent> xViewFactoryComponent (mxViewFactory, UNO_QUERY); if (xViewFactoryComponent.is()) @@ -359,8 +359,8 @@ void PresenterScreen::InitializePresenterScreen() } // Get the XController from the first argument. - Reference<XConfigurationController> xCC( mxController->getConfigurationController()); - mxConfigurationControllerWeak = xCC; + rtl::Reference<::sd::framework::ConfigurationController> xCC( mxController->getConfigurationControllerImpl()); + mxConfigurationControllerWeak = xCC.get(); Reference<drawing::framework::XResourceId> xMainPaneId( GetMainPaneId(xPresentation, xContext)); @@ -590,7 +590,7 @@ void PresenterScreen::RequestShutdownPresenterScreen() // Restore the configuration that was active before the presenter screen // has been activated. Now, that the presenter screen is displayed in // its own top level window this probably not necessary, but one never knows. - Reference<XConfigurationController> xCC (mxConfigurationControllerWeak); + rtl::Reference<::sd::framework::ConfigurationController> xCC (mxConfigurationControllerWeak); if (xCC.is() && mxSavedConfiguration.is()) { xCC->restoreConfiguration(mxSavedConfiguration); @@ -842,7 +842,7 @@ void PresenterScreen::SetupView( const OUString& rsViewURL, const PresenterPaneContainer::ViewInitializationFunction& rViewInitialization) { - Reference<XConfigurationController> xCC (mxConfigurationControllerWeak); + rtl::Reference<::sd::framework::ConfigurationController> xCC (mxConfigurationControllerWeak); if (!xCC.is()) return; diff --git a/sd/source/console/PresenterScreen.hxx b/sd/source/console/PresenterScreen.hxx index 907d48a12e78..3bbdcdac2348 100644 --- a/sd/source/console/PresenterScreen.hxx +++ b/sd/source/console/PresenterScreen.hxx @@ -31,11 +31,13 @@ #include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/presentation/XPresentation2.hpp> #include <rtl/ref.hxx> +#include <unotools/weakref.hxx> #include <map> #include <string_view> namespace sd { class DrawController; } +namespace sd::framework { class ConfigurationController; } namespace sdext::presenter { @@ -132,7 +134,7 @@ public: private: css::uno::Reference<css::frame::XModel2 > mxModel; rtl::Reference<::sd::DrawController> mxController; - css::uno::WeakReference<css::drawing::framework::XConfigurationController> + unotools::WeakReference<::sd::framework::ConfigurationController> mxConfigurationControllerWeak; css::uno::WeakReference<css::uno::XComponentContext> mxContextWeak; ::rtl::Reference<PresenterController> mpPresenterController; diff --git a/sd/source/ui/inc/DrawController.hxx b/sd/source/ui/inc/DrawController.hxx index f856df0d00b2..bf69b3705274 100644 --- a/sd/source/ui/inc/DrawController.hxx +++ b/sd/source/ui/inc/DrawController.hxx @@ -223,7 +223,7 @@ public: virtual css::uno::Reference<css::drawing::framework::XModuleController> SAL_CALL getModuleController() override; - rtl::Reference<sd::framework::ConfigurationController> getConfigurationControllerImpl(); + SD_DLLPUBLIC rtl::Reference<sd::framework::ConfigurationController> getConfigurationControllerImpl(); private: /** This method must return the name to index table. This table diff --git a/sd/source/ui/inc/framework/ConfigurationController.hxx b/sd/source/ui/inc/framework/ConfigurationController.hxx index 3cff9d403972..1975b5fa2257 100644 --- a/sd/source/ui/inc/framework/ConfigurationController.hxx +++ b/sd/source/ui/inc/framework/ConfigurationController.hxx @@ -19,6 +19,7 @@ #pragma once +#include <sddllapi.h> #include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/lang/XInitialization.hpp> @@ -48,7 +49,7 @@ typedef ::cppu::WeakComponentImplHelper < @see css::drawing::framework::XConfigurationController for an extended documentation. */ -class ConfigurationController final +class SD_DLLPUBLIC ConfigurationController final : private cppu::BaseMutex, public ConfigurationControllerInterfaceBase {