From 575b1efb193ac5e921b83ead157c1c639aec0e92 Mon Sep 17 00:00:00 2001 From: Fabio Buso Date: Thu, 10 Mar 2016 22:13:20 +0100 Subject: tdf#97885 SIDEBAR: Message missing from blank properties tab Change-Id: If810c351644ef80d3882b34861fde0400236bdf3 Reviewed-on: https://gerrit.libreoffice.org/23127 Tested-by: Jenkins Reviewed-by: Katarina Behrens --- include/sfx2/sidebar/SidebarController.hxx | 8 ++++++-- sfx2/source/sidebar/SidebarController.cxx | 25 ++++++++++++++----------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx index 8d749e661655..00f0bab35d05 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 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& rMenuData) const; diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 55f4d0bcc879..d28a59748ca6 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; nReadIndexGetPanelParentWindow(), 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); -- cgit v1.2.3