diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-01-29 18:52:34 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-01-31 11:46:57 +0000 |
commit | e964c55f463c5b9daeb41dbed6c330b40911c313 (patch) | |
tree | 6621007c909c999df0cbe1b1e0aac0019de3ed09 /sfx2 | |
parent | 24af8af98edd3808d96b00b51648c1bb55da22eb (diff) |
implement missing FID_FUNCTION_BOX GetState
since it was turned into a sidebar thing
Change-Id: Ic7e53b9da3255bb8dfde048e0a12f1d9c89102d0
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/Sidebar.cxx | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/sfx2/source/sidebar/Sidebar.cxx b/sfx2/source/sidebar/Sidebar.cxx index 88f0b062bfed..ac45f616275a 100644 --- a/sfx2/source/sidebar/Sidebar.cxx +++ b/sfx2/source/sidebar/Sidebar.cxx @@ -26,23 +26,40 @@ using namespace css; namespace sfx2 { namespace sidebar { void Sidebar::ShowPanel ( - const ::rtl::OUString& rsPanelId, + const OUString& rsPanelId, const css::uno::Reference<frame::XFrame>& rxFrame) { SidebarController* pController = SidebarController::GetSidebarControllerForFrame(rxFrame); + if (!pController) + return; const PanelDescriptor* pPanelDescriptor = pController->GetResourceManager()->GetPanelDescriptor(rsPanelId); - if (pController!=nullptr && pPanelDescriptor != nullptr) - { - // This should be a lot more sophisticated: - // - Make the deck switching asynchronous - // - Make sure to use a context that really shows the panel + if (!pPanelDescriptor) + return; - // All that is not necessary for the current use cases so lets - // keep it simple for the time being. - pController->OpenThenSwitchToDeck(pPanelDescriptor->msDeckId); - } + // This should be a lot more sophisticated: + // - Make the deck switching asynchronous + // - Make sure to use a context that really shows the panel + + // All that is not necessary for the current use cases so lets + // keep it simple for the time being. + pController->OpenThenSwitchToDeck(pPanelDescriptor->msDeckId); +} + +bool Sidebar::IsPanelVisible( + const OUString& rsPanelId, + const css::uno::Reference<frame::XFrame>& rxFrame) +{ + SidebarController* pController = SidebarController::GetSidebarControllerForFrame(rxFrame); + if (!pController) + return false; + + const PanelDescriptor* pPanelDescriptor = pController->GetResourceManager()->GetPanelDescriptor(rsPanelId); + if (!pPanelDescriptor) + return false; + + return pController->IsDeckVisible(pPanelDescriptor->msDeckId); } } } // end of namespace sfx2::sidebar |