summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-05-17 11:51:41 +0100
committerMichael Meeks <michael.meeks@suse.com>2013-05-20 11:33:37 +0100
commit54d820a7815af03a248c1aa424fae9bf9a4881f4 (patch)
tree39fbdc1950ed87d86c0cf936b26741927b591daf /sd/source
parente9c2d5b26b1e1b52bdf87192a76314b7362fa80c (diff)
add experimental option for sidebar to 'Advanced' pane.
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/framework/module/ImpressModule.cxx10
-rw-r--r--sd/source/ui/framework/tools/FrameworkHelper.cxx17
-rw-r--r--sd/source/ui/sidebar/PanelFactory.cxx14
3 files changed, 35 insertions, 6 deletions
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<frame::XController>& 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 <osl/time.h>
+#include "sfx2/viewfrm.hxx"
#include "framework/FrameworkHelper.hxx"
#include "framework/ConfigurationController.hxx"
@@ -608,6 +609,14 @@ Reference<XResourceId> 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<XResourceId> 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<XResourceId> 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<XResourceId> xPanelId (CreateResourceId(rsTaskPanelURL, msSidebarViewURL, msSidebarPaneURL));
+ Reference<XResourceId> 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 <vcl/window.hxx>
#include <toolkit/helper/vclunohelper.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/configuration.hxx>
+#include "officecfg/Office/Common.hxx"
+
using namespace css;
using namespace cssu;
using namespace ::sd::framework;
@@ -71,6 +76,13 @@ Reference<lang::XEventListener> mxControllerDisposeListener;
Reference<XInterface> SAL_CALL PanelFactory_createInstance (
const Reference<XComponentContext>& rxContext)
{
+ bool bSidebar = SfxViewFrame::IsSidebarEnabled();
+ if (!bSidebar)
+ {
+ SAL_WARN( "sd", "Creating a disabled sidebar factory" );
+ return NULL;
+ }
+
return Reference<XInterface>(static_cast<XWeak*>(new PanelFactory(rxContext)));
}
@@ -205,3 +217,5 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
} } // end of namespace sd::sidebar
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */