diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2010-07-21 15:32:50 +0200 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2010-07-21 15:32:50 +0200 |
commit | 61c93d60bfaf4a012cbe151400d1a246908f7146 (patch) | |
tree | 9fcc89b8bc2399f96ca056ccd06d15efed33115d /sd/source | |
parent | 1d97771f1ea5dffc86a0fc5b1e1ec90a34553092 (diff) | |
parent | b79aa65826172f959dc1c40b2d03bf139a96b8dd (diff) |
CWS-TOOLING: integrate CWS unoawt2
Diffstat (limited to 'sd/source')
-rwxr-xr-x | sd/source/ui/dlg/PaneChildWindows.cxx | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/sd/source/ui/dlg/PaneChildWindows.cxx b/sd/source/ui/dlg/PaneChildWindows.cxx index 6a6d515822f8..181fc8433c22 100755 --- a/sd/source/ui/dlg/PaneChildWindows.cxx +++ b/sd/source/ui/dlg/PaneChildWindows.cxx @@ -45,6 +45,9 @@ namespace sd { +using ::com::sun::star::uno::Reference; +using ::com::sun::star::drawing::framework::XResourceId; + SFX_IMPL_DOCKINGWINDOW(LeftPaneImpressChildWindow, SID_LEFT_PANE_IMPRESS) SFX_IMPL_DOCKINGWINDOW(LeftPaneDrawChildWindow, SID_LEFT_PANE_DRAW) SFX_IMPL_DOCKINGWINDOW( ToolPanelChildWindow, SID_TASKPANE) @@ -151,6 +154,25 @@ ToolPanelChildWindow::ToolPanelChildWindow( ::Window* i_pParentWindow, USHORT i_ } //---------------------------------------------------------------------------------------------------------------------- +struct DelayedToolPanelActivation +{ + DelayedToolPanelActivation( ToolPanelChildWindow& i_rToolPanelWindow, const ::rtl::OUString& i_rPanelURL ) + :m_rToolPanelWindow( i_rToolPanelWindow ) + ,m_sPanelURL( i_rPanelURL ) + { + } + + void operator() (bool) + { + m_rToolPanelWindow.ActivateToolPanel( m_sPanelURL ); + } + +private: + ToolPanelChildWindow& m_rToolPanelWindow; + const ::rtl::OUString m_sPanelURL; +}; + +//---------------------------------------------------------------------------------------------------------------------- void ToolPanelChildWindow::ActivateToolPanel( const ::rtl::OUString& i_rPanelURL ) { SfxDockingWindow* pDockingWindow = dynamic_cast< SfxDockingWindow* >( GetWindow() ); @@ -170,8 +192,16 @@ void ToolPanelChildWindow::ActivateToolPanel( const ::rtl::OUString& i_rPanelURL // extensions, too. As long as this is not the case, we need to take the direct way ... ::boost::shared_ptr< ViewShell > pViewShell = pFrameworkHelper->GetViewShell( framework::FrameworkHelper::msRightPaneURL ); toolpanel::ToolPanelViewShell* pToolPanelViewShell = dynamic_cast< toolpanel::ToolPanelViewShell* >( pViewShell.get() ); - ENSURE_OR_RETURN_VOID( pToolPanelViewShell != NULL, "ToolPanelChildWindow::ActivateToolPanel: no tool panel view shell access!" ); - pToolPanelViewShell->ActivatePanel( i_rPanelURL ); + if ( pToolPanelViewShell ) + { + pToolPanelViewShell->ActivatePanel( i_rPanelURL ); + } + else + { + Reference< XResourceId > xTaskPaneResource = pFrameworkHelper->RequestView( + framework::FrameworkHelper::msTaskPaneURL, framework::FrameworkHelper::msRightPaneURL ); + pFrameworkHelper->RunOnResourceActivation( xTaskPaneResource, DelayedToolPanelActivation( *this, i_rPanelURL ) ); + } } } |