[Libreoffice-commits] core.git: include/sfx2 sfx2/source

Fabio Buso dev.siroibaf at gmail.com
Mon Mar 14 22:04:05 UTC 2016


 include/sfx2/sidebar/SidebarController.hxx |    8 ++++++--
 sfx2/source/sidebar/SidebarController.cxx  |   25 ++++++++++++++-----------
 2 files changed, 20 insertions(+), 13 deletions(-)

New commits:
commit 575b1efb193ac5e921b83ead157c1c639aec0e92
Author: Fabio Buso <dev.siroibaf at gmail.com>
Date:   Thu Mar 10 22:13:20 2016 +0100

    tdf#97885 SIDEBAR: Message missing from blank properties tab
    
    Change-Id: If810c351644ef80d3882b34861fde0400236bdf3
    Reviewed-on: https://gerrit.libreoffice.org/23127
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>

diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx
index 8d749e6..00f0bab35 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -151,8 +151,8 @@ public:
     void SwitchToDeck ( const ::rtl::OUString& rsDeckId);
     void SwitchToDefaultDeck();
 
-    void CreateDeck(const ::rtl::OUString& rDeckId, bool bForceCreate = false);
-    void CreatePanels(const ::rtl::OUString& rDeckId);
+    void CreateDeck(const ::rtl::OUString& rDeckId);
+    void CreateDeck(const ::rtl::OUString& rDeckId, const Context& rContext, bool bForceCreate = false);
 
     ResourceManager::DeckContextDescriptorContainer GetMatchingDecks();
     ResourceManager::PanelContextDescriptorContainer GetMatchingPanels( const ::rtl::OUString& rDeckId);
@@ -220,6 +220,9 @@ private:
         const bool bWantsCanvas,
         const Context& rContext);
 
+    void CreatePanels(
+        const ::rtl::OUString& rDeckId,
+        const Context& rContext);
     VclPtr<Panel> CreatePanel (
         const ::rtl::OUString& rsPanelId,
         vcl::Window* pParentWindow,
@@ -230,6 +233,7 @@ private:
     void SwitchToDeck (
         const DeckDescriptor& rDeckDescriptor,
         const Context& rContext);
+
     void ShowPopupMenu (
         const Rectangle& rButtonBox,
         const ::std::vector<TabBar::DeckMenuData>& rMenuData) const;
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 55f4d0b..d28a597 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -544,8 +544,11 @@ void SidebarController::SwitchToDeck (
     }
 }
 
+void SidebarController::CreateDeck(const ::rtl::OUString& rDeckId) {
+    CreateDeck(rDeckId, maCurrentContext);
+}
 
-void SidebarController::CreateDeck(const ::rtl::OUString& rDeckId, bool bForceCreate)
+void SidebarController::CreateDeck(const ::rtl::OUString& rDeckId, const Context& rContext, bool bForceCreate)
 {
     DeckDescriptor* pDeckDescriptor = mpResourceManager->GetDeckDescriptor(rDeckId);
 
@@ -563,12 +566,13 @@ void SidebarController::CreateDeck(const ::rtl::OUString& rDeckId, bool bForceCr
                             [this]() { return this->RequestCloseDeck(); });
         }
         pDeckDescriptor->mpDeck = aDeck;
-        CreatePanels(rDeckId);
+        CreatePanels(rDeckId, rContext);
     }
 }
 
-void SidebarController::CreatePanels(const ::rtl::OUString& rDeckId)
+void SidebarController::CreatePanels(const ::rtl::OUString& rDeckId, const Context& rContext)
 {
+
      DeckDescriptor* pDeckDescriptor = mpResourceManager->GetDeckDescriptor(rDeckId);
 
     // init panels bounded to that deck, do not wait them being displayed as may be accessed through API
@@ -581,16 +585,16 @@ void SidebarController::CreatePanels(const ::rtl::OUString& rDeckId)
 
     mpResourceManager->GetMatchingPanels(
                                         aPanelContextDescriptors,
-                                        maCurrentContext,
+                                        rContext,
                                         rDeckId,
                                         xController);
 
     // Update the panel list.
     const sal_Int32 nNewPanelCount (aPanelContextDescriptors.size());
     SharedPanelContainer aNewPanels;
+    sal_Int32 nWriteIndex (0);
 
     aNewPanels.resize(nNewPanelCount);
-    sal_Int32 nWriteIndex (0);
 
     for (sal_Int32 nReadIndex=0; nReadIndex<nNewPanelCount; ++nReadIndex)
     {
@@ -614,7 +618,7 @@ void SidebarController::CreatePanels(const ::rtl::OUString& rDeckId)
                                             rPanelContexDescriptor.msId,
                                             pDeck->GetPanelParentWindow(),
                                             rPanelContexDescriptor.mbIsInitiallyVisible,
-                                            maCurrentContext,
+                                            rContext,
                                             pDeck);
                 if (aPanel.get()!=nullptr )
                 {
@@ -630,10 +634,9 @@ void SidebarController::CreatePanels(const ::rtl::OUString& rDeckId)
                             mxFrame, xController);
                     }
                     ++nWriteIndex;
-                 }
-
-            }
+                }
         }
+    }
 
     // mpCurrentPanels - may miss stuff (?)
     aNewPanels.resize(nWriteIndex);
@@ -694,10 +697,10 @@ void SidebarController::SwitchToDeck (
 
     // Provide a configuration and Deck object.
 
-    CreateDeck(rDeckDescriptor.msId, bForceNewDeck);
+    CreateDeck(rDeckDescriptor.msId, rContext, bForceNewDeck);
 
     if (bForceNewPanels && !bForceNewDeck) // already forced if bForceNewDeck
-        CreatePanels(rDeckDescriptor.msId);
+        CreatePanels(rDeckDescriptor.msId, rContext);
 
     mpCurrentDeck.reset(rDeckDescriptor.mpDeck);
 


More information about the Libreoffice-commits mailing list