[Libreoffice-commits] core.git: Branch 'feature/chart-sidebar' - 5 commits - chart2/source include/sfx2 offapi/com sfx2/source

Markus Mohrhard markus.mohrhard at googlemail.com
Wed Jul 8 11:48:49 PDT 2015


 chart2/source/controller/main/ChartController.cxx |   31 ++++++++++
 chart2/source/controller/main/ChartController.hxx |    2 
 include/sfx2/sidebar/ResourceManager.hxx          |   10 +--
 include/sfx2/sidebar/SidebarController.hxx        |    8 ++
 include/sfx2/sidebar/Tools.hxx                    |    2 
 include/sfx2/sidebar/UnoSidebar.hxx               |    4 +
 offapi/com/sun/star/ui/XSidebarProvider.idl       |    6 ++
 sfx2/source/sidebar/ControllerFactory.cxx         |    2 
 sfx2/source/sidebar/ResourceManager.cxx           |   18 +++---
 sfx2/source/sidebar/SidebarController.cxx         |   63 ++++++++++++++--------
 sfx2/source/sidebar/Tools.cxx                     |    6 +-
 sfx2/source/sidebar/UnoDecks.cxx                  |    4 -
 sfx2/source/sidebar/UnoPanels.cxx                 |    4 -
 sfx2/source/sidebar/UnoSidebar.cxx                |    6 ++
 14 files changed, 118 insertions(+), 48 deletions(-)

New commits:
commit e6c00e5d38cee1310bf8587f6680da402405ef19
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jul 8 20:45:37 2015 +0200

    finally manage to register chart2 in the ChartController
    
    We need to do some jumps through pink hoops to connect the chart
    controller with the host sidebar.
    
    Would we use the chart window as parent for our sidebar the sidebar
    would be directlz beside the chart and not at the border of the host
    window.
    
    Change-Id: Ica44ae370518882ef367999f57251b1256907016

diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 4156c9d..3175eea 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -51,6 +51,7 @@
 #include <com/sun/star/chart2/XChartDocument.hpp>
 #include <com/sun/star/chart2/data/XDataReceiver.hpp>
 #include <com/sun/star/frame/XLoadable.hpp>
+#include <com/sun/star/frame/XController2.hpp>
 #include <com/sun/star/util/XCloneable.hpp>
 #include <com/sun/star/embed/XEmbeddedClient.hpp>
 #include <com/sun/star/util/XModeChangeBroadcaster.hpp>
@@ -58,6 +59,7 @@
 #include <com/sun/star/frame/LayoutManagerEvents.hpp>
 #include <com/sun/star/document/XUndoManagerSupplier.hpp>
 #include <com/sun/star/document/XUndoAction.hpp>
+#include <com/sun/star/ui/XSidebar.hpp>
 
 #include <svx/sidebar/SelectionChangeHandler.hxx>
 #include <vcl/msgbox.hxx>
@@ -66,6 +68,8 @@
 #include <vcl/svapp.hxx>
 #include <osl/mutex.hxx>
 
+#include <sfx2/sidebar/SidebarController.hxx>
+
 #include <com/sun/star/frame/XLayoutManager.hpp>
 #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
 
@@ -346,6 +350,21 @@ uno::Sequence< OUString > ChartController::getSupportedServiceNames_Static()
     return aSNS;
 }
 
+namespace {
+
+uno::Reference<ui::XSidebar> getSidebarFromModel(uno::Reference<frame::XModel> xModel)
+{
+    uno::Reference<container::XChild> xChild(xModel, uno::UNO_QUERY);
+    uno::Reference<frame::XModel> xParent (xChild->getParent(), uno::UNO_QUERY_THROW);
+    uno::Reference<frame::XController2> xController(xParent->getCurrentController(), uno::UNO_QUERY);
+    uno::Reference<ui::XSidebarProvider> xSidebarProvider (xController->getSidebar(), uno::UNO_QUERY);
+    uno::Reference<ui::XSidebar> xSidebar(xSidebarProvider->getSidebar(), uno::UNO_QUERY);
+
+    return xSidebar;
+}
+
+}
+
 // XController
 
 void SAL_CALL ChartController::attachFrame(
@@ -359,6 +378,10 @@ void SAL_CALL ChartController::attachFrame(
 
     mpSelectionChangeHandler->Connect();
 
+    uno::Reference<ui::XSidebar> xSidebar = getSidebarFromModel(getModel());
+    sfx2::sidebar::SidebarController* pSidebar = dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get());
+    sfx2::sidebar::SidebarController::registerSidebarForFrame(pSidebar, this);
+
     if(m_xFrame.is()) //what happens, if we do have a Frame already??
     {
         //@todo? throw exception?
@@ -725,6 +748,14 @@ void SAL_CALL ChartController::dispose()
     throw(uno::RuntimeException, std::exception)
 {
     mpSelectionChangeHandler->Disconnect();
+
+    if (getModel().is())
+    {
+        uno::Reference<ui::XSidebar> xSidebar = getSidebarFromModel(getModel());
+        sfx2::sidebar::SidebarController* pSidebar = dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get());
+        sfx2::sidebar::SidebarController::unregisterSidebarForFrame(pSidebar, this);
+    }
+
     try
     {
         //This object should release all resources and references in the
diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx
index 6d88767..bdc1dc4 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -69,7 +69,7 @@ class SidebarDockingWindow;
 class TabBar;
 class TabBarConfiguration;
 
-class SidebarController
+class SFX2_DLLPUBLIC SidebarController
     : private ::boost::noncopyable,
       private ::cppu::BaseMutex,
       public SidebarControllerInterfaceBase
commit d97e0e3ca9e66a0fd8cb6bfdf8faa94de24ef408
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jul 8 20:35:21 2015 +0200

    [API CHANGE] add way to get XSidebar from XSidebarProvider
    
    Change-Id: I9fcf1cffa70eac6fec228ca4a9d4d32783295f21

diff --git a/include/sfx2/sidebar/UnoSidebar.hxx b/include/sfx2/sidebar/UnoSidebar.hxx
index 6c154c0..9cbb4e1 100644
--- a/include/sfx2/sidebar/UnoSidebar.hxx
+++ b/include/sfx2/sidebar/UnoSidebar.hxx
@@ -14,6 +14,7 @@
 #include <sfx2/dllapi.h>
 #include <com/sun/star/frame/XFrame.hpp>
 #include <com/sun/star/ui/XSidebarProvider.hpp>
+#include <com/sun/star/ui/XSidebar.hpp>
 
 #include <com/sun/star/awt/XWindow2.hpp>
 
@@ -56,6 +57,9 @@ public:
     virtual css::uno::Reference<css::ui::XDecks> SAL_CALL getDecks()
                                     throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
 
+    virtual css::uno::Reference<css::ui::XSidebar> SAL_CALL getSidebar()
+                                    throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
 };
 
 #endif
diff --git a/offapi/com/sun/star/ui/XSidebarProvider.idl b/offapi/com/sun/star/ui/XSidebarProvider.idl
index 370925e..5786550 100644
--- a/offapi/com/sun/star/ui/XSidebarProvider.idl
+++ b/offapi/com/sun/star/ui/XSidebarProvider.idl
@@ -14,6 +14,7 @@
 #include <com/sun/star/frame/XFrame.idl>
 #include <com/sun/star/awt/XWindow2.idl>
 
+#include <com/sun/star/ui/XSidebar.idl>
 #include <com/sun/star/ui/XDecks.idl>
 
 
@@ -52,6 +53,11 @@ interface XSidebarProvider: com::sun::star::uno::XInterface
             </ul>
     */
     void showDecks([in] boolean bVisible);
+
+    /**
+     * Returns the sidebar object
+     */
+    com::sun::star::ui::XSidebar getSidebar();
 } ;
 
 } ; } ; } ; } ;
diff --git a/sfx2/source/sidebar/UnoSidebar.cxx b/sfx2/source/sidebar/UnoSidebar.cxx
index 28de260..cfaebbf 100644
--- a/sfx2/source/sidebar/UnoSidebar.cxx
+++ b/sfx2/source/sidebar/UnoSidebar.cxx
@@ -98,5 +98,11 @@ uno::Reference<ui::XDecks> SAL_CALL SfxUnoSidebar::getDecks()
     return decks;
 }
 
+uno::Reference<ui::XSidebar> SAL_CALL SfxUnoSidebar::getSidebar()
+                            throw (uno::RuntimeException, std::exception)
+{
+    return getSidebarController();
+}
+
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit f59b94d2b0cf7668344f39277bb58e5f1c6a0866
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jul 8 00:46:59 2015 +0200

    fix crash
    
    Change-Id: Ic1bc31b68c4a2aafb1e40ebff84fbf052df7041f

diff --git a/chart2/source/controller/main/ChartController.hxx b/chart2/source/controller/main/ChartController.hxx
index d3882aa..00d297b 100644
--- a/chart2/source/controller/main/ChartController.hxx
+++ b/chart2/source/controller/main/ChartController.hxx
@@ -544,7 +544,7 @@ private:
 
     ChartDrawMode m_eDrawMode;
 
-    boost::scoped_ptr<svx::sidebar::SelectionChangeHandler> mpSelectionChangeHandler;
+    rtl::Reference<svx::sidebar::SelectionChangeHandler> mpSelectionChangeHandler;
 
 private:
     //private methods
commit 6af162566876573c840cfdef48835f7e8bcabd2c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jul 8 00:46:26 2015 +0200

    add methods to add random controllers to sidebar
    
    Change-Id: Ia3e80cc63491f1edd49eaf86cc8c25d67e4a8b28

diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx
index 78a0478..6d88767 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -89,6 +89,10 @@ public:
     static SidebarController* GetSidebarControllerForFrame (
         const css::uno::Reference<css::frame::XFrame>& rxFrame);
 
+    static void registerSidebarForFrame(SidebarController* pController, css::uno::Reference<css::frame::XController> xFrame);
+
+    static void unregisterSidebarForFrame(SidebarController* pController, css::uno::Reference<css::frame::XController> xFrame);
+
     // ui::XContextChangeEventListener
     virtual void SAL_CALL notifyContextChangeEvent (const css::ui::ContextChangeEventObject& rEvent)
         throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index d98a5b5..61492ce 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -124,15 +124,7 @@ SidebarController::SidebarController (
     // Decks and panel collections for this sidebar
     mpResourceManager = std::unique_ptr<ResourceManager>(new ResourceManager());
 
-    // Listen for context change events.
-    css::uno::Reference<css::ui::XContextChangeEventMultiplexer> xMultiplexer (
-        css::ui::ContextChangeEventMultiplexer::get(
-            ::comphelper::getProcessComponentContext()));
-    if (xMultiplexer.is())
-        xMultiplexer->addContextChangeEventListener(
-            static_cast<css::ui::XContextChangeEventListener*>(this),
-            mxFrame->getController());
-
+    registerSidebarForFrame(this, mxFrame->getController());
     // Listen for window events.
     mpParentWindow->AddEventListener(LINK(this, SidebarController, WindowEventHandler));
 
@@ -149,12 +141,6 @@ SidebarController::SidebarController (
         mxReadOnlyModeDispatch->addStatusListener(this, aURL);
 
     SwitchToDeck(gsDefaultDeckId);
-
-    WeakReference<SidebarController> xWeakController (this);
-    maSidebarControllerContainer.insert(
-        SidebarControllerContainer::value_type(
-            rxFrame->getController(),
-            xWeakController));
 }
 
 SidebarController::~SidebarController()
@@ -175,6 +161,39 @@ SidebarController* SidebarController::GetSidebarControllerForFrame (
     return dynamic_cast<SidebarController*>(xController.get());
 }
 
+void SidebarController::registerSidebarForFrame(SidebarController* pController, css::uno::Reference<css::frame::XController> xController)
+{
+    // Listen for context change events.
+    css::uno::Reference<css::ui::XContextChangeEventMultiplexer> xMultiplexer (
+        css::ui::ContextChangeEventMultiplexer::get(
+            ::comphelper::getProcessComponentContext()));
+    if (xMultiplexer.is())
+        xMultiplexer->addContextChangeEventListener(
+            static_cast<css::ui::XContextChangeEventListener*>(pController),
+            xController);
+
+    WeakReference<SidebarController> xWeakController (pController);
+    maSidebarControllerContainer.insert(
+        SidebarControllerContainer::value_type(
+            xController,
+            xWeakController));
+}
+
+void SidebarController::unregisterSidebarForFrame(SidebarController* pController, css::uno::Reference<css::frame::XController> xController)
+{
+    SidebarControllerContainer::iterator iEntry (maSidebarControllerContainer.find(xController));
+    if (iEntry != maSidebarControllerContainer.end())
+        maSidebarControllerContainer.erase(iEntry);
+
+    css::uno::Reference<css::ui::XContextChangeEventMultiplexer> xMultiplexer (
+        css::ui::ContextChangeEventMultiplexer::get(
+            ::comphelper::getProcessComponentContext()));
+    if (xMultiplexer.is())
+        xMultiplexer->removeContextChangeEventListener(
+            static_cast<css::ui::XContextChangeEventListener*>(pController),
+            xController);
+}
+
 void SAL_CALL SidebarController::disposing()
 {
     mpCloseIndicator.disposeAndClear();
commit 2d338027812e6da501d7d6ebce58164e956b3869
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Jul 7 18:46:43 2015 +0200

    use XController instead of XFrame where it makes sense
    
    Change-Id: I22990c861c0dd9d9dab3fbdbc35fdb2b51e82005

diff --git a/include/sfx2/sidebar/ResourceManager.hxx b/include/sfx2/sidebar/ResourceManager.hxx
index 5768db0..568b7f8 100644
--- a/include/sfx2/sidebar/ResourceManager.hxx
+++ b/include/sfx2/sidebar/ResourceManager.hxx
@@ -23,7 +23,7 @@
 #include "PanelDescriptor.hxx"
 #include <sfx2/sidebar/Context.hxx>
 #include <unotools/confignode.hxx>
-#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XController.hpp>
 #include <set>
 #include <boost/shared_ptr.hpp>
 #include <svtools/miscopt.hxx>
@@ -89,13 +89,13 @@ public:
                                             DeckContextDescriptorContainer& rDeckDescriptors,
                                             const Context& rContext,
                                             const bool bIsDocumentReadOnly,
-                                            const css::uno::Reference<css::frame::XFrame>& rxFrame);
+                                            const css::uno::Reference<css::frame::XController>& rxController);
 
     const PanelContextDescriptorContainer& GetMatchingPanels(
                                             PanelContextDescriptorContainer& rPanelDescriptors,
                                             const Context& rContext,
                                             const OUString& rsDeckId,
-                                            const css::uno::Reference<css::frame::XFrame>& rxFrame);
+                                            const css::uno::Reference<css::frame::XController>& rxController);
 
     /** Remember the expansions state per panel and context.
         This is not persistent past application end.
@@ -121,13 +121,13 @@ private:
     static void ReadContextList(const utl::OConfigurationNode& rNode,
                          ContextList& rContextList,
                          const OUString& rsDefaultMenuCommand);
-    void ReadLegacyAddons(const css::uno::Reference<css::frame::XFrame>& rxFrame);
+    void ReadLegacyAddons(const css::uno::Reference<css::frame::XController>& rxController);
     static utl::OConfigurationTreeRoot GetLegacyAddonRootNode(const OUString& rsModuleName);
     static void GetToolPanelNodeNames(std::vector<OUString>& rMatchingNames,
                                const utl::OConfigurationTreeRoot& aRoot);
     static bool IsDeckEnabled(const OUString& rsDeckId,
                        const Context& rContext,
-                       const css::uno::Reference<css::frame::XFrame>& rxFrame);
+                       const css::uno::Reference<css::frame::XController>& rxController);
 };
 
 } } // end of namespace sfx2::sidebar
diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx
index 29c7d43..78a0478 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -158,7 +158,7 @@ public:
 
 private:
     typedef ::std::map<
-        const css::uno::Reference<css::frame::XFrame>,
+        const css::uno::Reference<css::frame::XController>,
         css::uno::WeakReference<SidebarController>
     > SidebarControllerContainer;
     static SidebarControllerContainer maSidebarControllerContainer;
diff --git a/include/sfx2/sidebar/Tools.hxx b/include/sfx2/sidebar/Tools.hxx
index 3aff9ea..c6b7909 100644
--- a/include/sfx2/sidebar/Tools.hxx
+++ b/include/sfx2/sidebar/Tools.hxx
@@ -54,7 +54,7 @@ public:
         const css::util::URL& rURL);
 
     static ::rtl::OUString GetModuleName (
-        const css::uno::Reference<css::frame::XFrame>& rxFrame);
+        const css::uno::Reference<css::frame::XController>& rxFrame);
 };
 
 
diff --git a/sfx2/source/sidebar/ControllerFactory.cxx b/sfx2/source/sidebar/ControllerFactory.cxx
index c635751..ff457c2 100644
--- a/sfx2/source/sidebar/ControllerFactory.cxx
+++ b/sfx2/source/sidebar/ControllerFactory.cxx
@@ -143,7 +143,7 @@ Reference<frame::XToolbarController> ControllerFactory::CreateToolBarController(
     {
         Reference<XComponentContext> xContext = comphelper::getProcessComponentContext();
         Reference<frame::XUIControllerFactory> xFactory = frame::theToolbarControllerFactory::get( xContext );
-        OUString sModuleName (Tools::GetModuleName(rxFrame));
+        OUString sModuleName (Tools::GetModuleName(rxFrame->getController()));
 
         if (xFactory.is() && xFactory->hasController(rsCommandName,  sModuleName))
         {
diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx
index 21a6f8b..93a1b89 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -179,9 +179,9 @@ const ResourceManager::DeckContextDescriptorContainer& ResourceManager::GetMatch
                                                             DeckContextDescriptorContainer& rDecks,
                                                             const Context& rContext,
                                                             const bool bIsDocumentReadOnly,
-                                                            const Reference<frame::XFrame>& rxFrame)
+                                                            const Reference<frame::XController>& rxController)
 {
-    ReadLegacyAddons(rxFrame);
+    ReadLegacyAddons(rxController);
 
     std::multimap<sal_Int32,DeckContextDescriptor> aOrderedIds;
     DeckContainer::const_iterator iDeck;
@@ -196,7 +196,7 @@ const ResourceManager::DeckContextDescriptorContainer& ResourceManager::GetMatch
         aDeckContextDescriptor.msId = rDeckDescriptor.msId;
         aDeckContextDescriptor.mbIsEnabled =
             ! bIsDocumentReadOnly
-            || IsDeckEnabled(rDeckDescriptor.msId, rContext, rxFrame);
+            || IsDeckEnabled(rDeckDescriptor.msId, rContext, rxController);
         aOrderedIds.insert(::std::multimap<sal_Int32,DeckContextDescriptor>::value_type(
                 rDeckDescriptor.mnOrderIndex,
                 aDeckContextDescriptor));
@@ -215,9 +215,9 @@ const ResourceManager::PanelContextDescriptorContainer& ResourceManager::GetMatc
                                                             PanelContextDescriptorContainer& rPanelIds,
                                                             const Context& rContext,
                                                             const OUString& rsDeckId,
-                                                            const Reference<frame::XFrame>& rxFrame)
+                                                            const Reference<frame::XController>& rxController)
 {
-    ReadLegacyAddons(rxFrame);
+    ReadLegacyAddons(rxController);
 
     std::multimap<sal_Int32, PanelContextDescriptor> aOrderedIds;
     PanelContainer::const_iterator iPanel;
@@ -485,10 +485,10 @@ void ResourceManager::ReadContextList (
     }
 }
 
-void ResourceManager::ReadLegacyAddons (const Reference<frame::XFrame>& rxFrame)
+void ResourceManager::ReadLegacyAddons (const Reference<frame::XController>& rxController)
 {
     // Get module name for given frame.
-    OUString sModuleName (Tools::GetModuleName(rxFrame));
+    OUString sModuleName (Tools::GetModuleName(rxController));
     if (sModuleName.getLength() == 0)
         return;
     if (maProcessedApplications.find(sModuleName) != maProcessedApplications.end())
@@ -625,14 +625,14 @@ void ResourceManager::GetToolPanelNodeNames (
 bool ResourceManager::IsDeckEnabled (
                         const OUString& rsDeckId,
                         const Context& rContext,
-                        const Reference<frame::XFrame>& rxFrame)
+                        const Reference<frame::XController>& rxController)
 {
     // Check if any panel that matches the current context can be
     // displayed.
     ResourceManager::PanelContextDescriptorContainer aPanelContextDescriptors;
 
     ResourceManager::Instance().GetMatchingPanels(aPanelContextDescriptors,
-                                                  rContext, rsDeckId, rxFrame);
+                                                  rContext, rsDeckId, rxController);
 
     ResourceManager::PanelContextDescriptorContainer::const_iterator iPanel;
     for (iPanel = aPanelContextDescriptors.begin(); iPanel != aPanelContextDescriptors.end(); ++iPanel)
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 867aa20..d98a5b5 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -153,7 +153,7 @@ SidebarController::SidebarController (
     WeakReference<SidebarController> xWeakController (this);
     maSidebarControllerContainer.insert(
         SidebarControllerContainer::value_type(
-            rxFrame,
+            rxFrame->getController(),
             xWeakController));
 }
 
@@ -164,7 +164,7 @@ SidebarController::~SidebarController()
 SidebarController* SidebarController::GetSidebarControllerForFrame (
     const css::uno::Reference<css::frame::XFrame>& rxFrame)
 {
-    SidebarControllerContainer::iterator iEntry (maSidebarControllerContainer.find(rxFrame));
+    SidebarControllerContainer::iterator iEntry (maSidebarControllerContainer.find(rxFrame->getController()));
     if (iEntry == maSidebarControllerContainer.end())
         return NULL;
 
@@ -190,7 +190,7 @@ void SAL_CALL SidebarController::disposing()
             aDecks,
             GetCurrentContext(),
             IsDocumentReadOnly(),
-            mxFrame);
+            mxFrame->getController());
 
         for (ResourceManager::DeckContextDescriptorContainer::const_iterator
             iDeck(aDecks.begin()), iEnd(aDecks.end());
@@ -202,7 +202,7 @@ void SAL_CALL SidebarController::disposing()
                     aDeck.disposeAndClear();
             }
 
-    SidebarControllerContainer::iterator iEntry (maSidebarControllerContainer.find(mxFrame));
+    SidebarControllerContainer::iterator iEntry (maSidebarControllerContainer.find(mxFrame->getController()));
     if (iEntry != maSidebarControllerContainer.end())
         maSidebarControllerContainer.erase(iEntry);
 
@@ -425,7 +425,7 @@ void SidebarController::UpdateConfigurations()
             aDecks,
             maCurrentContext,
             mbIsDocumentReadOnly,
-            mxFrame);
+            mxFrame->getController());
 
         // Notify the tab bar about the updated set of decks.
         mpTabBar->SetDecks(aDecks);
@@ -564,7 +564,7 @@ void SidebarController::SwitchToDeck (
         aPanelContextDescriptors,
         rContext,
         rDeckDescriptor.msId,
-        mxFrame);
+        mxFrame->getController());
 
     if (aPanelContextDescriptors.empty())
     {
@@ -1219,7 +1219,7 @@ ResourceManager::DeckContextDescriptorContainer SidebarController::GetMatchingDe
     mpResourceManager->GetMatchingDecks (aDecks,
                                         GetCurrentContext(),
                                         IsDocumentReadOnly(),
-                                        mxFrame);
+                                        mxFrame->getController());
     return aDecks;
 }
 
@@ -1230,7 +1230,7 @@ ResourceManager::PanelContextDescriptorContainer SidebarController::GetMatchingP
     mpResourceManager->GetMatchingPanels(aPanels,
                                         GetCurrentContext(),
                                         rDeckId,
-                                        mxFrame);
+                                        mxFrame->getController());
     return aPanels;
 }
 
diff --git a/sfx2/source/sidebar/Tools.cxx b/sfx2/source/sidebar/Tools.cxx
index fa9b256..0e62e6d 100644
--- a/sfx2/source/sidebar/Tools.cxx
+++ b/sfx2/source/sidebar/Tools.cxx
@@ -146,16 +146,16 @@ Reference<frame::XDispatch> Tools::GetDispatch (
 }
 
 ::rtl::OUString Tools::GetModuleName (
-    const css::uno::Reference<css::frame::XFrame>& rxFrame)
+    const css::uno::Reference<css::frame::XController>& rxController)
 {
-    if ( ! rxFrame.is() || ! rxFrame->getController().is())
+    if (!rxController.is())
         return ::rtl::OUString();
 
     try
     {
         const Reference<XComponentContext> xComponentContext (::comphelper::getProcessComponentContext());
         const Reference<frame::XModuleManager> xModuleManager = frame::ModuleManager::create( xComponentContext );
-        return xModuleManager->identify(rxFrame);
+        return xModuleManager->identify(rxController);
     }
     catch (const Exception&)
     {
diff --git a/sfx2/source/sidebar/UnoDecks.cxx b/sfx2/source/sidebar/UnoDecks.cxx
index 30882ea..42965da 100644
--- a/sfx2/source/sidebar/UnoDecks.cxx
+++ b/sfx2/source/sidebar/UnoDecks.cxx
@@ -68,7 +68,7 @@ uno::Sequence< OUString > SAL_CALL SfxUnoDecks::getElementNames()
             aDecks,
             pSidebarController->GetCurrentContext(),
             pSidebarController->IsDocumentReadOnly(),
-            xFrame);
+            xFrame->getController());
 
         deckList.realloc(aDecks.size());
 
@@ -104,7 +104,7 @@ sal_Bool SAL_CALL SfxUnoDecks::hasByName( const OUString& aName )
             aDecks,
             pSidebarController->GetCurrentContext(),
             pSidebarController->IsDocumentReadOnly(),
-            xFrame);
+            xFrame->getController());
 
         for (ResourceManager::DeckContextDescriptorContainer::const_iterator
             iDeck(aDecks.begin()), iEnd(aDecks.end());
diff --git a/sfx2/source/sidebar/UnoPanels.cxx b/sfx2/source/sidebar/UnoPanels.cxx
index 8075667..0e712d9 100644
--- a/sfx2/source/sidebar/UnoPanels.cxx
+++ b/sfx2/source/sidebar/UnoPanels.cxx
@@ -81,7 +81,7 @@ uno::Sequence< OUString > SAL_CALL SfxUnoPanels::getElementNames()
         pSidebarController->GetResourceManager()->GetMatchingPanels(aPanels,
                                                       pSidebarController->GetCurrentContext(),
                                                       mDeckId,
-                                                      xFrame);
+                                                      xFrame->getController());
 
         panelList.realloc(aPanels.size());
 
@@ -114,7 +114,7 @@ sal_Bool SAL_CALL SfxUnoPanels::hasByName( const OUString& aName )
         pSidebarController->GetResourceManager()->GetMatchingPanels(aPanels,
                                                       pSidebarController->GetCurrentContext(),
                                                       mDeckId,
-                                                      xFrame);
+                                                      xFrame->getController());
 
         for (ResourceManager::PanelContextDescriptorContainer::const_iterator
             iPanel(aPanels.begin()), iEnd(aPanels.end());


More information about the Libreoffice-commits mailing list