summaryrefslogtreecommitdiff
path: root/sfx2/source/sidebar/Sidebar.cxx
diff options
context:
space:
mode:
authorAndre Fischer <af@apache.org>2013-06-05 15:40:56 +0000
committerAndre Fischer <af@apache.org>2013-06-05 15:40:56 +0000
commit7b26aba94e5544937f1e37e34915bcb276bc3c27 (patch)
treebabede9a22ad29ca8ccd9e33acc788348befc6b5 /sfx2/source/sidebar/Sidebar.cxx
parent136976efb17b8617a83c7f26601cd04031b51e7f (diff)
122470: Fixed programmatic triggered switching of sidebar decks.
Notes
Diffstat (limited to 'sfx2/source/sidebar/Sidebar.cxx')
-rw-r--r--sfx2/source/sidebar/Sidebar.cxx65
1 files changed, 25 insertions, 40 deletions
diff --git a/sfx2/source/sidebar/Sidebar.cxx b/sfx2/source/sidebar/Sidebar.cxx
index c6b6d763b1ff..8e2649570b89 100644
--- a/sfx2/source/sidebar/Sidebar.cxx
+++ b/sfx2/source/sidebar/Sidebar.cxx
@@ -21,7 +21,8 @@
#include "precompiled_sfx2.hxx"
-#include "Sidebar.hxx"
+#include "sfx2/sidebar/Sidebar.hxx"
+#include "SidebarController.hxx"
#include "ResourceManager.hxx"
using namespace css;
@@ -29,53 +30,37 @@ using namespace cssu;
namespace sfx2 { namespace sidebar {
-Sidebar::Sidebar(
- Window& rParentWindow,
- const Reference<frame::XFrame>& rxDocumentFrame)
- : Window(&rParentWindow, WB_DIALOGCONTROL)
-{
- ContentPanelManager::Instance();
-}
-
-
-
-
-Sidebar::~Sidebar (void)
-{
-}
-
-
-
-void Sidebar::Resize (void)
+void Sidebar::ShowPanel (
+ const ::rtl::OUString& rsPanelId,
+ const Reference<frame::XFrame>& rxFrame)
{
- Window::Resize();
- // m_pImpl->OnResize();
-}
-
-
-
-
-void Sidebar::GetFocus (void)
-{
- Window::GetFocus();
- // m_pImpl->OnGetFocus();
+ SidebarController* pController = SidebarController::GetSidebarControllerForFrame(rxFrame);
+ const PanelDescriptor* pPanelDescriptor = ResourceManager::Instance().GetPanelDescriptor(rsPanelId);
+ if (pController!=NULL && pPanelDescriptor != NULL)
+ {
+ // This should be a lot more sophisticated:
+ // - Make the deck switching asynchronous
+ // - Make sure that the panel is visible and expanded after
+ // the switch.
+ // - 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->RequestSwitchToDeck(pPanelDescriptor->msDeckId);
+ }
}
-void Sidebar::DataChanged (const DataChangedEvent& rDataChangedEvent)
+void Sidebar::ShowDeck (
+ const ::rtl::OUString& rsDeckId,
+ const Reference<frame::XFrame>& rxFrame)
{
- if (rDataChangedEvent.GetType() == DATACHANGED_SETTINGS
- && (rDataChangedEvent.GetFlags() & SETTINGS_STYLE)!= 0)
- {
- Invalidate();
- }
- else
- Window::DataChanged(rDataChangedEvent);
+ SidebarController* pController = SidebarController::GetSidebarControllerForFrame(rxFrame);
+ if (pController != NULL)
+ pController->RequestSwitchToDeck(rsDeckId);
}
-
-
} } // end of namespace sfx2::sidebar