summaryrefslogtreecommitdiff
path: root/sfx2/source/sidebar
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-01-29 18:52:34 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-01-31 11:46:57 +0000
commite964c55f463c5b9daeb41dbed6c330b40911c313 (patch)
tree6621007c909c999df0cbe1b1e0aac0019de3ed09 /sfx2/source/sidebar
parent24af8af98edd3808d96b00b51648c1bb55da22eb (diff)
implement missing FID_FUNCTION_BOX GetState
since it was turned into a sidebar thing Change-Id: Ic7e53b9da3255bb8dfde048e0a12f1d9c89102d0
Diffstat (limited to 'sfx2/source/sidebar')
-rw-r--r--sfx2/source/sidebar/Sidebar.cxx37
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