diff options
Diffstat (limited to 'sd/source/ui')
-rwxr-xr-x | sd/source/ui/dlg/PaneChildWindows.cxx | 27 | ||||
-rw-r--r-- | sd/source/ui/inc/PaneChildWindows.hxx | 7 | ||||
-rw-r--r-- | sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx | 5 | ||||
-rwxr-xr-x | sd/source/ui/toolpanel/ToolPanelViewShell.cxx | 8 |
4 files changed, 46 insertions, 1 deletions
diff --git a/sd/source/ui/dlg/PaneChildWindows.cxx b/sd/source/ui/dlg/PaneChildWindows.cxx index 26ad4436b7c1..6a6d515822f8 100755 --- a/sd/source/ui/dlg/PaneChildWindows.cxx +++ b/sd/source/ui/dlg/PaneChildWindows.cxx @@ -32,6 +32,7 @@ #include "PaneDockingWindow.hxx" #include "ViewShellBase.hxx" #include "framework/FrameworkHelper.hxx" +#include "taskpane/ToolPanelViewShell.hxx" #include "app.hrc" #include "strings.hrc" #include "sdresid.hxx" @@ -40,6 +41,7 @@ #include <sfx2/dockwin.hxx> #include <sfx2/bindings.hxx> #include <sfx2/dispatch.hxx> +#include <tools/diagnose_ex.h> namespace sd { @@ -148,4 +150,29 @@ ToolPanelChildWindow::ToolPanelChildWindow( ::Window* i_pParentWindow, USHORT i_ { } +//---------------------------------------------------------------------------------------------------------------------- +void ToolPanelChildWindow::ActivateToolPanel( const ::rtl::OUString& i_rPanelURL ) +{ + SfxDockingWindow* pDockingWindow = dynamic_cast< SfxDockingWindow* >( GetWindow() ); + ViewShellBase* pViewShellBase = ViewShellBase::GetViewShellBase( pDockingWindow->GetBindings().GetDispatcher()->GetFrame() ); + ENSURE_OR_RETURN_VOID( pViewShellBase != NULL, "ToolPanelChildWindow::ActivateToolPanel: no view shell access!" ); + + const ::boost::shared_ptr< framework::FrameworkHelper > pFrameworkHelper( framework::FrameworkHelper::Instance( *pViewShellBase ) ); + + if ( i_rPanelURL.indexOf( framework::FrameworkHelper::msTaskPanelURLPrefix ) == 0 ) + { + // it's one of our standard panels known to the drawing framework + pFrameworkHelper->RequestTaskPanel( i_rPanelURL ); + } + else + { + // TODO: it would be nice if the drawing framework were able to handle non-standard panels, installed by + // 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 ); + } +} + } // end of namespace ::sd diff --git a/sd/source/ui/inc/PaneChildWindows.hxx b/sd/source/ui/inc/PaneChildWindows.hxx index c43cd371eb24..9ba0a1f03720 100644 --- a/sd/source/ui/inc/PaneChildWindows.hxx +++ b/sd/source/ui/inc/PaneChildWindows.hxx @@ -29,6 +29,7 @@ #define SD_PANE_CHILD_WINDOWS_HXX #include <sfx2/childwin.hxx> +#include <sfx2/taskpane.hxx> namespace sd { @@ -77,7 +78,8 @@ public: //====================================================================================================================== //= ToolPanelChildWindow //====================================================================================================================== -class ToolPanelChildWindow : public PaneChildWindow +class ToolPanelChildWindow :public PaneChildWindow + ,public ::sfx2::ITaskPaneToolPanelAccess { public: ToolPanelChildWindow( @@ -87,6 +89,9 @@ public: SfxChildWinInfo* i_pChildWindowInfo ); SFX_DECL_CHILDWINDOW( ToolPanelChildWindow ); + + // ::sfx2::ITaskPaneToolPanelAccess + virtual void ActivateToolPanel( const ::rtl::OUString& i_rPanelURL ); }; diff --git a/sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx b/sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx index 9f56fa9bf25a..5bd0cd877803 100644 --- a/sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx +++ b/sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx @@ -102,6 +102,11 @@ public: TaskPaneShellManager& GetSubShellManager (void) const; + /** deactivates the given panel, bypassing the configuration controller. Only valid for tool panels which are + not under the drawing framework's control. + */ + void ActivatePanel( const ::rtl::OUString& i_rPanelResourceURL ); + /** deactivates the given panel, bypassing the configuration controller */ void DeactivatePanel( const ::rtl::OUString& i_rPanelResourceURL ); diff --git a/sd/source/ui/toolpanel/ToolPanelViewShell.cxx b/sd/source/ui/toolpanel/ToolPanelViewShell.cxx index b0539b14f41a..c62faf29ca50 100755 --- a/sd/source/ui/toolpanel/ToolPanelViewShell.cxx +++ b/sd/source/ui/toolpanel/ToolPanelViewShell.cxx @@ -733,6 +733,14 @@ Reference< XUIElement > ToolPanelViewShell::CreatePanelUIElement( const Referenc } // --------------------------------------------------------------------------------------------------------------------- +void ToolPanelViewShell::ActivatePanel( const ::rtl::OUString& i_rPanelResourceURL ) +{ + OSL_ENSURE( i_rPanelResourceURL.indexOf( FrameworkHelper::msTaskPanelURLPrefix ) < 0, + "ToolPanelViewShell::ActivatePanel: for drawing-framework-controller panels, please use FrameworkHelper::RequestTaskPanel!" ); + mpImpl->ActivatePanelByResource( i_rPanelResourceURL ); +} + +// --------------------------------------------------------------------------------------------------------------------- void ToolPanelViewShell::DeactivatePanel( const ::rtl::OUString& i_rPanelResourceURL ) { mpImpl->DeactivatePanelByResource( i_rPanelResourceURL ); |