[Libreoffice-commits] core.git: Branch 'feature/sidebaropt' - sd/source

Michael Meeks michael.meeks at suse.com
Fri May 17 07:47:34 PDT 2013


 sd/source/ui/framework/factories/TaskPanelFactory.cxx |    2 -
 sd/source/ui/framework/tools/FrameworkHelper.cxx      |   27 +++++++++++++++---
 2 files changed, 24 insertions(+), 5 deletions(-)

New commits:
commit 010a7177cd65bdbe967eb7b4ed0ba9b8dabc0e5c
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Fri May 17 15:47:32 2013 +0100

    get the right service names.

diff --git a/sd/source/ui/framework/factories/TaskPanelFactory.cxx b/sd/source/ui/framework/factories/TaskPanelFactory.cxx
index af80933..750df6a 100644
--- a/sd/source/ui/framework/factories/TaskPanelFactory.cxx
+++ b/sd/source/ui/framework/factories/TaskPanelFactory.cxx
@@ -218,7 +218,7 @@ Reference<XResource> SAL_CALL TaskPanelFactory::createResource (
             if ( pToolPanel != NULL )
                 xResource = new TaskPanelResource( rxResourceId );
 
-            OSL_POSTCOND( xResource.is(), "TaskPanelFactory::createResource: did not find the given resource: '" << sPaneURL << "'" );
+            OSL_POSTCOND( xResource.is(), "TaskPanelFactory::createResource: did not find the given resource!");
         }
     }
 
diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index 1f91f17..b2cbf1f 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -19,6 +19,10 @@
 
 #include <osl/time.h>
 
+#include <comphelper/processfactory.hxx>
+#include <comphelper/configuration.hxx>
+#include "officecfg/Office/Common.hxx"
+
 #include "framework/FrameworkHelper.hxx"
 
 #include "framework/ConfigurationController.hxx"
@@ -610,6 +614,21 @@ Reference<XResourceId> FrameworkHelper::RequestSidebarPanel (
     const OUString& rsTaskPanelURL,
     const bool bEnsureTaskPaneIsVisible)
 {
+    // MMeeks ...
+    bool bSidebar = false;
+    try {
+        bSidebar = officecfg::Office::Common::Misc::ExperimentalSidebar::get(
+                        comphelper::getProcessComponentContext());
+    } catch (const uno::Exception &e) {
+        SAL_WARN("sd", "don't have experimental sidebar option installed");
+    }
+
+    OUString aViewURL, aPaneURL;
+    aViewURL = bSidebar ? FrameworkHelper::msSidebarViewURL :
+                          FrameworkHelper::msTaskPaneURL;
+    aPaneURL = bSidebar ? FrameworkHelper::msSidebarPaneURL :
+                          FrameworkHelper::msRightPaneURL;
+
     try
     {
         if (mxConfigurationController.is())
@@ -621,7 +640,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;
@@ -631,12 +650,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, aPaneURL));
             mxConfigurationController->requestResourceActivation(
                 xPanelId,
                 ResourceActivationMode_REPLACE);


More information about the Libreoffice-commits mailing list