From 54d820a7815af03a248c1aa424fae9bf9a4881f4 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Fri, 17 May 2013 11:51:41 +0100 Subject: add experimental option for sidebar to 'Advanced' pane. --- sd/source/ui/framework/module/ImpressModule.cxx | 10 ++++++++-- sd/source/ui/framework/tools/FrameworkHelper.cxx | 17 +++++++++++++---- sd/source/ui/sidebar/PanelFactory.cxx | 14 ++++++++++++++ 3 files changed, 35 insertions(+), 6 deletions(-) (limited to 'sd/source') diff --git a/sd/source/ui/framework/module/ImpressModule.cxx b/sd/source/ui/framework/module/ImpressModule.cxx index 240a94a23cf3..cd417647f5cb 100644 --- a/sd/source/ui/framework/module/ImpressModule.cxx +++ b/sd/source/ui/framework/module/ImpressModule.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - +#include "sfx2/viewfrm.hxx" #include "framework/ImpressModule.hxx" #include "framework/FrameworkHelper.hxx" @@ -45,9 +45,15 @@ void ImpressModule::Initialize (Reference& rxController) new SlideSorterModule( rxController, FrameworkHelper::msLeftImpressPaneURL); + + bool bSidebar = SfxViewFrame::IsSidebarEnabled(); new ToolPanelModule( rxController, - FrameworkHelper::msSidebarViewURL); + bSidebar ? FrameworkHelper::msSidebarViewURL : + FrameworkHelper::msTaskPaneURL, + bSidebar ? FrameworkHelper::msSidebarPaneURL : + FrameworkHelper::msRightPaneURL + ); new ToolBarModule(rxController); new ShellStackGuard(rxController); } diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx index ab98a7ac4779..88517327e1b1 100644 --- a/sd/source/ui/framework/tools/FrameworkHelper.cxx +++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx @@ -19,6 +19,7 @@ #include +#include "sfx2/viewfrm.hxx" #include "framework/FrameworkHelper.hxx" #include "framework/ConfigurationController.hxx" @@ -608,6 +609,14 @@ Reference FrameworkHelper::RequestSidebarPanel ( const OUString& rsTaskPanelURL, const bool bEnsureTaskPaneIsVisible) { + OUString aViewURL, aPaneURL; + bool bSidebar = SfxViewFrame::IsSidebarEnabled(); + + aViewURL = bSidebar ? FrameworkHelper::msSidebarViewURL : + FrameworkHelper::msTaskPaneURL; + aPaneURL = bSidebar ? FrameworkHelper::msSidebarPaneURL : + FrameworkHelper::msRightPaneURL; + try { if (mxConfigurationController.is()) @@ -619,7 +628,7 @@ Reference FrameworkHelper::RequestSidebarPanel ( mxConfigurationController->getCurrentConfiguration()); if (xConfiguration.is()) if ( ! xConfiguration->hasResource( - CreateResourceId(msSidebarViewURL, msSidebarPaneURL))) + CreateResourceId(aViewURL, aPaneURL))) { // Task pane is not active. Do not force it. return NULL; @@ -629,12 +638,12 @@ Reference FrameworkHelper::RequestSidebarPanel ( // Create the resource id from URLs for the sidebar pane // and view and the requested panel. mxConfigurationController->requestResourceActivation( - CreateResourceId(msSidebarPaneURL), + CreateResourceId(aPaneURL), ResourceActivationMode_ADD); mxConfigurationController->requestResourceActivation( - CreateResourceId(msSidebarViewURL, msSidebarPaneURL), + CreateResourceId(aViewURL, aPaneURL), ResourceActivationMode_REPLACE); - Reference xPanelId (CreateResourceId(rsTaskPanelURL, msSidebarViewURL, msSidebarPaneURL)); + Reference xPanelId (CreateResourceId(rsTaskPanelURL, aViewURL, aPanelURL)); mxConfigurationController->requestResourceActivation( xPanelId, ResourceActivationMode_REPLACE); diff --git a/sd/source/ui/sidebar/PanelFactory.cxx b/sd/source/ui/sidebar/PanelFactory.cxx index 193468a3ff43..2b457819b28f 100644 --- a/sd/source/ui/sidebar/PanelFactory.cxx +++ b/sd/source/ui/sidebar/PanelFactory.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * @@ -34,6 +35,10 @@ #include #include +#include +#include +#include "officecfg/Office/Common.hxx" + using namespace css; using namespace cssu; using namespace ::sd::framework; @@ -71,6 +76,13 @@ Reference mxControllerDisposeListener; Reference SAL_CALL PanelFactory_createInstance ( const Reference& rxContext) { + bool bSidebar = SfxViewFrame::IsSidebarEnabled(); + if (!bSidebar) + { + SAL_WARN( "sd", "Creating a disabled sidebar factory" ); + return NULL; + } + return Reference(static_cast(new PanelFactory(rxContext))); } @@ -205,3 +217,5 @@ Reference SAL_CALL PanelFactory::createUIElement ( } } // end of namespace sd::sidebar + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit