sd/source/console/PresenterController.cxx    |    9 ++++-----
 sd/source/console/PresenterController.hxx    |    6 ++++--
 sd/source/console/PresenterHelpView.cxx      |    7 +++----
 sd/source/console/PresenterHelpView.hxx      |    2 +-
 sd/source/console/PresenterNotesView.cxx     |    7 +++----
 sd/source/console/PresenterNotesView.hxx     |    4 +++-
 sd/source/console/PresenterPaneFactory.cxx   |    9 ++++-----
 sd/source/console/PresenterPaneFactory.hxx   |    6 ++++--
 sd/source/console/PresenterScreen.cxx        |   12 ++++++------
 sd/source/console/PresenterScreen.hxx        |    4 +++-
 sd/source/console/PresenterSlideShowView.cxx |    7 +++----
 sd/source/console/PresenterSlideShowView.hxx |    4 ++--
 sd/source/console/PresenterSlideSorter.cxx   |   10 ++++------
 sd/source/console/PresenterSlideSorter.hxx   |    2 +-
 sd/source/console/PresenterToolBar.cxx       |    7 +++----
 sd/source/console/PresenterToolBar.hxx       |    2 +-
 sd/source/console/PresenterViewFactory.cxx   |   21 ++++++++++-----------
 sd/source/console/PresenterViewFactory.hxx   |   11 +++++++----
 sd/source/ui/inc/DrawController.hxx          |    3 ++-
 19 files changed, 68 insertions(+), 65 deletions(-)

New commits:
commit 4b1d750f9cf953f6483f13e0a4d1901800d417ce
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Jan 25 15:20:21 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Jan 26 10:05:41 2023 +0000

    use more concrete types in sd console
    
    Change-Id: I5ac9d084616563ba3ae67ee040b4f52156baea67
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146159
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sd/source/console/PresenterController.cxx 
b/sd/source/console/PresenterController.cxx
index e9831ac749d5..39ed5506960d 100644
--- a/sd/source/console/PresenterController.cxx
+++ b/sd/source/console/PresenterController.cxx
@@ -32,6 +32,7 @@
 #include "PresenterTheme.hxx"
 #include "PresenterViewFactory.hxx"
 #include "PresenterWindowManager.hxx"
+#include <DrawController.hxx>
 
 #include <com/sun/star/awt/Key.hpp>
 #include <com/sun/star/awt/KeyModifier.hpp>
@@ -41,7 +42,6 @@
 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
 #include <com/sun/star/drawing/framework/ResourceActivationMode.hpp>
 #include <com/sun/star/drawing/framework/ResourceId.hpp>
-#include <com/sun/star/drawing/framework/XControllerManager.hpp>
 #include <com/sun/star/frame/FrameSearchFlag.hpp>
 #include <com/sun/star/frame/XDispatchProvider.hpp>
 #include <com/sun/star/presentation/AnimationEffect.hpp>
@@ -85,7 +85,7 @@ PresenterController::InstanceContainer 
PresenterController::maInstances;
 PresenterController::PresenterController (
     unotools::WeakReference<PresenterScreen> xScreen,
     const Reference<XComponentContext>& rxContext,
-    const Reference<frame::XController>& rxController,
+    const rtl::Reference<::sd::DrawController>& rxController,
     const Reference<presentation::XSlideShowController>& rxSlideShowController,
     rtl::Reference<PresenterPaneContainer> xPaneContainer,
     const Reference<XResourceId>& rxMainPaneId)
@@ -113,8 +113,7 @@ PresenterController::PresenterController (
     new PresenterCurrentSlideObserver(this,rxSlideShowController);
 
     // Listen for configuration changes.
-    Reference<XControllerManager> xCM (mxController, UNO_QUERY_THROW);
-    mxConfigurationController = xCM->getConfigurationController();
+    mxConfigurationController = mxController->getConfigurationController();
     if (mxConfigurationController.is())
     {
         mxConfigurationController->addConfigurationChangeListener(
@@ -772,7 +771,7 @@ void SAL_CALL 
PresenterController::notifyConfigurationChange (
 void SAL_CALL PresenterController::disposing (
     const lang::EventObject& rEvent)
 {
-    if (rEvent.Source == mxController)
+    if (rEvent.Source.get() == 
static_cast<cppu::OWeakObject*>(mxController.get()))
         mxController = nullptr;
     else if (rEvent.Source == mxConfigurationController)
         mxConfigurationController = nullptr;
diff --git a/sd/source/console/PresenterController.hxx 
b/sd/source/console/PresenterController.hxx
index f29970c6903d..a4d7993eecda 100644
--- a/sd/source/console/PresenterController.hxx
+++ b/sd/source/console/PresenterController.hxx
@@ -42,6 +42,8 @@
 #include <map>
 #include <memory>
 
+namespace sd { class DrawController; }
+
 namespace sdext::presenter {
 
 class PresenterCanvasHelper;
@@ -85,7 +87,7 @@ public:
     PresenterController (
         unotools::WeakReference<PresenterScreen> xScreen,
         const css::uno::Reference<css::uno::XComponentContext>& rxContext,
-        const css::uno::Reference<css::frame::XController>& rxController,
+        const rtl::Reference<::sd::DrawController>& rxController,
         const css::uno::Reference<css::presentation::XSlideShowController>& 
rxSlideShowController,
         rtl::Reference<PresenterPaneContainer> xPaneContainer,
         const css::uno::Reference<css::drawing::framework::XResourceId>& 
rxMainPaneId);
@@ -176,7 +178,7 @@ private:
     unotools::WeakReference<PresenterScreen> mxScreen;
     css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
     css::uno::Reference<css::rendering::XSpriteCanvas> mxCanvas;
-    css::uno::Reference<css::frame::XController> mxController;
+    rtl::Reference<::sd::DrawController> mxController;
     css::uno::Reference<css::drawing::framework::XConfigurationController>
         mxConfigurationController;
     css::uno::Reference<css::presentation::XSlideShowController> 
mxSlideShowController;
diff --git a/sd/source/console/PresenterHelpView.cxx 
b/sd/source/console/PresenterHelpView.cxx
index bdfa1ab37fb9..b4f3477e33be 100644
--- a/sd/source/console/PresenterHelpView.cxx
+++ b/sd/source/console/PresenterHelpView.cxx
@@ -23,10 +23,10 @@
 #include "PresenterButton.hxx"
 #include "PresenterCanvasHelper.hxx"
 #include "PresenterGeometryHelper.hxx"
+#include <DrawController.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/drawing/framework/XControllerManager.hpp>
 #include <com/sun/star/rendering/CompositeOperation.hpp>
 #include <com/sun/star/rendering/TextDirection.hpp>
 #include <com/sun/star/util/Color.hpp>
@@ -121,7 +121,7 @@ class PresenterHelpView::TextContainer : public 
vector<std::shared_ptr<Block> >
 PresenterHelpView::PresenterHelpView (
     const Reference<uno::XComponentContext>& rxContext,
     const Reference<XResourceId>& rxViewId,
-    const Reference<frame::XController>& rxController,
+    const rtl::Reference<::sd::DrawController>& rxController,
     ::rtl::Reference<PresenterController> xPresenterController)
     : PresenterHelpViewInterfaceBase(m_aMutex),
       mxComponentContext(rxContext),
@@ -133,9 +133,8 @@ PresenterHelpView::PresenterHelpView (
     try
     {
         // Get the content window via the pane anchor.
-        Reference<XControllerManager> xCM (rxController, UNO_QUERY_THROW);
         Reference<XConfigurationController> xCC (
-            xCM->getConfigurationController(), UNO_SET_THROW);
+            rxController->getConfigurationController(), UNO_SET_THROW);
         mxPane.set(xCC->getResource(rxViewId->getAnchor()), UNO_QUERY_THROW);
 
         mxWindow = mxPane->getWindow();
diff --git a/sd/source/console/PresenterHelpView.hxx 
b/sd/source/console/PresenterHelpView.hxx
index 2d147c346576..e342e2c9945e 100644
--- a/sd/source/console/PresenterHelpView.hxx
+++ b/sd/source/console/PresenterHelpView.hxx
@@ -50,7 +50,7 @@ public:
     explicit PresenterHelpView (
         const css::uno::Reference<css::uno::XComponentContext>& rxContext,
         const css::uno::Reference<css::drawing::framework::XResourceId>& 
rxViewId,
-        const css::uno::Reference<css::frame::XController>& rxController,
+        const rtl::Reference<::sd::DrawController>& rxController,
         ::rtl::Reference<PresenterController> xPresenterController);
     virtual ~PresenterHelpView() override;
 
diff --git a/sd/source/console/PresenterNotesView.cxx 
b/sd/source/console/PresenterNotesView.cxx
index 457be1f612b7..b9295b51a60d 100644
--- a/sd/source/console/PresenterNotesView.cxx
+++ b/sd/source/console/PresenterNotesView.cxx
@@ -25,11 +25,11 @@
 #include "PresenterPaintManager.hxx"
 #include "PresenterScrollBar.hxx"
 #include "PresenterTextView.hxx"
+#include <DrawController.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/XControllerManager.hpp>
 #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
 #include <com/sun/star/drawing/framework/XPane.hpp>
 #include <com/sun/star/lang/XServiceName.hpp>
@@ -53,7 +53,7 @@ namespace sdext::presenter {
 PresenterNotesView::PresenterNotesView (
     const Reference<XComponentContext>& rxComponentContext,
     const Reference<XResourceId>& rxViewId,
-    const Reference<frame::XController>& rxController,
+    const ::rtl::Reference<::sd::DrawController>& rxController,
     const ::rtl::Reference<PresenterController>& rpPresenterController)
     : PresenterNotesViewInterfaceBase(m_aMutex),
       mxViewId(rxViewId),
@@ -64,8 +64,7 @@ PresenterNotesView::PresenterNotesView (
 {
     try
     {
-        Reference<XControllerManager> xCM (rxController, UNO_QUERY_THROW);
-        Reference<XConfigurationController> xCC 
(xCM->getConfigurationController(), UNO_SET_THROW);
+        Reference<XConfigurationController> xCC 
(rxController->getConfigurationController(), UNO_SET_THROW);
         Reference<XPane> xPane (xCC->getResource(rxViewId->getAnchor()), 
UNO_QUERY_THROW);
 
         mxParentWindow = xPane->getWindow();
diff --git a/sd/source/console/PresenterNotesView.hxx 
b/sd/source/console/PresenterNotesView.hxx
index 1af3f241f004..e2f3139f4bda 100644
--- a/sd/source/console/PresenterNotesView.hxx
+++ b/sd/source/console/PresenterNotesView.hxx
@@ -34,6 +34,8 @@
 #include <rtl/ref.hxx>
 #include <memory>
 
+namespace sd { class DrawController; }
+
 namespace sdext::presenter {
 
 class PresenterButton;
@@ -61,7 +63,7 @@ public:
     explicit PresenterNotesView (
         const css::uno::Reference<css::uno::XComponentContext>& rxContext,
         const css::uno::Reference<css::drawing::framework::XResourceId>& 
rxViewId,
-        const css::uno::Reference<css::frame::XController>& rxController,
+        const ::rtl::Reference<::sd::DrawController>& rxController,
         const ::rtl::Reference<PresenterController>& rpPresenterController);
     virtual ~PresenterNotesView() override;
 
diff --git a/sd/source/console/PresenterPaneFactory.cxx 
b/sd/source/console/PresenterPaneFactory.cxx
index b779e950d478..822055b8ed8d 100644
--- a/sd/source/console/PresenterPaneFactory.cxx
+++ b/sd/source/console/PresenterPaneFactory.cxx
@@ -23,7 +23,7 @@
 #include "PresenterPaneBorderPainter.hxx"
 #include "PresenterPaneContainer.hxx"
 #include "PresenterSpritePane.hxx"
-#include <com/sun/star/drawing/framework/XControllerManager.hpp>
+#include <DrawController.hxx>
 #include <com/sun/star/lang/XComponent.hpp>
 #include <utility>
 
@@ -38,7 +38,7 @@ namespace sdext::presenter {
 
 Reference<drawing::framework::XResourceFactory> PresenterPaneFactory::Create (
     const Reference<uno::XComponentContext>& rxContext,
-    const Reference<frame::XController>& rxController,
+    const rtl::Reference<::sd::DrawController>& rxController,
     const ::rtl::Reference<PresenterController>& rpPresenterController)
 {
     rtl::Reference<PresenterPaneFactory> pFactory (
@@ -56,14 +56,13 @@ PresenterPaneFactory::PresenterPaneFactory (
 {
 }
 
-void PresenterPaneFactory::Register (const Reference<frame::XController>& 
rxController)
+void PresenterPaneFactory::Register (const 
rtl::Reference<::sd::DrawController>& rxController)
 {
     Reference<XConfigurationController> xCC;
     try
     {
         // Get the configuration controller.
-        Reference<XControllerManager> xCM (rxController, UNO_QUERY_THROW);
-        xCC.set(xCM->getConfigurationController());
+        xCC.set(rxController->getConfigurationController());
         mxConfigurationControllerWeak = xCC;
         if ( ! xCC.is())
         {
diff --git a/sd/source/console/PresenterPaneFactory.hxx 
b/sd/source/console/PresenterPaneFactory.hxx
index 306db4a4f626..5685dca06826 100644
--- a/sd/source/console/PresenterPaneFactory.hxx
+++ b/sd/source/console/PresenterPaneFactory.hxx
@@ -31,6 +31,8 @@
 #include <map>
 #include <memory>
 
+namespace sd { class DrawController; }
+
 namespace sdext::presenter {
 
 class PresenterController;
@@ -66,7 +68,7 @@ public:
     */
     static css::uno::Reference<css::drawing::framework::XResourceFactory> 
Create (
         const css::uno::Reference<css::uno::XComponentContext>& rxContext,
-        const css::uno::Reference<css::frame::XController>& rxController,
+        const rtl::Reference<::sd::DrawController>& rxController,
         const ::rtl::Reference<PresenterController>& rpPresenterController);
     virtual ~PresenterPaneFactory() override;
 
@@ -97,7 +99,7 @@ private:
         const css::uno::Reference<css::uno::XComponentContext>& rxContext,
         ::rtl::Reference<PresenterController> xPresenterController);
 
-    void Register (const css::uno::Reference<css::frame::XController>& 
rxController);
+    void Register (const rtl::Reference<::sd::DrawController>& rxController);
 
     css::uno::Reference<css::drawing::framework::XResource> CreatePane (
         const css::uno::Reference<css::drawing::framework::XResourceId>& 
rxPaneId);
diff --git a/sd/source/console/PresenterScreen.cxx 
b/sd/source/console/PresenterScreen.cxx
index 8337839af09b..cd6c20d38cc5 100644
--- a/sd/source/console/PresenterScreen.cxx
+++ b/sd/source/console/PresenterScreen.cxx
@@ -26,9 +26,9 @@
 #include "PresenterPaneFactory.hxx"
 #include "PresenterViewFactory.hxx"
 #include "PresenterWindowManager.hxx"
+#include <DrawController.hxx>
 #include <com/sun/star/frame/XController.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/drawing/framework/XControllerManager.hpp>
 #include <com/sun/star/drawing/framework/ResourceId.hpp>
 #include <com/sun/star/drawing/framework/ResourceActivationMode.hpp>
 #include <com/sun/star/presentation/XPresentation2.hpp>
@@ -316,24 +316,24 @@ void PresenterScreen::InitializePresenterScreen()
             return;
 
         // find first controller that is not the current controller (the one 
with the slideshow
-        mxController = mxModel->getCurrentController();
+        auto tmpController = mxModel->getCurrentController();
         Reference< container::XEnumeration > xEnum( mxModel->getControllers() 
);
         if( xEnum.is() )
         {
             while( xEnum->hasMoreElements() )
             {
                 Reference< frame::XController > xC( xEnum->nextElement(), 
UNO_QUERY );
-                if( xC.is() && (xC != mxController) )
+                if( xC.is() && (xC.get() != tmpController.get()) )
                 {
-                    mxController = xC;
+                    mxController = 
dynamic_cast<::sd::DrawController*>(xC.get());
+                    assert(bool(mxController) == bool(xC) && "only support 
instances of type DrawController");
                     break;
                 }
             }
         }
         // Get the XController from the first argument.
-        Reference<XControllerManager> xCM(mxController, UNO_QUERY_THROW);
 
-        Reference<XConfigurationController> xCC( 
xCM->getConfigurationController());
+        Reference<XConfigurationController> xCC( 
mxController->getConfigurationController());
         mxConfigurationControllerWeak = xCC;
 
         Reference<drawing::framework::XResourceId> xMainPaneId(
diff --git a/sd/source/console/PresenterScreen.hxx 
b/sd/source/console/PresenterScreen.hxx
index 3e4caf19442a..0445311b9603 100644
--- a/sd/source/console/PresenterScreen.hxx
+++ b/sd/source/console/PresenterScreen.hxx
@@ -35,6 +35,8 @@
 #include <map>
 #include <string_view>
 
+namespace sd { class DrawController; }
+
 namespace sdext::presenter {
 
 class PresenterController;
@@ -127,7 +129,7 @@ public:
 
 private:
     css::uno::Reference<css::frame::XModel2 > mxModel;
-    css::uno::Reference<css::frame::XController> mxController;
+    rtl::Reference<::sd::DrawController> mxController;
     css::uno::WeakReference<css::drawing::framework::XConfigurationController>
         mxConfigurationControllerWeak;
     css::uno::WeakReference<css::uno::XComponentContext> mxContextWeak;
diff --git a/sd/source/console/PresenterSlideShowView.cxx 
b/sd/source/console/PresenterSlideShowView.cxx
index 132eaf35f85e..32693f116410 100644
--- a/sd/source/console/PresenterSlideShowView.cxx
+++ b/sd/source/console/PresenterSlideShowView.cxx
@@ -23,6 +23,7 @@
 #include "PresenterGeometryHelper.hxx"
 #include "PresenterHelper.hxx"
 #include "PresenterPaneContainer.hxx"
+#include <DrawController.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/XWindow.hpp>
 #include <com/sun/star/awt/XWindowPeer.hpp>
 #include <com/sun/star/drawing/XPresenterHelper.hpp>
-#include <com/sun/star/drawing/framework/XControllerManager.hpp>
 #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
 #include <com/sun/star/rendering/CompositeOperation.hpp>
 #include <com/sun/star/rendering/TextDirection.hpp>
@@ -50,7 +50,7 @@ namespace sdext::presenter {
 PresenterSlideShowView::PresenterSlideShowView (
     css::uno::Reference<css::uno::XComponentContext> xContext,
     css::uno::Reference<css::drawing::framework::XResourceId> xViewId,
-    const css::uno::Reference<css::frame::XController>& rxController,
+    const rtl::Reference<::sd::DrawController>& rxController,
     ::rtl::Reference<PresenterController> xPresenterController)
     : PresenterSlideShowViewInterfaceBase(m_aMutex),
       mxComponentContext(std::move(xContext)),
@@ -87,8 +87,7 @@ void PresenterSlideShowView::LateInit()
 
     // Use view id and controller to retrieve window and canvas from
     // configuration controller.
-    Reference<XControllerManager> xCM (mxController, UNO_QUERY_THROW);
-    Reference<XConfigurationController> xCC 
(xCM->getConfigurationController());
+    Reference<XConfigurationController> xCC 
(mxController->getConfigurationController());
 
     if (xCC.is())
     {
diff --git a/sd/source/console/PresenterSlideShowView.hxx 
b/sd/source/console/PresenterSlideShowView.hxx
index e4466522eddf..1506f940ea4a 100644
--- a/sd/source/console/PresenterSlideShowView.hxx
+++ b/sd/source/console/PresenterSlideShowView.hxx
@@ -61,7 +61,7 @@ public:
     PresenterSlideShowView (
         css::uno::Reference<css::uno::XComponentContext> xContext,
         css::uno::Reference<css::drawing::framework::XResourceId> xViewId,
-        const css::uno::Reference<css::frame::XController>& rxController,
+        const rtl::Reference<::sd::DrawController>& rxController,
         ::rtl::Reference<PresenterController> xPresenterController);
     virtual ~PresenterSlideShowView() override;
     PresenterSlideShowView(const PresenterSlideShowView&) = delete;
@@ -176,7 +176,7 @@ private:
     css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
     ::rtl::Reference<PresenterController> mpPresenterController;
     css::uno::Reference<css::drawing::framework::XResourceId> mxViewId;
-    css::uno::Reference<css::frame::XController> mxController;
+    rtl::Reference<::sd::DrawController> mxController;
     css::uno::Reference<css::presentation::XSlideShowController> 
mxSlideShowController;
     css::uno::Reference<css::presentation::XSlideShow> mxSlideShow;
     css::uno::Reference<css::rendering::XCanvas> mxCanvas;
diff --git a/sd/source/console/PresenterSlideSorter.cxx 
b/sd/source/console/PresenterSlideSorter.cxx
index ef33a4dde634..911452036660 100644
--- a/sd/source/console/PresenterSlideSorter.cxx
+++ b/sd/source/console/PresenterSlideSorter.cxx
@@ -29,8 +29,8 @@
 #include "PresenterScrollBar.hxx"
 #include "PresenterUIPainter.hxx"
 #include "PresenterWindowManager.hxx"
+#include <DrawController.hxx>
 #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
-#include <com/sun/star/drawing/framework/XControllerManager.hpp>
 #include <com/sun/star/rendering/XBitmapCanvas.hpp>
 #include <com/sun/star/rendering/CompositeOperation.hpp>
 #include <com/sun/star/rendering/TextDirection.hpp>
@@ -228,7 +228,7 @@ private:
 PresenterSlideSorter::PresenterSlideSorter (
     const Reference<uno::XComponentContext>& rxContext,
     const Reference<XResourceId>& rxViewId,
-    const Reference<frame::XController>& rxController,
+    const rtl::Reference<::sd::DrawController>& rxController,
     const ::rtl::Reference<PresenterController>& rpPresenterController)
     : PresenterSlideSorterInterfaceBase(m_aMutex),
       mxComponentContext(rxContext),
@@ -255,9 +255,8 @@ PresenterSlideSorter::PresenterSlideSorter (
     try
     {
         // Get pane and window.
-        Reference<XControllerManager> xCM (rxController, UNO_QUERY_THROW);
         Reference<XConfigurationController> xCC (
-            xCM->getConfigurationController(), UNO_SET_THROW);
+            rxController->getConfigurationController(), UNO_SET_THROW);
         Reference<lang::XMultiComponentFactory> xFactory (
             mxComponentContext->getServiceManager(), UNO_SET_THROW);
 
@@ -323,8 +322,7 @@ PresenterSlideSorter::PresenterSlideSorter (
             mpPresenterController->GetPaintManager()));
 
         // Listen for changes of the current slide.
-        Reference<beans::XPropertySet> xControllerProperties (rxController, 
UNO_QUERY_THROW);
-        xControllerProperties->addPropertyChangeListener(
+        rxController->addPropertyChangeListener(
             "CurrentPage",
             this);
 
diff --git a/sd/source/console/PresenterSlideSorter.hxx 
b/sd/source/console/PresenterSlideSorter.hxx
index 807bc439929e..f1056fbeba6b 100644
--- a/sd/source/console/PresenterSlideSorter.hxx
+++ b/sd/source/console/PresenterSlideSorter.hxx
@@ -65,7 +65,7 @@ public:
     PresenterSlideSorter (
         const css::uno::Reference<css::uno::XComponentContext>& rxContext,
         const css::uno::Reference<css::drawing::framework::XResourceId>& 
rxViewId,
-        const css::uno::Reference<css::frame::XController>& rxController,
+        const rtl::Reference<::sd::DrawController>& rxController,
         const ::rtl::Reference<PresenterController>& rpPresenterController);
     virtual ~PresenterSlideSorter() override;
 
diff --git a/sd/source/console/PresenterToolBar.cxx 
b/sd/source/console/PresenterToolBar.cxx
index 867459423d8e..e05b0d44194b 100644
--- a/sd/source/console/PresenterToolBar.cxx
+++ b/sd/source/console/PresenterToolBar.cxx
@@ -27,10 +27,10 @@
 #include "PresenterPaintManager.hxx"
 #include "PresenterTimer.hxx"
 #include "PresenterWindowManager.hxx"
+#include <DrawController.hxx>
 
 #include <cppuhelper/compbase.hxx>
 #include <com/sun/star/awt/XWindowPeer.hpp>
-#include <com/sun/star/drawing/framework/XControllerManager.hpp>
 #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
 #include <com/sun/star/drawing/framework/XPane.hpp>
 #include <com/sun/star/geometry/AffineMatrix2D.hpp>
@@ -1007,7 +1007,7 @@ void PresenterToolBar::ThrowIfDisposed() const
 PresenterToolBarView::PresenterToolBarView (
     const Reference<XComponentContext>& rxContext,
     const Reference<XResourceId>& rxViewId,
-    const Reference<frame::XController>& rxController,
+    const rtl::Reference<::sd::DrawController>& rxController,
     const ::rtl::Reference<PresenterController>& rpPresenterController)
     : PresenterToolBarViewInterfaceBase(m_aMutex),
       mxViewId(rxViewId),
@@ -1015,8 +1015,7 @@ PresenterToolBarView::PresenterToolBarView (
 {
     try
     {
-        Reference<XControllerManager> xCM (rxController, UNO_QUERY_THROW);
-        Reference<XConfigurationController> 
xCC(xCM->getConfigurationController(),UNO_SET_THROW);
+        Reference<XConfigurationController> 
xCC(rxController->getConfigurationController(),UNO_SET_THROW);
         mxPane.set(xCC->getResource(rxViewId->getAnchor()), UNO_QUERY_THROW);
 
         mxWindow = mxPane->getWindow();
diff --git a/sd/source/console/PresenterToolBar.hxx 
b/sd/source/console/PresenterToolBar.hxx
index 1b789955689c..f95884ee9adc 100644
--- a/sd/source/console/PresenterToolBar.hxx
+++ b/sd/source/console/PresenterToolBar.hxx
@@ -200,7 +200,7 @@ public:
     explicit PresenterToolBarView (
         const css::uno::Reference<css::uno::XComponentContext>& rxContext,
         const css::uno::Reference<css::drawing::framework::XResourceId>& 
rxViewId,
-        const css::uno::Reference<css::frame::XController>& rxController,
+        const ::rtl::Reference<::sd::DrawController>& rxController,
         const ::rtl::Reference<PresenterController>& rpPresenterController);
     virtual ~PresenterToolBarView() override;
     PresenterToolBarView(const PresenterToolBarView&) = delete;
diff --git a/sd/source/console/PresenterViewFactory.cxx 
b/sd/source/console/PresenterViewFactory.cxx
index 06eff32f7d3f..8948b3fffa2a 100644
--- a/sd/source/console/PresenterViewFactory.cxx
+++ b/sd/source/console/PresenterViewFactory.cxx
@@ -25,7 +25,7 @@
 #include "PresenterSlidePreview.hxx"
 #include "PresenterSlideSorter.hxx"
 #include "PresenterToolBar.hxx"
-#include <com/sun/star/drawing/framework/XControllerManager.hpp>
+#include <DrawController.hxx>
 #include <utility>
 
 using namespace ::com::sun::star;
@@ -94,7 +94,7 @@ public:
 
 PresenterViewFactory::PresenterViewFactory (
     const Reference<uno::XComponentContext>& rxContext,
-    const Reference<frame::XController>& rxController,
+    const rtl::Reference<::sd::DrawController>& rxController,
     ::rtl::Reference<PresenterController> pPresenterController)
     : PresenterViewFactoryInterfaceBase(m_aMutex),
       mxComponentContext(rxContext),
@@ -105,7 +105,7 @@ PresenterViewFactory::PresenterViewFactory (
 
 Reference<drawing::framework::XResourceFactory> PresenterViewFactory::Create (
     const Reference<uno::XComponentContext>& rxContext,
-    const Reference<frame::XController>& rxController,
+    const rtl::Reference<::sd::DrawController>& rxController,
     const ::rtl::Reference<PresenterController>& rpPresenterController)
 {
     rtl::Reference<PresenterViewFactory> pFactory (
@@ -114,13 +114,12 @@ Reference<drawing::framework::XResourceFactory> 
PresenterViewFactory::Create (
     return Reference<drawing::framework::XResourceFactory>(pFactory);
 }
 
-void PresenterViewFactory::Register (const Reference<frame::XController>& 
rxController)
+void PresenterViewFactory::Register (const 
rtl::Reference<::sd::DrawController>& rxController)
 {
     try
     {
         // Get the configuration controller.
-        Reference<XControllerManager> xCM (rxController, UNO_QUERY_THROW);
-        mxConfigurationController = xCM->getConfigurationController();
+        mxConfigurationController = rxController->getConfigurationController();
         if ( ! mxConfigurationController.is())
         {
             throw RuntimeException();
@@ -350,7 +349,7 @@ Reference<XView> PresenterViewFactory::CreateSlideShowView(
             new PresenterSlideShowView(
                 mxComponentContext,
                 rxViewId,
-                Reference<frame::XController>(mxControllerWeak),
+                mxControllerWeak.get(),
                 mpPresenterController));
         pShowView->LateInit();
         xView = pShowView;
@@ -398,7 +397,7 @@ Reference<XView> PresenterViewFactory::CreateToolBarView(
     return new PresenterToolBarView(
         mxComponentContext,
         rxViewId,
-        Reference<frame::XController>(mxControllerWeak),
+        mxControllerWeak.get(),
         mpPresenterController);
 }
 
@@ -418,7 +417,7 @@ Reference<XView> PresenterViewFactory::CreateNotesView(
             new PresenterNotesView(
                 mxComponentContext,
                 rxViewId,
-                Reference<frame::XController>(mxControllerWeak),
+                mxControllerWeak.get(),
                 mpPresenterController)),
             UNO_QUERY_THROW);
     }
@@ -446,7 +445,7 @@ Reference<XView> 
PresenterViewFactory::CreateSlideSorterView(
             new PresenterSlideSorter(
                 mxComponentContext,
                 rxViewId,
-                Reference<frame::XController>(mxControllerWeak),
+                mxControllerWeak.get(),
                 mpPresenterController));
         xView = pView.get();
     }
@@ -464,7 +463,7 @@ Reference<XView> PresenterViewFactory::CreateHelpView(
     return Reference<XView>(new PresenterHelpView(
         mxComponentContext,
         rxViewId,
-        Reference<frame::XController>(mxControllerWeak),
+        mxControllerWeak.get(),
         mpPresenterController));
 }
 
diff --git a/sd/source/console/PresenterViewFactory.hxx 
b/sd/source/console/PresenterViewFactory.hxx
index 7f3468d4e57a..3f31342f2ce1 100644
--- a/sd/source/console/PresenterViewFactory.hxx
+++ b/sd/source/console/PresenterViewFactory.hxx
@@ -27,9 +27,12 @@
 #include <com/sun/star/drawing/framework/XResourceFactory.hpp>
 #include <com/sun/star/drawing/framework/XView.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
+#include <unotools/weakref.hxx>
 #include <rtl/ref.hxx>
 #include <memory>
 
+namespace sd { class DrawController; }
+
 namespace sdext::presenter {
 
 typedef ::cppu::WeakComponentImplHelper <
@@ -93,7 +96,7 @@ public:
     */
     static css::uno::Reference<css::drawing::framework::XResourceFactory> 
Create (
         const css::uno::Reference<css::uno::XComponentContext>& rxContext,
-        const css::uno::Reference<css::frame::XController>& rxController,
+        const ::rtl::Reference<::sd::DrawController>& rxController,
         const ::rtl::Reference<PresenterController>& rpPresenterController);
     virtual ~PresenterViewFactory() override;
 
@@ -113,7 +116,7 @@ private:
     css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
     css::uno::Reference<css::drawing::framework::XConfigurationController>
         mxConfigurationController;
-    css::uno::WeakReference<css::frame::XController> mxControllerWeak;
+    unotools::WeakReference<::sd::DrawController> mxControllerWeak;
     ::rtl::Reference<PresenterController> mpPresenterController;
     typedef ::std::pair<css::uno::Reference<css::drawing::framework::XView>,
         css::uno::Reference<css::drawing::framework::XPane> > 
ViewResourceDescriptor;
@@ -122,10 +125,10 @@ private:
 
     PresenterViewFactory (
         const css::uno::Reference<css::uno::XComponentContext>& rxContext,
-        const css::uno::Reference<css::frame::XController>& rxController,
+        const rtl::Reference<::sd::DrawController>& rxController,
         ::rtl::Reference<PresenterController> pPresenterController);
 
-    void Register (const css::uno::Reference<css::frame::XController>& 
rxController);
+    void Register (const ::rtl::Reference<::sd::DrawController>& rxController);
 
     css::uno::Reference<css::drawing::framework::XView> CreateSlideShowView(
         const css::uno::Reference<css::drawing::framework::XResourceId>& 
rxViewId) const;
diff --git a/sd/source/ui/inc/DrawController.hxx 
b/sd/source/ui/inc/DrawController.hxx
index bae71ee0f00e..940efff5bf18 100644
--- a/sd/source/ui/inc/DrawController.hxx
+++ b/sd/source/ui/inc/DrawController.hxx
@@ -19,6 +19,7 @@
 
 #pragma once
 
+#include <sddllapi.h>
 #include <cppuhelper/propshlp.hxx>
 #include <sfx2/sfxbasecontroller.hxx>
 #include <com/sun/star/view/XSelectionSupplier.hpp>
@@ -73,7 +74,7 @@ class ViewShellBase;
     The implementation of the XControllerManager interface is not yet in its
     final form.
 */
-class DrawController final
+class SD_DLLPUBLIC DrawController final
     : public DrawControllerInterfaceBase,
       private BroadcastHelperOwner,
       public ::cppu::OPropertySetHelper

Reply via email to