diff options
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/framework/module/ModuleController.cxx | 46 | ||||
-rw-r--r-- | sd/source/ui/inc/DrawController.hxx | 4 | ||||
-rw-r--r-- | sd/source/ui/inc/framework/ModuleController.hxx | 15 | ||||
-rw-r--r-- | sd/source/ui/unoidl/DrawController.cxx | 11 | ||||
-rw-r--r-- | sd/util/sd.component | 4 |
5 files changed, 20 insertions, 60 deletions
diff --git a/sd/source/ui/framework/module/ModuleController.cxx b/sd/source/ui/framework/module/ModuleController.cxx index 4d98bbfa38c2..ab6cc1e16703 100644 --- a/sd/source/ui/framework/module/ModuleController.cxx +++ b/sd/source/ui/framework/module/ModuleController.cxx @@ -37,14 +37,10 @@ using ::sd::tools::ConfigurationAccess; namespace sd::framework { -//===== ModuleController ====================================================== -Reference<XModuleController> ModuleController::CreateInstance() +ModuleController::ModuleController(const css::uno::Reference<css::frame::XController>& rxController) { - return new ModuleController(); -} + assert(rxController); -ModuleController::ModuleController() -{ /** Load a list of URL to service mappings. The mappings are stored in the mpResourceToFactoryMap member. @@ -75,6 +71,15 @@ ModuleController::ModuleController() "private:resource/toolpanel/TableDesign", "private:resource/toolpanel/CustomAnimations", "private:resource/toolpanel/SlideTransitions" }); + + try + { + mxController = rxController; + + InstantiateStartupServices(); + } + catch (RuntimeException&) + {} } ModuleController::~ModuleController() noexcept @@ -161,36 +166,7 @@ void SAL_CALL ModuleController::requestResource (const OUString& rsResourceURL) maLoadedFactories[iFactory->second] = xFactory; } -//----- XInitialization ------------------------------------------------------- - -void SAL_CALL ModuleController::initialize (const Sequence<Any>& aArguments) -{ - if (aArguments.hasElements()) - { - try - { - // Get the XController from the first argument. - mxController.set(aArguments[0], UNO_QUERY_THROW); - - InstantiateStartupServices(); - } - catch (RuntimeException&) - {} - } -} - } // end of namespace sd::framework -extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* -com_sun_star_comp_Draw_framework_module_ModuleController_get_implementation( - css::uno::XComponentContext* /*context*/, - css::uno::Sequence<css::uno::Any> const &) -{ - css::uno::Reference< css::uno::XInterface > xModCont ( sd::framework::ModuleController::CreateInstance() ); - xModCont->acquire(); - return xModCont.get(); -} - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/inc/DrawController.hxx b/sd/source/ui/inc/DrawController.hxx index 1031d8185c89..bae71ee0f00e 100644 --- a/sd/source/ui/inc/DrawController.hxx +++ b/sd/source/ui/inc/DrawController.hxx @@ -40,6 +40,7 @@ namespace com::sun::star::drawing::framework { class XModuleController; } namespace com::sun::star::drawing { class XLayer; } namespace osl { class Mutex; } namespace sd::framework { class ConfigurationController; } +namespace sd::framework { class ModuleController; } class SdPage; namespace sd { @@ -297,8 +298,7 @@ private: css::uno::Reference<css::drawing::XDrawSubController> mxSubController; rtl::Reference<sd::framework::ConfigurationController> mxConfigurationController; - css::uno::Reference< - css::drawing::framework::XModuleController> mxModuleController; + rtl::Reference<sd::framework::ModuleController> mxModuleController; /** Send an event to all relevant property listeners that a property has changed its value. The fire() method of the diff --git a/sd/source/ui/inc/framework/ModuleController.hxx b/sd/source/ui/inc/framework/ModuleController.hxx index dd8985e175a1..6b4763d2e5b1 100644 --- a/sd/source/ui/inc/framework/ModuleController.hxx +++ b/sd/source/ui/inc/framework/ModuleController.hxx @@ -32,8 +32,7 @@ namespace com::sun::star::uno { class XComponentContext; } namespace sd::framework { typedef comphelper::WeakComponentImplHelper < - css::drawing::framework::XModuleController, - css::lang::XInitialization + css::drawing::framework::XModuleController > ModuleControllerInterfaceBase; /** The ModuleController has two tasks: @@ -57,9 +56,8 @@ class ModuleController final : public ModuleControllerInterfaceBase { public: - static css::uno::Reference< - css::drawing::framework::XModuleController> - CreateInstance(); + /// @throws std::exception + ModuleController(const css::uno::Reference<css::frame::XController>& rxController); virtual void disposing(std::unique_lock<std::mutex>&) override; @@ -67,11 +65,6 @@ public: virtual void SAL_CALL requestResource(const OUString& rsResourceURL) override; - // XInitialization - - virtual void SAL_CALL initialize( - const css::uno::Sequence<css::uno::Any>& aArguments) override; - private: css::uno::Reference< css::frame::XController> mxController; @@ -79,8 +72,6 @@ private: std::unordered_map<OUString, OUString> maResourceToFactoryMap; std::unordered_map<OUString, css::uno::WeakReference<css::uno::XInterface>> maLoadedFactories; - /// @throws std::exception - ModuleController(); ModuleController (const ModuleController&) = delete; virtual ~ModuleController() noexcept override; diff --git a/sd/source/ui/unoidl/DrawController.cxx b/sd/source/ui/unoidl/DrawController.cxx index 457231e6e537..59a2159c6838 100644 --- a/sd/source/ui/unoidl/DrawController.cxx +++ b/sd/source/ui/unoidl/DrawController.cxx @@ -26,6 +26,7 @@ #include <FormShellManager.hxx> #include <Window.hxx> #include <framework/ConfigurationController.hxx> +#include <framework/ModuleController.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/sequence.hxx> @@ -34,7 +35,6 @@ #include <cppuhelper/typeprovider.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> -#include <com/sun/star/drawing/framework/ModuleController.hpp> #include <com/sun/star/drawing/XDrawSubController.hpp> #include <com/sun/star/drawing/XLayer.hpp> @@ -763,9 +763,7 @@ void DrawController::ProvideFrameworkControllers() ::comphelper::getProcessComponentContext() ); mxConfigurationController = new sd::framework::ConfigurationController( xController); - mxModuleController = ModuleController::create( - xContext, - xController); + mxModuleController = new sd::framework::ModuleController(xController); } catch (const RuntimeException&) { @@ -776,9 +774,8 @@ void DrawController::ProvideFrameworkControllers() void DrawController::DisposeFrameworkControllers() { - Reference<XComponent> xComponent (mxModuleController, UNO_QUERY); - if (xComponent.is()) - xComponent->dispose(); + if (mxModuleController.is()) + mxModuleController->dispose(); if (mxConfigurationController.is()) mxConfigurationController->dispose(); diff --git a/sd/util/sd.component b/sd/util/sd.component index 012eab8ed233..be3f2710f683 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.module.ModuleController" - constructor="com_sun_star_comp_Draw_framework_module_ModuleController_get_implementation"> - <service name="com.sun.star.drawing.framework.ModuleController"/> - </implementation> <implementation name="com.sun.star.comp.draw.SdHtmlOptionsDialog" constructor="com_sun_star_comp_draw_SdHtmlOptionsDialog_get_implementation"> <service name="com.sun.star.ui.dialog.FilterOptionsDialog"/> |