offapi/UnoApi_offapi.mk                                           |    1 
 offapi/com/sun/star/drawing/framework/ConfigurationController.idl |   42 
----------
 sd/source/ui/framework/configuration/ConfigurationController.cxx  |   32 
+------
 sd/source/ui/inc/DrawController.hxx                               |    6 -
 sd/source/ui/inc/framework/ConfigurationController.hxx            |   11 --
 sd/source/ui/unoidl/DrawController.cxx                            |   10 --
 sd/util/sd.component                                              |    4 
 solenv/bin/native-code.py                                         |    1 
 8 files changed, 16 insertions(+), 91 deletions(-)

New commits:
commit 31a5db6f28cd006adf5630b2c5d683accb9eeadb
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Jan 23 12:14:25 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Jan 24 05:46:58 2023 +0000

    [API CHANGE] remove service sd::framework::ConfigurationController
    
    It makes no sense to be constructed externally.
    
    Change-Id: I6fb8f58ff8594c58d190f78e6f26b2703046a95b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146001
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 0041655dac91..0f3a4a371a73 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -148,7 +148,6 @@ $(eval $(call 
gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/drawing/framework
        BasicPaneFactory \
        BasicToolBarFactory \
        BasicViewFactory \
-       ConfigurationController \
        ModuleController \
        ResourceId \
 ))
diff --git a/offapi/com/sun/star/drawing/framework/ConfigurationController.idl 
b/offapi/com/sun/star/drawing/framework/ConfigurationController.idl
deleted file mode 100644
index 46df3fa820f0..000000000000
--- a/offapi/com/sun/star/drawing/framework/ConfigurationController.idl
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * 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 .
- */
-
-module com { module sun { module star { module drawing { module framework {
-
-/** See XConfigurationController for a description of the
-    configuration controller.
-
-    <p>This service is used at the moment by the
-    XControllerManager to create a configuration controller.
-    This allows developers to replace the default implementation of the
-    configuration controller with their own.  This may not be a useful
-    feature.  Furthermore the sub controllers may need a tighter coupling
-    than the interfaces allow.  These are reasons for removing this service
-    in the future and let the controller manager create the sub controllers
-    directly.</p>
-*/
-service ConfigurationController
-    : XConfigurationController
-{
-    create ([in] ::com::sun::star::frame::XController xController);
-};
-
-}; }; }; }; }; // ::com::sun::star::drawing::framework
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/framework/configuration/ConfigurationController.cxx 
b/sd/source/ui/framework/configuration/ConfigurationController.cxx
index 3fc95adb9b96..59fdf374a74f 100644
--- a/sd/source/ui/framework/configuration/ConfigurationController.cxx
+++ b/sd/source/ui/framework/configuration/ConfigurationController.cxx
@@ -101,10 +101,15 @@ ConfigurationController::Lock::~Lock()
 
 //===== ConfigurationController ===============================================
 
-ConfigurationController::ConfigurationController() noexcept
+ConfigurationController::ConfigurationController(const 
css::uno::Reference<css::frame::XController>& rxController) noexcept
     : ConfigurationControllerInterfaceBase(m_aMutex)
     , mbIsDisposed(false)
 {
+    const SolarMutexGuard aSolarGuard;
+
+    mpImplementation.reset(new Implementation(
+        *this,
+        rxController));
 }
 
 ConfigurationController::~ConfigurationController() noexcept
@@ -475,22 +480,6 @@ Reference<XResourceFactory> SAL_CALL 
ConfigurationController::getResourceFactory
     return 
mpImplementation->mpResourceFactoryContainer->GetFactory(sResourceURL);
 }
 
-//----- XInitialization -------------------------------------------------------
-
-void SAL_CALL ConfigurationController::initialize (const Sequence<Any>& 
aArguments)
-{
-    ::osl::MutexGuard aGuard (m_aMutex);
-
-    if (aArguments.getLength() == 1)
-    {
-        const SolarMutexGuard aSolarGuard;
-
-        mpImplementation.reset(new Implementation(
-            *this,
-            Reference<frame::XController>(aArguments[0], UNO_QUERY_THROW)));
-    }
-}
-
 void ConfigurationController::ThrowIfDisposed () const
 {
     if (mbIsDisposed)
@@ -529,13 +518,4 @@ ConfigurationController::Implementation::Implementation (
 } // end of namespace sd::framework
 
 
-extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
-com_sun_star_comp_Draw_framework_configuration_ConfigurationController_get_implementation(
-        css::uno::XComponentContext*,
-        css::uno::Sequence<css::uno::Any> const &)
-{
-    return cppu::acquire(new sd::framework::ConfigurationController());
-}
-
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/DrawController.hxx 
b/sd/source/ui/inc/DrawController.hxx
index c2f4f7be215d..1031d8185c89 100644
--- a/sd/source/ui/inc/DrawController.hxx
+++ b/sd/source/ui/inc/DrawController.hxx
@@ -29,6 +29,7 @@
 #include <comphelper/uno3.hxx>
 #include <cppuhelper/implbase.hxx>
 #include <unotools/weakref.hxx>
+#include <rtl/ref.hxx>
 #include <tools/gen.hxx>
 #include <memory>
 #include <vector>
@@ -38,7 +39,7 @@ namespace com::sun::star::drawing::framework { class 
XConfigurationController; }
 namespace com::sun::star::drawing::framework { class XModuleController; }
 namespace com::sun::star::drawing { class XLayer; }
 namespace osl { class Mutex; }
-
+namespace sd::framework { class ConfigurationController; }
 class SdPage;
 
 namespace sd {
@@ -295,8 +296,7 @@ private:
     */
     css::uno::Reference<css::drawing::XDrawSubController> mxSubController;
 
-    css::uno::Reference<
-        css::drawing::framework::XConfigurationController> 
mxConfigurationController;
+    rtl::Reference<sd::framework::ConfigurationController> 
mxConfigurationController;
     css::uno::Reference<
         css::drawing::framework::XModuleController> mxModuleController;
 
diff --git a/sd/source/ui/inc/framework/ConfigurationController.hxx 
b/sd/source/ui/inc/framework/ConfigurationController.hxx
index 2fe2f48d063c..0fd7c648c7fd 100644
--- a/sd/source/ui/inc/framework/ConfigurationController.hxx
+++ b/sd/source/ui/inc/framework/ConfigurationController.hxx
@@ -32,12 +32,12 @@ namespace com::sun::star::drawing::framework { class 
XConfiguration; }
 namespace com::sun::star::drawing::framework { class 
XConfigurationChangeRequest; }
 namespace com::sun::star::drawing::framework { class XResourceId; }
 namespace com::sun::star::drawing::framework { struct 
ConfigurationChangeEvent; }
+namespace com::sun::star::frame { class XController; }
 
 namespace sd::framework {
 
 typedef ::cppu::WeakComponentImplHelper <
-    css::drawing::framework::XConfigurationController,
-    css::lang::XInitialization
+    css::drawing::framework::XConfigurationController
     > ConfigurationControllerInterfaceBase;
 
 /** The configuration controller is responsible for maintaining the current
@@ -51,7 +51,7 @@ class ConfigurationController
       public ConfigurationControllerInterfaceBase
 {
 public:
-    ConfigurationController() noexcept;
+    ConfigurationController(const 
css::uno::Reference<css::frame::XController>& rxController) noexcept;
     virtual ~ConfigurationController() noexcept override;
     ConfigurationController(const ConfigurationController&) = delete;
     ConfigurationController& operator=(const ConfigurationController&) = 
delete;
@@ -142,11 +142,6 @@ public:
         SAL_CALL getResourceFactory (
         const OUString& sResourceURL) override;
 
-    // XInitialization
-
-    virtual void SAL_CALL initialize(
-        const css::uno::Sequence<css::uno::Any>& rArguments) override;
-
     /** Use this class instead of calling lock() and unlock() directly in
         order to be exception safe.
     */
diff --git a/sd/source/ui/unoidl/DrawController.cxx 
b/sd/source/ui/unoidl/DrawController.cxx
index f33e9038131f..457231e6e537 100644
--- a/sd/source/ui/unoidl/DrawController.cxx
+++ b/sd/source/ui/unoidl/DrawController.cxx
@@ -25,6 +25,7 @@
 #include <ViewShellManager.hxx>
 #include <FormShellManager.hxx>
 #include <Window.hxx>
+#include <framework/ConfigurationController.hxx>
 
 #include <comphelper/processfactory.hxx>
 #include <comphelper/sequence.hxx>
@@ -33,7 +34,6 @@
 #include <cppuhelper/typeprovider.hxx>
 
 #include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/drawing/framework/ConfigurationController.hpp>
 #include <com/sun/star/drawing/framework/ModuleController.hpp>
 #include <com/sun/star/drawing/XDrawSubController.hpp>
 #include <com/sun/star/drawing/XLayer.hpp>
@@ -761,8 +761,7 @@ void DrawController::ProvideFrameworkControllers()
         Reference<XController> xController (this);
         const Reference<XComponentContext> xContext (
             ::comphelper::getProcessComponentContext() );
-        mxConfigurationController = ConfigurationController::create(
-            xContext,
+        mxConfigurationController = new sd::framework::ConfigurationController(
             xController);
         mxModuleController = ModuleController::create(
             xContext,
@@ -781,9 +780,8 @@ void DrawController::DisposeFrameworkControllers()
     if (xComponent.is())
         xComponent->dispose();
 
-    xComponent.set(mxConfigurationController, UNO_QUERY);
-    if (xComponent.is())
-        xComponent->dispose();
+    if (mxConfigurationController.is())
+        mxConfigurationController->dispose();
 }
 
 void DrawController::ThrowIfDisposed() const
diff --git a/sd/util/sd.component b/sd/util/sd.component
index 414e25dd49a4..012eab8ed233 100644
--- a/sd/util/sd.component
+++ b/sd/util/sd.component
@@ -65,10 +65,6 @@
       
constructor="org_openoffice_comp_Draw_framework_PanelFactory_get_implementation">
     <service name="com.sun.star.drawing.framework.PanelFactory"/>
   </implementation>
-  <implementation 
name="com.sun.star.comp.Draw.framework.configuration.ConfigurationController"
-      
constructor="com_sun_star_comp_Draw_framework_configuration_ConfigurationController_get_implementation">
-    <service name="com.sun.star.drawing.framework.ConfigurationController"/>
-  </implementation>
   <implementation 
name="com.sun.star.comp.Draw.framework.module.ModuleController"
       
constructor="com_sun_star_comp_Draw_framework_module_ModuleController_get_implementation">
     <service name="com.sun.star.drawing.framework.ModuleController"/>
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 697eef875815..03ec10d7baf3 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -704,7 +704,6 @@ draw_constructor_list = [
     "com_sun_star_comp_Draw_framework_BasicToolBarFactory_get_implementation",
     "com_sun_star_comp_Draw_framework_BasicViewFactory_get_implementation",
     "com_sun_star_comp_Draw_framework_ResourceID_get_implementation",
-    
"com_sun_star_comp_Draw_framework_configuration_ConfigurationController_get_implementation",
     
"com_sun_star_comp_Draw_framework_module_ModuleController_get_implementation",
     "org_openoffice_comp_Draw_framework_PanelFactory_get_implementation",
     "css_comp_Impress_oox_PowerPointExport",

Reply via email to