[Libreoffice-commits] core.git: Branch 'feature/sidebaropt' - 4 commits - cui/uiconfig include/sfx2 sc/source sd/source sfx2/source sw/source

Michael Meeks michael.meeks at suse.com
Fri May 17 12:33:40 PDT 2013


 cui/uiconfig/ui/optadvancedpage.ui               |    2 
 include/sfx2/sidebar/SidebarChildWindow.hxx      |    2 
 include/sfx2/viewfrm.hxx                         |    3 
 sc/source/ui/app/scdll.cxx                       |    2 
 sd/source/ui/app/sddll2.cxx                      |    2 
 sd/source/ui/framework/module/ImpressModule.cxx  |   14 -
 sd/source/ui/framework/tools/FrameworkHelper.cxx |   16 -
 sd/source/ui/sidebar/PanelFactory.cxx            |   14 +
 sd/source/ui/sidebar/SidebarFactory.cxx          |  236 -----------------------
 sd/source/ui/sidebar/SidebarFactory.hxx          |  116 -----------
 sfx2/source/sidebar/SidebarChildWindow.cxx       |    8 
 sfx2/source/view/viewfrm.cxx                     |   51 ++++
 sw/source/ui/app/swmodule.cxx                    |    2 
 13 files changed, 86 insertions(+), 382 deletions(-)

New commits:
commit 689b27e446b697bc73b3a4c58c0afc1a536862da
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Fri May 17 20:32:16 2013 +0100

    Only register and use the Sidebar if it is globally enabled.

diff --git a/include/sfx2/sidebar/SidebarChildWindow.hxx b/include/sfx2/sidebar/SidebarChildWindow.hxx
index 194f098..0d9739d 100644
--- a/include/sfx2/sidebar/SidebarChildWindow.hxx
+++ b/include/sfx2/sidebar/SidebarChildWindow.hxx
@@ -39,6 +39,8 @@ public:
         SfxBindings* pBindings,
         SfxChildWinInfo* pInfo);
 
+    static void RegisterChildWindowIfEnabled (sal_Bool bVisible=sal_False, SfxModule *pMod=NULL, sal_uInt16 nFlags=0);
+
     SFX_DECL_CHILDWINDOW_WITHID(SidebarChildWindow);
 
     static sal_Int32 GetDefaultWidth (Window* pWindow);
diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index 897a59f..981df14 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -229,7 +229,7 @@ void ScDLL::Init()
 
     // common SFX controller
     ::sfx2::TaskPaneWrapper::RegisterChildWindow( false, pMod );
-    ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod);
+    ::sfx2::sidebar::SidebarChildWindowIfEnabled::RegisterChildWindow(false, pMod);
 
     // Svx-StatusBar-Controller
     SvxInsertStatusBarControl       ::RegisterControl(SID_ATTR_INSERT,      pMod);
diff --git a/sd/source/ui/app/sddll2.cxx b/sd/source/ui/app/sddll2.cxx
index d28257d..78c78ea 100644
--- a/sd/source/ui/app/sddll2.cxx
+++ b/sd/source/ui/app/sddll2.cxx
@@ -127,7 +127,7 @@ void SdDLL::RegisterControllers()
     ::sd::LeftPaneImpressChildWindow::RegisterChildWindow(0, pMod);
     ::sd::LeftPaneDrawChildWindow::RegisterChildWindow(0, pMod);
     ::sd::ToolPanelChildWindow::RegisterChildWindow(0, pMod);
-    ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(0, pMod);
+    ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindowIfEnabled(0, pMod);
 
     SvxFillToolBoxControl::RegisterControl(0, pMod);
     SvxLineStyleToolBoxControl::RegisterControl(0, pMod);
diff --git a/sfx2/source/sidebar/SidebarChildWindow.cxx b/sfx2/source/sidebar/SidebarChildWindow.cxx
index cb001ce..dfaff1e 100644
--- a/sfx2/source/sidebar/SidebarChildWindow.cxx
+++ b/sfx2/source/sidebar/SidebarChildWindow.cxx
@@ -22,6 +22,7 @@
 #include "sfx2/sfxsids.hrc"
 #include "helpid.hrc"
 #include "sfx2/dockwin.hxx"
+#include "sfx2/viewfrm.hxx"
 #include <sfx2/sidebar/ResourceDefinitions.hrc>
 
 
@@ -73,5 +74,12 @@ sal_Int32 SidebarChildWindow::GetDefaultWidth (Window* pWindow)
         return 0;
 }
 
+void SidebarChildWindow::RegisterChildWindowIfEnabled (sal_Bool bVisible,
+						       SfxModule *pMod,
+						       sal_uInt16 nFlags)
+{
+    if ( SfxViewFrame::IsSidebarEnabled() )
+        RegisterChildWindow( bVisible, pMod, nFlags );
+}
 
 } } // end of namespace sfx2::sidebar
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index b8a9fb6..219f5dc 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -30,6 +30,7 @@
 #include <com/sun/star/frame/XLoadable.hpp>
 #include <com/sun/star/frame/XLayoutManager.hpp>
 #include <com/sun/star/frame/XComponentLoader.hpp>
+#include <com/sun/star/ui/UIElementFactoryManager.hpp>
 
 #include <toolkit/unohlp.hxx>
 #include <vcl/splitwin.hxx>
@@ -3410,13 +3411,32 @@ bool SfxViewFrame::IsSidebarEnabled()
     if (!bInitialized)
     {
         bInitialized = true;
+        css::uno::Reference< css::uno::XComponentContext > xContext;
+        xContext = ::comphelper::getProcessComponentContext();
         try {
-            bEnabled = officecfg::Office::Common::Misc::ExperimentalSidebar::get(
-                           comphelper::getProcessComponentContext());
+            bEnabled = officecfg::Office::Common::Misc::ExperimentalSidebar::get( xContext );
         } catch (const uno::Exception &e) {
             SAL_WARN("sfx2.view", "don't have experimental sidebar option installed");
         }
+
+        // rip out the services from framework/ for good measure
+        if( !bEnabled )
+        {
+            try
+            {
+                uno::Reference< ui::XUIElementFactoryManager > xUIElementFactory = ui::UIElementFactoryManager::create( xContext );
+                xUIElementFactory->deregisterFactory( "toolpanel", "ScPanelFactory", "" );
+                xUIElementFactory->deregisterFactory( "toolpanel", "SwPanelFactory", "" );
+                xUIElementFactory->deregisterFactory( "toolpanel", "SvxPanelFactory", "" );
+                xUIElementFactory->deregisterFactory( "toolpanel", "SdPanelFactory", "" );
+            }
+            catch ( const uno::Exception &e )
+            {
+                SAL_WARN( "sfx2.view", "Exception de-registering sidebar factories " << e.Message );
+            }
+        }
     }
+
     return bEnabled;
 }
 
diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx
index 126cea5..fb53d18 100644
--- a/sw/source/ui/app/swmodule.cxx
+++ b/sw/source/ui/app/swmodule.cxx
@@ -400,7 +400,7 @@ void SwDLL::RegisterControls()
     ::avmedia::MediaPlayer::RegisterChildWindow(0, pMod);
 
     SvxSmartTagsControl::RegisterControl(SID_OPEN_SMARTTAGMENU, pMod);
-    ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(0, pMod);
+    ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindowIfEnabled(0, pMod);
     ::sfx2::TaskPaneWrapper::RegisterChildWindow(0, pMod);
 }
 
commit 075755886200c94131415a3040b13eec54d33c3d
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Fri May 17 20:07:29 2013 +0100

    disable sidebar menu option if it is disabled.

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 801b08c..b8a9fb6 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -3220,7 +3220,7 @@ void SfxViewFrame::ChildWindowState( SfxItemSet& rState )
         }
         else if ( nSID == SID_TASKPANE )
         {
-            if  ( !KnowsChildWindow( nSID ) )
+            if ( !KnowsChildWindow( nSID ) )
             {
                 OSL_FAIL( "SID_TASKPANE state requested, but no task pane child window exists for this ID!" );
                 rState.DisableItem( nSID );
@@ -3236,6 +3236,11 @@ void SfxViewFrame::ChildWindowState( SfxItemSet& rState )
         }
         else if ( nSID == SID_SIDEBAR )
         {
+            if ( !IsSidebarEnabled() )
+            {
+                rState.DisableItem( nSID );
+                rState.Put( SfxVisibilityItem( nSID, sal_False ) );
+            }
             if  ( !KnowsChildWindow( nSID ) )
             {
                 OSL_ENSURE( false, "SID_TASKPANE state requested, but no task pane child window exists for this ID!" );
commit 2ffd6e90c6c44fdb68e9e6873e5c42df4320e044
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Fri May 17 20:01:01 2013 +0100

    Make clear changing sidebar enablement requires a re-start.

diff --git a/cui/uiconfig/ui/optadvancedpage.ui b/cui/uiconfig/ui/optadvancedpage.ui
index 8fac290..1c54497 100644
--- a/cui/uiconfig/ui/optadvancedpage.ui
+++ b/cui/uiconfig/ui/optadvancedpage.ui
@@ -341,7 +341,7 @@
                 </child>
                 <child>
                   <object class="GtkCheckButton" id="exp_sidebar">
-                    <property name="label" translatable="yes">Enable experimental sidebar</property>
+                    <property name="label" translatable="yes">Enable experimental sidebar (on restart)</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">False</property>
diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index 522b471..c31681b 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -152,6 +152,9 @@ public:
 
     static void ActivateToolPanel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, const OUString& i_rPanelURL );
 
+    /// is the new sidebar enabled for the app as a whole ?
+    static bool IsSidebarEnabled();
+
     // interne Handler
     SAL_DLLPRIVATE virtual sal_Bool SetBorderPixelImpl( const SfxViewShell *pSh, const SvBorder &rBorder );
     SAL_DLLPRIVATE virtual const SvBorder& GetBorderPixelImpl( const SfxViewShell *pSh ) const;
diff --git a/sd/source/ui/framework/module/ImpressModule.cxx b/sd/source/ui/framework/module/ImpressModule.cxx
index 2c2ac43..cd41764 100644
--- a/sd/source/ui/framework/module/ImpressModule.cxx
+++ b/sd/source/ui/framework/module/ImpressModule.cxx
@@ -17,10 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <comphelper/processfactory.hxx>
-#include <comphelper/configuration.hxx>
-#include "officecfg/Office/Common.hxx"
-
+#include "sfx2/viewfrm.hxx"
 #include "framework/ImpressModule.hxx"
 
 #include "framework/FrameworkHelper.hxx"
@@ -49,14 +46,7 @@ void ImpressModule::Initialize (Reference<frame::XController>& rxController)
         rxController,
         FrameworkHelper::msLeftImpressPaneURL);
 
-    // 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");
-    }
+    bool bSidebar = SfxViewFrame::IsSidebarEnabled();
     new ToolPanelModule(
         rxController,
         bSidebar ? FrameworkHelper::msSidebarViewURL :
diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index 9ea22bf..19bcabb 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -19,10 +19,7 @@
 
 #include <osl/time.h>
 
-#include <comphelper/processfactory.hxx>
-#include <comphelper/configuration.hxx>
-#include "officecfg/Office/Common.hxx"
-
+#include "sfx2/viewfrm.hxx"
 #include "framework/FrameworkHelper.hxx"
 
 #include "framework/ConfigurationController.hxx"
@@ -615,16 +612,9 @@ 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;
+    bool bSidebar = SfxViewFrame::IsSidebarEnabled();
+
     aViewURL = bSidebar ? FrameworkHelper::msSidebarViewURL :
                           FrameworkHelper::msTaskPaneURL;
     aPaneURL = bSidebar ? FrameworkHelper::msSidebarPaneURL :
diff --git a/sd/source/ui/sidebar/PanelFactory.cxx b/sd/source/ui/sidebar/PanelFactory.cxx
index 193468a..2b45781 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: */
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 4faf84f..801b08c 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -92,6 +92,10 @@
 #include <svtools/svtresid.hxx>
 #include <framework/framelistanalyzer.hxx>
 
+#include <comphelper/processfactory.hxx>
+#include <comphelper/configuration.hxx>
+#include "officecfg/Office/Common.hxx"
+
 #include <boost/optional.hpp>
 
 using namespace ::com::sun::star;
@@ -3391,4 +3395,24 @@ void SfxViewFrame::RemoveInfoBar( const OUString& sId )
     }
 }
 
+bool SfxViewFrame::IsSidebarEnabled()
+{
+    static bool bInitialized = false;
+    static bool bEnabled = false;
+
+    // read the setting once at start, and that's what we
+    // stick with for now.
+    if (!bInitialized)
+    {
+        bInitialized = true;
+        try {
+            bEnabled = officecfg::Office::Common::Misc::ExperimentalSidebar::get(
+                           comphelper::getProcessComponentContext());
+        } catch (const uno::Exception &e) {
+            SAL_WARN("sfx2.view", "don't have experimental sidebar option installed");
+        }
+    }
+    return bEnabled;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 9139398752814bb318d6e395faa85e8c848a5c3c
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Fri May 17 17:39:09 2013 +0100

    remove apparently un-used SidebarFactory modules
    
    Seems that PanelFactory contains duplicate code for these.

diff --git a/sd/source/ui/sidebar/SidebarFactory.cxx b/sd/source/ui/sidebar/SidebarFactory.cxx
deleted file mode 100644
index cea2e14b..0000000
--- a/sd/source/ui/sidebar/SidebarFactory.cxx
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#include "precompiled_sd.hxx"
-
-#include "SidebarFactory.hxx"
-#include "framework/Pane.hxx"
-#include "ViewShellBase.hxx"
-#include "DrawController.hxx"
-#include "LayoutMenu.hxx"
-#include "CurrentMasterPagesSelector.hxx"
-#include "RecentMasterPagesSelector.hxx"
-#include "AllMasterPagesSelector.hxx"
-#include "CustomAnimationPanel.hxx"
-#include "TableDesignPanel.hxx"
-#include "SlideTransitionPanel.hxx"
-
-#include <sfx2/viewfrm.hxx>
-#include <sfx2/sidebar/SidebarPanelBase.hxx>
-#include <comphelper/namedvaluecollection.hxx>
-#include <vcl/window.hxx>
-#include <toolkit/helper/vclunohelper.hxx>
-
-using namespace css;
-using namespace cssu;
-using namespace ::sd::framework;
-using ::rtl::OUString;
-
-#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
-
-namespace sd { namespace sidebar {
-
-namespace {
-    /** Note that these names have to be identical to (the tail of)
-        the entries in officecfg/registry/data/org/openoffice/Office/Impress.xcu
-        for the TaskPanelFactory.
-    */
-    const static char* gsResourceNameCustomAnimations = "/CustomAnimations";
-    const static char* gsResourceNameLayouts = "/Layouts";
-    const static char* gsResourceNameAllMasterPages = "/AllMasterPages";
-    const static char* gsResourceNameRecentMasterPages = "/RecentMasterPages";
-    const static char* gsResourceNameUsedMasterPages = "/UsedMasterPages";
-    const static char* gsResourceNameSlideTransitions = "/SlideTransitions";
-    const static char* gsResourceNameTableDesign = "/TableDesign";
-}
-
-Reference<lang::XEventListener> mxControllerDisposeListener;
-
-
-
-// ----- Service functions ----------------------------------------------------
-
-Reference<XInterface> SAL_CALL SidebarFactory_createInstance (
-    const Reference<XComponentContext>& rxContext)
-{
-    return Reference<XInterface>(static_cast<XWeak*>(new SidebarFactory(rxContext)));
-}
-
-
-
-
-::rtl::OUString SidebarFactory_getImplementationName (void) throw(RuntimeException)
-{
-    return ::rtl::OUString(
-        RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.Draw.framework.SidebarFactory"));
-}
-
-
-
-
-Sequence<rtl::OUString> SAL_CALL SidebarFactory_getSupportedServiceNames (void)
-    throw (RuntimeException)
-{
-    static const ::rtl::OUString sServiceName(
-        ::rtl::OUString::createFromAscii("com.sun.star.drawing.framework.SidebarFactory"));
-    return Sequence<rtl::OUString>(&sServiceName, 1);
-}
-
-
-
-
-//----- SidebarFactory --------------------------------------------------------
-
-SidebarFactory::SidebarFactory(
-        const css::uno::Reference<css::uno::XComponentContext>& rxContext)
-    : SidebarFactoryInterfaceBase(m_aMutex)
-{
-}
-
-
-
-
-SidebarFactory::~SidebarFactory (void)
-{
-}
-
-
-
-
-void SAL_CALL SidebarFactory::disposing (void)
-{
-}
-
-
-
-
-// XInitialization
-
-void SAL_CALL SidebarFactory::initialize (const Sequence<Any>& aArguments)
-    throw (Exception, RuntimeException)
-{
-}
-
-
-
-
-// XUIElementFactory
-
-Reference<ui::XUIElement> SAL_CALL SidebarFactory::createUIElement (
-    const ::rtl::OUString& rsUIElementResourceURL,
-    const ::cssu::Sequence<css::beans::PropertyValue>& rArguments)
-    throw(
-        css::container::NoSuchElementException,
-        css::lang::IllegalArgumentException,
-        cssu::RuntimeException)
-{
-    // Process arguments.
-    const ::comphelper::NamedValueCollection aArguments (rArguments);
-    Reference<frame::XFrame> xFrame (aArguments.getOrDefault("Frame", Reference<frame::XFrame>()));
-    Reference<awt::XWindow> xParentWindow (aArguments.getOrDefault("ParentWindow", Reference<awt::XWindow>()));
-    Reference<ui::XSidebar> xSidebar (aArguments.getOrDefault("Sidebar", Reference<ui::XSidebar>()));
-
-    // Throw exceptions when the arguments are not as expected.
-    ::Window* pParentWindow = VCLUnoHelper::GetWindow(xParentWindow);
-    if ( ! xParentWindow.is() || pParentWindow==NULL)
-        throw RuntimeException(
-            A2S("SidebarFactory::createUIElement called without ParentWindow"),
-            NULL);
-    if ( ! xFrame.is())
-        throw RuntimeException(
-            A2S("SidebarFactory::createUIElement called without XFrame"),
-            NULL);
-
-    // Tunnel through the controller to obtain a ViewShellBase.
-    ViewShellBase* pBase = NULL;
-    Reference<lang::XUnoTunnel> xTunnel (xFrame->getController(), UNO_QUERY);
-    if (xTunnel.is())
-    {
-        ::sd::DrawController* pController = reinterpret_cast<sd::DrawController*>(
-            xTunnel->getSomething(sd::DrawController::getUnoTunnelId()));
-        if (pController != NULL)
-            pBase = pController->GetViewShellBase();
-    }
-    if (pBase == NULL)
-        throw RuntimeException(A2S("can not get ViewShellBase for frame"), NULL);
-
-    // Create a framework view.
-    ::Window* pControl = NULL;
-
-#define EndsWith(s,t) s.endsWithAsciiL(t,strlen(t))
-    if (EndsWith(rsUIElementResourceURL, gsResourceNameCustomAnimations))
-        pControl = new CustomAnimationPanel(pParentWindow, *pBase);
-    else if (EndsWith(rsUIElementResourceURL, gsResourceNameLayouts))
-        pControl = new LayoutMenu(pParentWindow, *pBase, xSidebar);
-    else if (EndsWith(rsUIElementResourceURL, gsResourceNameAllMasterPages))
-        pControl = AllMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar);
-    else if (EndsWith(rsUIElementResourceURL, gsResourceNameRecentMasterPages))
-        pControl = RecentMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar);
-    else if (EndsWith(rsUIElementResourceURL, gsResourceNameUsedMasterPages))
-        pControl = CurrentMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar);
-    else if (EndsWith(rsUIElementResourceURL, gsResourceNameSlideTransitions))
-        pControl = new SlideTransitionPanel(pParentWindow, *pBase);
-    else if (EndsWith(rsUIElementResourceURL, gsResourceNameTableDesign))
-        pControl = new TableDesignPanel(pParentWindow, *pBase);
-#undef EndsWith
-
-    if (pControl == NULL)
-        throw lang::IllegalArgumentException();
-
-    // Create a wrapper around pane and view and return it as
-    // XUIElement.
-    Reference<ui::XUIElement> xUIElement;
-    try
-    {
-        xUIElement.set(
-            sfx2::sidebar::SidebarPanelBase::Create(
-                rsUIElementResourceURL,
-                xFrame,
-                pControl,
-                ui::LayoutSize(-1,-1,-1)));
-    }
-    catch(Exception& rException)
-    {
-        // Creation of XUIElement failed. mxUIElement remains empty.
-    }
-
-    Reference<lang::XComponent> xComponent (xUIElement, UNO_QUERY);
-    if (xComponent.is())
-        xComponent->addEventListener(this);
-
-    return xUIElement;
-}
-
-
-
-
-void SAL_CALL SidebarFactory::disposing (const ::css::lang::EventObject& rEvent)
-    throw(cssu::RuntimeException)
-{
-    /*
-    if (mpImplementation
-        && rEvent.Source == mpImplementation->mxUIElement)
-    {
-        mpImplementation->mxUIElement.clear();
-    }
-    */
-}
-
-
-
-
-} } // end of namespace sd::sidebar
diff --git a/sd/source/ui/sidebar/SidebarFactory.hxx b/sd/source/ui/sidebar/SidebarFactory.hxx
deleted file mode 100644
index daf1e4c..0000000
--- a/sd/source/ui/sidebar/SidebarFactory.hxx
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef SD_SIDEBAR_FACTORY_HXX
-#define SD_SIDEBAR_FACTORY_HXX
-
-#include <cppuhelper/compbase4.hxx>
-#include <cppuhelper/basemutex.hxx>
-#include <rtl/ref.hxx>
-#include "framework/Pane.hxx"
-
-#include <com/sun/star/ui/XUIElementFactory.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-
-#include <map>
-#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
-
-
-namespace css = ::com::sun::star;
-namespace cssu = ::com::sun::star::uno;
-
-
-namespace sd {
-    class ViewShellBase;
-}
-
-namespace sd { namespace sidebar {
-
-namespace
-{
-    typedef ::cppu::WeakComponentImplHelper3 <
-        css::lang::XInitialization,
-        css::ui::XUIElementFactory,
-        css::lang::XEventListener
-        > SidebarFactoryInterfaceBase;
-}
-
-
-/** This factory creates both XUIElements (for sidebar panels) and
-    a drawing framework pane.
-
-    The drawing framework pane is a container for the SidebarViewShell
-    which is necessary to run the legacy implementations of the task
-    pane panels.
-
-    Control and information flow is like this:
-
-    When one of the old task panels is requested to be displayed in
-    the sidebar this factory is called for
-    XUIElementFactory::createUIElement().
-    One of the arguments, the window, is then exported into the
-    drawing framework as pane.  After this the drawing framework is
-    used to create the SidebarViewShell (once known as
-    TaskPaneViewShell or ToolPanelViewShell) and the requested panel.
-*/
-class SidebarFactory
-    : private ::boost::noncopyable,
-      private ::cppu::BaseMutex,
-      public SidebarFactoryInterfaceBase
-{
-public:
-    static ::rtl::OUString SAL_CALL getImplementationName (void);
-    static cssu::Reference<cssu::XInterface> SAL_CALL createInstance (
-        const cssu::Reference<css::lang::XMultiServiceFactory>& rxFactory);
-    static cssu::Sequence<rtl::OUString> SAL_CALL getSupportedServiceNames (void);
-
-    SidebarFactory (const cssu::Reference<cssu::XComponentContext>& rxContext);
-    virtual ~SidebarFactory (void);
-
-    virtual void SAL_CALL disposing (void);
-
-
-    // XInitialization
-
-    virtual void SAL_CALL initialize(
-        const css::uno::Sequence<css::uno::Any>& aArguments)
-        throw (css::uno::Exception, css::uno::RuntimeException);
-
-
-    // XUIElementFactory
-
-    cssu::Reference<css::ui::XUIElement> SAL_CALL createUIElement (
-        const ::rtl::OUString& rsResourceURL,
-        const ::cssu::Sequence<css::beans::PropertyValue>& rArguments)
-        throw(
-            css::container::NoSuchElementException,
-            css::lang::IllegalArgumentException,
-            cssu::RuntimeException);
-
-
-    // XEventListener
-
-    virtual void SAL_CALL disposing (const ::css::lang::EventObject& rEvent)
-        throw(cssu::RuntimeException);
-};
-
-
-} } // end of namespace sd::sidebar
-
-#endif


More information about the Libreoffice-commits mailing list