sd/source/ui/animations/CustomAnimationPane.cxx          |    2 -
 sd/source/ui/framework/factories/BasicViewFactory.cxx    |    4 +--
 sd/source/ui/framework/factories/PresentationFactory.cxx |   13 ++++-------
 sd/source/ui/framework/module/ViewTabBarModule.cxx       |    9 +++----
 sd/source/ui/framework/module/ViewTabBarModule.hxx       |    4 ++-
 sd/source/ui/inc/ViewShellBase.hxx                       |    2 -
 sd/source/ui/inc/framework/PresentationFactory.hxx       |    8 ++++---
 sd/source/ui/sidebar/LayoutMenu.cxx                      |   17 +++++++--------
 sd/source/ui/sidebar/MasterPagesSelector.cxx             |    2 -
 sd/source/ui/slideshow/SlideShowRestarter.cxx            |    2 -
 sd/source/ui/slideshow/slideshow.cxx                     |    2 -
 sd/source/ui/tools/EventMultiplexer.cxx                  |    2 -
 sd/source/ui/view/GraphicViewShellBase.cxx               |    2 -
 sd/source/ui/view/ImpressViewShellBase.cxx               |    3 --
 sd/source/ui/view/PresentationViewShellBase.cxx          |    2 -
 sd/source/ui/view/ViewShellBase.cxx                      |   11 +++++----
 sd/source/ui/view/drviews1.cxx                           |   12 +++++-----
 sd/source/ui/view/drviews5.cxx                           |    4 +--
 sd/source/ui/view/drviewsa.cxx                           |    2 -
 sd/source/ui/view/outlnvsh.cxx                           |    6 ++---
 sd/source/ui/view/sdview.cxx                             |    4 +--
 sd/source/ui/view/viewshel.cxx                           |    4 +--
 22 files changed, 59 insertions(+), 58 deletions(-)

New commits:
commit 622cf1dfe5b4b0e8a5d97b397d44a7bc66a4d7e7
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Jan 25 10:42:37 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Jan 26 10:05:33 2023 +0000

    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.gran...@collabora.co.uk>

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;
commit d4237bfb17101c6158ff98a6930e03aec94df314
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Jan 25 10:35:16 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Jan 26 10:05:24 2023 +0000

    GetDrawController should return pointer
    
    since it may be nullptr
    
    Change-Id: Id618ef6a25a8432024a67170a7d1402cb0fa6b8a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146157
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx 
b/sd/source/ui/animations/CustomAnimationPane.cxx
index 156eb3ee33a7..6578f3eb3c27 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -293,7 +293,7 @@ IMPL_LINK(CustomAnimationPane,EventMultiplexerListener,
             {
                 if( mrBase.GetMainViewShell()->GetShellType() == 
ViewShell::ST_IMPRESS )
                 {
-                    mxView.set(mrBase.GetDrawController(), UNO_QUERY);
+                    mxView = mrBase.GetDrawController();
                     onSelectionChanged();
                     onChangeCurrentPage();
                     break;
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx 
b/sd/source/ui/framework/factories/BasicViewFactory.cxx
index 30f642d9533b..313edb6627ec 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx
@@ -237,7 +237,7 @@ void SAL_CALL BasicViewFactory::releaseResource (const 
Reference<XResource>& rxV
 
         // With the view in the center pane the sub controller is
         // released, too.
-        mpBase->GetDrawController().SetSubController(
+        mpBase->GetDrawController()->SetSubController(
             Reference<drawing::XDrawSubController>());
 
         SfxViewShell* pSfxViewShell = pViewShell->GetViewShell();
@@ -485,7 +485,7 @@ void BasicViewFactory::ActivateCenterView (
     if (mpBase->GetDocShell()->IsInPlaceActive())
         mpBase->GetViewFrame()->Resize(true);
 
-    mpBase->GetDrawController().SetSubController(
+    mpBase->GetDrawController()->SetSubController(
         rpDescriptor->mpViewShell->CreateSubController());
 }
 
diff --git a/sd/source/ui/inc/ViewShellBase.hxx 
b/sd/source/ui/inc/ViewShellBase.hxx
index 7fc4af2a2da0..06b46514a487 100644
--- a/sd/source/ui/inc/ViewShellBase.hxx
+++ b/sd/source/ui/inc/ViewShellBase.hxx
@@ -198,7 +198,7 @@ public:
     std::shared_ptr<ToolBarManager> const & GetToolBarManager() const;
     std::shared_ptr<FormShellManager> const & GetFormShellManager() const;
 
-    DrawController& GetDrawController() const;
+    DrawController* GetDrawController() const;
 
     void SetViewTabBar (const ::rtl::Reference<ViewTabBar>& rViewTabBar);
 
diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx 
b/sd/source/ui/sidebar/LayoutMenu.cxx
index 26d26d507715..bb808be34ebb 100644
--- a/sd/source/ui/sidebar/LayoutMenu.cxx
+++ b/sd/source/ui/sidebar/LayoutMenu.cxx
@@ -507,14 +507,15 @@ void LayoutMenu::Fill()
     OUString sCenterPaneViewName;
     try
     {
-        Reference<XControllerManager> xControllerManager (
-            Reference<XWeak>(&mrBase.GetDrawController()), UNO_QUERY_THROW);
-        Reference<XResourceId> xPaneId (ResourceId::create(
-            ::comphelper::getProcessComponentContext(),
-            FrameworkHelper::msCenterPaneURL));
-        Reference<XView> xView 
(FrameworkHelper::Instance(mrBase)->GetView(xPaneId));
-        if (xView.is())
-            sCenterPaneViewName = xView->getResourceId()->getResourceURL();
+        if (mrBase.GetDrawController())
+        {
+            Reference<XResourceId> xPaneId (ResourceId::create(
+                ::comphelper::getProcessComponentContext(),
+                FrameworkHelper::msCenterPaneURL));
+            Reference<XView> xView 
(FrameworkHelper::Instance(mrBase)->GetView(xPaneId));
+            if (xView.is())
+                sCenterPaneViewName = xView->getResourceId()->getResourceURL();
+        }
     }
     catch (RuntimeException&)
     {}
diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx 
b/sd/source/ui/sidebar/MasterPagesSelector.cxx
index 884a955c1bc2..4dfc5f30bfc9 100644
--- a/sd/source/ui/sidebar/MasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx
@@ -259,7 +259,7 @@ void MasterPagesSelector::ExecuteCommand(const OString 
&rIdent)
                 sal_uInt16 nIndex = mxPreviewValueSet->GetSelectedItemId();
                 pDispatcher->Execute(SID_MASTERPAGE, SfxCallMode::SYNCHRON);
                 mxPreviewValueSet->SelectItem (nIndex);
-                mrBase.GetDrawController().setCurrentPage(xSelectedMaster);
+                mrBase.GetDrawController()->setCurrentPage(xSelectedMaster);
             }
         }
     }
diff --git a/sd/source/ui/slideshow/SlideShowRestarter.cxx 
b/sd/source/ui/slideshow/SlideShowRestarter.cxx
index 639d80c32e87..b46d1b3d0b84 100644
--- a/sd/source/ui/slideshow/SlideShowRestarter.cxx
+++ b/sd/source/ui/slideshow/SlideShowRestarter.cxx
@@ -132,7 +132,7 @@ void SlideShowRestarter::StartPresentation()
     //being called during the configuration update event on exit. At this point
     //newly created objects won't get disposed called on them, because the
     //disposer is doing its last execution of that now.
-    if (mpViewShellBase && mpViewShellBase->GetDrawController().IsDisposing())
+    if (mpViewShellBase && mpViewShellBase->GetDrawController()->IsDisposing())
         return;
 
     if (mpDispatcher == nullptr && mpViewShellBase!=nullptr)
diff --git a/sd/source/ui/slideshow/slideshow.cxx 
b/sd/source/ui/slideshow/slideshow.cxx
index 194cb3c62804..ec070d0919c7 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -736,7 +736,7 @@ void SAL_CALL SlideShow::end()
                 else
                 {
                     DrawController& rDrawController =
-                        mpCurrentViewShellBase->GetDrawController();
+                        *mpCurrentViewShellBase->GetDrawController();
                     rDrawController.setCurrentPage(
                         Reference<XDrawPage>(
                             mpDoc->GetSdPage(xController->getRestoreSlide(), 
PageKind::Standard)->getUnoPage(),
diff --git a/sd/source/ui/tools/EventMultiplexer.cxx 
b/sd/source/ui/tools/EventMultiplexer.cxx
index 26d43b9b6dc6..d106a937f284 100644
--- a/sd/source/ui/tools/EventMultiplexer.cxx
+++ b/sd/source/ui/tools/EventMultiplexer.cxx
@@ -211,7 +211,7 @@ EventMultiplexer::Implementation::Implementation 
(ViewShellBase& rBase)
         StartListening (*mpDocument);
 
     // Listen for configuration changes.
-    DrawController& rDrawController = mrBase.GetDrawController();
+    DrawController& rDrawController = *mrBase.GetDrawController();
 
     Reference<XConfigurationController> xConfigurationController (
         rDrawController.getConfigurationController());
diff --git a/sd/source/ui/view/GraphicViewShellBase.cxx 
b/sd/source/ui/view/GraphicViewShellBase.cxx
index 573c9fc2a058..98706271ebf9 100644
--- a/sd/source/ui/view/GraphicViewShellBase.cxx
+++ b/sd/source/ui/view/GraphicViewShellBase.cxx
@@ -85,7 +85,7 @@ void GraphicViewShellBase::Execute(SfxRequest& rRequest)
 
 void GraphicViewShellBase::InitializeFramework()
 {
-    rtl::Reference<sd::DrawController> xController(&GetDrawController());
+    rtl::Reference<sd::DrawController> xController(GetDrawController());
     sd::framework::DrawModule::Initialize(xController);
 }
 
diff --git a/sd/source/ui/view/ImpressViewShellBase.cxx 
b/sd/source/ui/view/ImpressViewShellBase.cxx
index 9b28213970ec..c28a00e7989d 100644
--- a/sd/source/ui/view/ImpressViewShellBase.cxx
+++ b/sd/source/ui/view/ImpressViewShellBase.cxx
@@ -88,8 +88,7 @@ void ImpressViewShellBase::Execute (SfxRequest& rRequest)
 
 void ImpressViewShellBase::InitializeFramework()
 {
-    rtl::Reference<sd::DrawController>
-        xController (&GetDrawController());
+    rtl::Reference<sd::DrawController> xController(GetDrawController());
     sd::framework::ImpressModule::Initialize(xController);
 }
 
diff --git a/sd/source/ui/view/PresentationViewShellBase.cxx 
b/sd/source/ui/view/PresentationViewShellBase.cxx
index 9c1faff02713..5a0f13d75881 100644
--- a/sd/source/ui/view/PresentationViewShellBase.cxx
+++ b/sd/source/ui/view/PresentationViewShellBase.cxx
@@ -85,7 +85,7 @@ PresentationViewShellBase::~PresentationViewShellBase()
 
 void PresentationViewShellBase::InitializeFramework()
 {
-    rtl::Reference<sd::DrawController> xController (&GetDrawController());
+    rtl::Reference<sd::DrawController> xController (GetDrawController());
     sd::framework::PresentationModule::Initialize(xController);
 }
 
diff --git a/sd/source/ui/view/ViewShellBase.cxx 
b/sd/source/ui/view/ViewShellBase.cxx
index 3bebad697786..a3a154ce0ee6 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -306,9 +306,10 @@ void ViewShellBase::LateInit (const OUString& 
rsDefaultView)
 
     try
     {
-        Reference<XControllerManager> xControllerManager (GetDrawController(), 
UNO_QUERY_THROW);
-        Reference<XConfigurationController> xConfigurationController (
-            xControllerManager->getConfigurationController());
+        rtl::Reference<::sd::DrawController> xControllerManager 
(GetDrawController());
+        Reference<XConfigurationController> xConfigurationController;
+        if (xControllerManager)
+            xConfigurationController = 
xControllerManager->getConfigurationController();
         if (xConfigurationController.is())
         {
             OUString sView (rsDefaultView);
@@ -937,11 +938,11 @@ std::shared_ptr<FormShellManager> const & 
ViewShellBase::GetFormShellManager() c
     return mpImpl->mpFormShellManager;
 }
 
-DrawController& ViewShellBase::GetDrawController() const
+DrawController* ViewShellBase::GetDrawController() const
 {
     OSL_ASSERT(mpImpl != nullptr);
 
-    return *mpImpl->mpController;
+    return mpImpl->mpController.get();
 }
 
 void ViewShellBase::SetViewTabBar (const ::rtl::Reference<ViewTabBar>& 
rViewTabBar)
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index 2cddc0cea1c6..efd54a520f8b 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -256,7 +256,7 @@ void DrawViewShell::SelectionHasChanged()
 
     mpDrawView->UpdateSelectionClipboard();
 
-    GetViewShellBase().GetDrawController().FireSelectionChangeListener();
+    GetViewShellBase().GetDrawController()->FireSelectionChangeListener();
 }
 
 namespace {
@@ -344,8 +344,8 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool 
bIsLayerModeActive)
         eEMode = EditMode::MasterPage;
     }
 
-    GetViewShellBase().GetDrawController().FireChangeEditMode (eEMode == 
EditMode::MasterPage);
-    GetViewShellBase().GetDrawController().FireChangeLayerMode 
(bIsLayerModeActive);
+    GetViewShellBase().GetDrawController()->FireChangeEditMode (eEMode == 
EditMode::MasterPage);
+    GetViewShellBase().GetDrawController()->FireChangeLayerMode 
(bIsLayerModeActive);
 
     if ( mpDrawView->IsTextEdit() )
     {
@@ -359,7 +359,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool 
bIsLayerModeActive)
         pLayerBar->EndEditMode();
     maTabControl->EndEditMode();
 
-    GetViewShellBase().GetDrawController().BroadcastContextChange();
+    GetViewShellBase().GetDrawController()->BroadcastContextChange();
 
     meEditMode = eEMode;
 
@@ -1051,7 +1051,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage, 
bool bAllowChangeFocus)
             mpDrawView->HideSdrPage();
             maTabControl->SetCurPageId(maTabControl->GetPageId(nSelectedPage));
             mpDrawView->ShowSdrPage(mpActualPage);
-            
GetViewShellBase().GetDrawController().FireSwitchCurrentPage(mpActualPage);
+            
GetViewShellBase().GetDrawController()->FireSwitchCurrentPage(mpActualPage);
 
             SdrPageView* pNewPageView = mpDrawView->GetSdrPageView();
 
@@ -1120,7 +1120,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage, 
bool bAllowChangeFocus)
             sal_uInt16 nNum = pMaster->GetPageNum();
             
mpDrawView->ShowSdrPage(mpDrawView->GetModel()->GetMasterPage(nNum));
 
-            
GetViewShellBase().GetDrawController().FireSwitchCurrentPage(pMaster);
+            
GetViewShellBase().GetDrawController()->FireSwitchCurrentPage(pMaster);
 
             SdrPageView* pNewPageView = mpDrawView->GetSdrPageView();
 
diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx
index 3eb9f39c376f..0ad1a18a6c2c 100644
--- a/sd/source/ui/view/drviews5.cxx
+++ b/sd/source/ui/view/drviews5.cxx
@@ -573,7 +573,7 @@ void DrawViewShell::VisAreaChanged(const 
::tools::Rectangle& rRect)
 {
     ViewShell::VisAreaChanged( rRect );
 
-    DrawController& rController = GetViewShellBase().GetDrawController();
+    DrawController& rController = *GetViewShellBase().GetDrawController();
     rController.FireVisAreaChanged (rRect);
 }
 
@@ -626,7 +626,7 @@ void DrawViewShell::SetActiveTabLayerIndex (int nIndex)
             *this,
             *GetView()));
         css::uno::Reference< css::drawing::XLayer> rLayer = 
pUnoDrawView->getActiveLayer();
-        GetViewShellBase().GetDrawController().fireChangeLayer( &rLayer );
+        GetViewShellBase().GetDrawController()->fireChangeLayer( &rLayer );
     }
 }
 
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index a345af61331b..b09944043c24 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -110,7 +110,7 @@ DrawViewShell::DrawViewShell( ViewShellBase& 
rViewShellBase, vcl::Window* pParen
     , mbIsInSwitchPage(false)
     , mpSelectionChangeHandler(new svx::sidebar::SelectionChangeHandler(
           [this] () { return this->GetSidebarContextName(); },
-          
uno::Reference<frame::XController>(&rViewShellBase.GetDrawController()),
+          
uno::Reference<frame::XController>(rViewShellBase.GetDrawController()),
           vcl::EnumContext::Context::Default))
     , mbMouseButtonDown(false)
     , mbMouseSelecting(false)
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index 10a6e7620afe..1d3bd9500841 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -1332,7 +1332,7 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& rSet)
         //Now, CurrentPage property change is already sent for DrawView and 
OutlineView, so it is not necessary to send again here
         if(m_StrOldPageName!=aPageStr)
         {
-            GetViewShellBase().GetDrawController().fireSwitchCurrentPage(nPos);
+            
GetViewShellBase().GetDrawController()->fireSwitchCurrentPage(nPos);
             m_StrOldPageName = aPageStr;
         }
     }
@@ -1812,7 +1812,7 @@ void OutlineViewShell::VisAreaChanged(const 
::tools::Rectangle& rRect)
 {
     ViewShell::VisAreaChanged( rRect );
 
-    GetViewShellBase().GetDrawController().FireVisAreaChanged(rRect);
+    GetViewShellBase().GetDrawController()->FireVisAreaChanged(rRect);
 }
 
 /** If there is a valid controller then create a new instance of
@@ -1870,7 +1870,7 @@ void OutlineViewShell::SetCurrentPage (SdPage* pPage)
             false);
     GetDoc()->SetSelected (pPage, true);
 
-    DrawController& rController(GetViewShellBase().GetDrawController());
+    DrawController& rController(*GetViewShellBase().GetDrawController());
     rController.FireSelectionChangeListener();
     rController.FireSwitchCurrentPage (pPage);
 
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index 153284bdc414..cc217bfb8ba2 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -705,7 +705,7 @@ bool View::SdrBeginTextEdit(
 
     if ( mpViewSh )
     {
-        
mpViewSh->GetViewShellBase().GetDrawController().FireSelectionChangeListener();
+        
mpViewSh->GetViewShellBase().GetDrawController()->FireSelectionChangeListener();
 
         if (pObj && pObj->GetObjIdentifier() == SdrObjKind::Table)
             mpViewSh->UpdateScrollBars();
@@ -808,7 +808,7 @@ SdrEndTextEditKind View::SdrEndTextEdit(bool 
bDontDeleteReally)
     {
         if ( mpViewSh )
         {
-            
mpViewSh->GetViewShellBase().GetDrawController().FireSelectionChangeListener();
+            
mpViewSh->GetViewShellBase().GetDrawController()->FireSelectionChangeListener();
 
             if (comphelper::LibreOfficeKit::isActive())
                 SfxLokHelper::notifyOtherViews(&mpViewSh->GetViewShellBase(), 
LOK_CALLBACK_VIEW_LOCK, "rectangle", "EMPTY");
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index e12f65236dd9..a3cbfe8d896d 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -1572,11 +1572,11 @@ void ViewShell::SwitchActiveViewFireFocus()
 // move these two methods from DrawViewShell.
 void ViewShell::fireSwitchCurrentPage(sal_Int32 pageIndex)
 {
-    GetViewShellBase().GetDrawController().fireSwitchCurrentPage(pageIndex);
+    GetViewShellBase().GetDrawController()->fireSwitchCurrentPage(pageIndex);
 }
 void ViewShell::NotifyAccUpdate( )
 {
-    GetViewShellBase().GetDrawController().NotifyAccUpdate();
+    GetViewShellBase().GetDrawController()->NotifyAccUpdate();
 }
 
 weld::Window* ViewShell::GetFrameWeld() const

Reply via email to