diff options
author | Andre Fischer <af@apache.org> | 2013-06-05 15:40:56 +0000 |
---|---|---|
committer | Andre Fischer <af@apache.org> | 2013-06-05 15:40:56 +0000 |
commit | 7b26aba94e5544937f1e37e34915bcb276bc3c27 (patch) | |
tree | babede9a22ad29ca8ccd9e33acc788348befc6b5 /sfx2/source/sidebar/Sidebar.cxx | |
parent | 136976efb17b8617a83c7f26601cd04031b51e7f (diff) |
122470: Fixed programmatic triggered switching of sidebar decks.
Notes
merged as: 50cbbc7f3afdd077e98f416f97390fe93428e8cf
Diffstat (limited to 'sfx2/source/sidebar/Sidebar.cxx')
-rw-r--r-- | sfx2/source/sidebar/Sidebar.cxx | 65 |
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 |