diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-04-14 13:31:04 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-04-14 13:31:04 +0200 |
commit | 18ea7f6a93f93b333f3588879733d53f69b0c2f0 (patch) | |
tree | cb46867e8d1ee13195aff3e567f303d97eed3eae /sd | |
parent | f8f7f1f674de6802a3601a89b725ce6f9cb80cb0 (diff) |
slidecopy: when a panel is de/activated, let the drawing framework know of the change
Diffstat (limited to 'sd')
-rwxr-xr-x | sd/source/ui/toolpanel/ToolPanelViewShell.cxx | 68 |
1 files changed, 63 insertions, 5 deletions
diff --git a/sd/source/ui/toolpanel/ToolPanelViewShell.cxx b/sd/source/ui/toolpanel/ToolPanelViewShell.cxx index 2cf0399f1da8..fcdf130e27a0 100755 --- a/sd/source/ui/toolpanel/ToolPanelViewShell.cxx +++ b/sd/source/ui/toolpanel/ToolPanelViewShell.cxx @@ -178,7 +178,8 @@ private: // ===================================================================================================================== /** Inner implementation class of ToolPanelViewShell. */ -class ToolPanelViewShell_Impl : public ::boost::noncopyable +class ToolPanelViewShell_Impl :public ::boost::noncopyable + ,public ::svt::IToolPanelDeckListener { public: static const size_t mnInvalidId = static_cast< size_t >( -1 ); @@ -220,6 +221,14 @@ public: void ConnectToDockingWindow(); private: + // IToolPanelDeckListener overridables + virtual void PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition ); + virtual void PanelRemoved( const size_t i_nPosition ); + virtual void ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive ); + virtual void LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter ); + virtual void Dying(); + +private: struct InitialPanel { ::rtl::OUString sPanelResourceURL; @@ -372,10 +381,7 @@ void ToolPanelViewShell_Impl::Setup() else { ::boost::shared_ptr< FrameworkHelper > pFrameworkHelper( FrameworkHelper::Instance( GetAntiImpl().GetViewShellBase() ) ); - const Reference< XResourceId > xToolPanelId( pFrameworkHelper->CreateResourceId( - FrameworkHelper::msTaskPaneURL, FrameworkHelper::msRightPaneURL, aInitialPanel.sPanelResourceURL ) ); - pFrameworkHelper->GetConfigurationController()->requestResourceActivation( - xToolPanelId, ResourceActivationMode_REPLACE ); + pFrameworkHelper->RequestTaskPanel( aInitialPanel.sPanelResourceURL ); } } @@ -393,6 +399,7 @@ void ToolPanelViewShell_Impl::Cleanup() if ( m_pConfigListener.is() ) m_pConfigListener->dispose(); } + GetToolPanelDeck().RemoveListener( *this ); m_pTaskPaneController.reset(); m_pTaskPane.reset(); } @@ -722,6 +729,8 @@ ToolPanelViewShell_Impl::ToolPanelViewShell_Impl( ToolPanelViewShell& i_rPanelVi const String sPaneTitle( SdResId( STR_RIGHT_PANE_TITLE ) ); GetToolPanelDeck().SetAccessibleName( sPaneTitle ); GetToolPanelDeck().SetAccessibleDescription( sPaneTitle ); + + GetToolPanelDeck().AddListener( *this ); } // --------------------------------------------------------------------------------------------------------------------- @@ -730,6 +739,55 @@ ToolPanelViewShell_Impl::~ToolPanelViewShell_Impl() } // --------------------------------------------------------------------------------------------------------------------- +void ToolPanelViewShell_Impl::PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition ) +{ + // not interested in + (void)i_pPanel; + (void)i_nPosition; +} + +// --------------------------------------------------------------------------------------------------------------------- +void ToolPanelViewShell_Impl::PanelRemoved( const size_t i_nPosition ) +{ + // not interested in + (void)i_nPosition; +} + +// --------------------------------------------------------------------------------------------------------------------- +void ToolPanelViewShell_Impl::ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive ) +{ + (void)i_rOldActive; + + ::rtl::OUString sPanelURL; + if ( !!i_rNewActive ) + { + sPanelURL = GetTaskPane().GetPanelResourceURL( *i_rNewActive ); + const PanelId ePanelId( GetStandardPanelId( sPanelURL ) ); + if ( ePanelId == PID_UNKNOWN ) + sPanelURL = ::rtl::OUString(); + } + + if ( sPanelURL.getLength() ) + { + ::boost::shared_ptr< FrameworkHelper > pFrameworkHelper( FrameworkHelper::Instance( GetAntiImpl().GetViewShellBase() ) ); + pFrameworkHelper->RequestTaskPanel( sPanelURL ); + } +} + +// --------------------------------------------------------------------------------------------------------------------- +void ToolPanelViewShell_Impl::LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter ) +{ + // not interested in + (void)i_rNewLayouter; +} + +// --------------------------------------------------------------------------------------------------------------------- +void ToolPanelViewShell_Impl::Dying() +{ + // not interested in +} + +// --------------------------------------------------------------------------------------------------------------------- void ToolPanelViewShell_Impl::ConnectToDockingWindow() { m_pTaskPaneController.reset(); |