diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-25 10:42:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-26 10:05:33 +0000 |
commit | 622cf1dfe5b4b0e8a5d97b397d44a7bc66a4d7e7 (patch) | |
tree | 2291f472d8fe3ea40991e3b957768aef0e532133 /sd | |
parent | d4237bfb17101c6158ff98a6930e03aec94df314 (diff) |
use more concrete types in sd
Change-Id: Ia2903695ddb451e21b0ed4e8d0a149d912558a4e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146158
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
4 files changed, 17 insertions, 17 deletions
diff --git a/sd/source/ui/framework/factories/PresentationFactory.cxx b/sd/source/ui/framework/factories/PresentationFactory.cxx index 60ebb6efd11c..b6dc735fdc07 100644 --- a/sd/source/ui/framework/factories/PresentationFactory.cxx +++ b/sd/source/ui/framework/factories/PresentationFactory.cxx @@ -71,7 +71,7 @@ private: constexpr OUStringLiteral gsPresentationViewURL = u"private:resource/view/Presentation"; PresentationFactory::PresentationFactory ( - const Reference<frame::XController>& rxController) + const rtl::Reference<::sd::DrawController>& rxController) : mxController(rxController) { } @@ -99,10 +99,9 @@ void SAL_CALL PresentationFactory::releaseResource ( { ThrowIfDisposed(); - auto pController = dynamic_cast<sd::DrawController*>(mxController.get()); - if (pController != nullptr) + if (mxController) { - ViewShellBase* pBase = pController->GetViewShellBase(); + ViewShellBase* pBase = mxController->GetViewShellBase(); if (pBase != nullptr) SlideShow::Stop( *pBase ); } @@ -129,13 +128,11 @@ void PresentationFactory::ThrowIfDisposed() const } } -void PresentationFactory::install(const Reference<frame::XController>& rxController) +void PresentationFactory::install(const rtl::Reference<::sd::DrawController>& rxController) { try { - // Get the XController from the first argument. - Reference<XControllerManager> xCM (rxController, UNO_QUERY_THROW); - Reference<XConfigurationController> xCC (xCM->getConfigurationController()); + Reference<XConfigurationController> xCC (rxController->getConfigurationController()); if (xCC.is()) xCC->addResourceFactory( gsPresentationViewURL, diff --git a/sd/source/ui/framework/module/ViewTabBarModule.cxx b/sd/source/ui/framework/module/ViewTabBarModule.cxx index 4f5dd4828535..163b7adb022b 100644 --- a/sd/source/ui/framework/module/ViewTabBarModule.cxx +++ b/sd/source/ui/framework/module/ViewTabBarModule.cxx @@ -20,6 +20,7 @@ #include "ViewTabBarModule.hxx" #include <framework/FrameworkHelper.hxx> +#include <DrawController.hxx> #include <com/sun/star/drawing/framework/XControllerManager.hpp> #include <com/sun/star/drawing/framework/XTabBar.hpp> #include <com/sun/star/frame/XController.hpp> @@ -46,16 +47,14 @@ namespace sd::framework { //===== ViewTabBarModule ================================================== ViewTabBarModule::ViewTabBarModule ( - const Reference<frame::XController>& rxController, + const rtl::Reference<::sd::DrawController>& rxController, const Reference<XResourceId>& rxViewTabBarId) : mxViewTabBarId(rxViewTabBarId) { - Reference<XControllerManager> xControllerManager (rxController, UNO_QUERY); - - if (!xControllerManager.is()) + if (!rxController.is()) return; - mxConfigurationController = xControllerManager->getConfigurationController(); + mxConfigurationController = rxController->getConfigurationController(); if (!mxConfigurationController.is()) return; diff --git a/sd/source/ui/framework/module/ViewTabBarModule.hxx b/sd/source/ui/framework/module/ViewTabBarModule.hxx index bfb252b8d4ff..5a492dc324a0 100644 --- a/sd/source/ui/framework/module/ViewTabBarModule.hxx +++ b/sd/source/ui/framework/module/ViewTabBarModule.hxx @@ -21,10 +21,12 @@ #include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> #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 com::sun::star::frame { class XController; } +namespace sd { class DrawController; } namespace sd::framework { @@ -48,7 +50,7 @@ public: new module. */ ViewTabBarModule ( - const css::uno::Reference<css::frame::XController>& rxController, + const rtl::Reference<::sd::DrawController>& rxController, const css::uno::Reference< css::drawing::framework::XResourceId>& rxViewTabBarId); virtual ~ViewTabBarModule() override; diff --git a/sd/source/ui/inc/framework/PresentationFactory.hxx b/sd/source/ui/inc/framework/PresentationFactory.hxx index 261e6fd26332..fe984c401f04 100644 --- a/sd/source/ui/inc/framework/PresentationFactory.hxx +++ b/sd/source/ui/inc/framework/PresentationFactory.hxx @@ -22,8 +22,10 @@ #include <com/sun/star/drawing/framework/XResourceFactory.hpp> #include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> #include <comphelper/compbase.hxx> +#include <rtl/ref.hxx> namespace com::sun::star::frame { class XController; } +namespace sd { class DrawController; } namespace sd::framework { @@ -41,10 +43,10 @@ class PresentationFactory final { public: PresentationFactory ( - const css::uno::Reference<css::frame::XController>& rxController); + const rtl::Reference<::sd::DrawController>& rxController); virtual ~PresentationFactory() override; - static void install(const css::uno::Reference<css::frame::XController>& rxController); + static void install(const rtl::Reference<::sd::DrawController>& rxController); // XResourceFactory @@ -68,7 +70,7 @@ public: const css::lang::EventObject& rEventObject) override; private: - css::uno::Reference<css::frame::XController> mxController; + rtl::Reference<::sd::DrawController> mxController; /// @throws css::lang::DisposedException void ThrowIfDisposed() const; |