diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-01-09 14:36:55 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-01-10 10:51:25 +0100 |
commit | fd1d7b8742da03c7c9253150c4511c49703bdcca (patch) | |
tree | cf52603245180598cc10dc5452aa011299eb4163 | |
parent | 947a78cb7ad61bc8a697f3d11df60dabb21f8df3 (diff) |
fwk: Use constructor feature for ToolBoxFactory.
Change-Id: I7391aa1b17f0228b718234efe19cff800b761ca2
-rw-r--r-- | framework/inc/uifactory/toolboxfactory.hxx | 50 | ||||
-rw-r--r-- | framework/source/register/registerservices.cxx | 2 | ||||
-rw-r--r-- | framework/source/uifactory/toolboxfactory.cxx | 39 | ||||
-rw-r--r-- | framework/util/fwk.component | 3 |
4 files changed, 31 insertions, 63 deletions
diff --git a/framework/inc/uifactory/toolboxfactory.hxx b/framework/inc/uifactory/toolboxfactory.hxx deleted file mode 100644 index deccecb170b4..000000000000 --- a/framework/inc/uifactory/toolboxfactory.hxx +++ /dev/null @@ -1,50 +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 . - */ - -#ifndef INCLUDED_FRAMEWORK_INC_UIFACTORY_TOOLBOXFACTORY_HXX -#define INCLUDED_FRAMEWORK_INC_UIFACTORY_TOOLBOXFACTORY_HXX - -#include <stdtypes.h> -#include <macros/xserviceinfo.hxx> -#include <services.h> -#include <uifactory/menubarfactory.hxx> - -#include <cppuhelper/weak.hxx> -#include <rtl/ustring.hxx> - -namespace framework -{ - -class ToolBoxFactory : public MenuBarFactory -{ - public: - ToolBoxFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ); - - // XInterface, XTypeProvider, XServiceInfo - DECLARE_XSERVICEINFO - - // XUIElementFactory - virtual ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement > SAL_CALL createUIElement( const OUString& ResourceURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Args ) throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); -}; - -} - -#endif // SFX_TOOLBOXFACTORY_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/register/registerservices.cxx b/framework/source/register/registerservices.cxx index b8071dc24da0..df031d49c518 100644 --- a/framework/source/register/registerservices.cxx +++ b/framework/source/register/registerservices.cxx @@ -51,7 +51,6 @@ #include <accelerators/globalacceleratorconfiguration.hxx> #include <accelerators/moduleacceleratorconfiguration.hxx> #include <accelerators/documentacceleratorconfiguration.hxx> -#include <uifactory/toolboxfactory.hxx> #include "uiconfiguration/windowstateconfiguration.hxx" #include <uielement/recentfilesmenucontroller.hxx> #include <uiconfiguration/uicategorydescription.hxx> @@ -83,7 +82,6 @@ COMPONENTGETFACTORY ( fwk, IFFACTORY( ::framework::GlobalAcceleratorConfiguration ) else IFFACTORY( ::framework::ModuleAcceleratorConfiguration ) else IFFACTORY( ::framework::DocumentAcceleratorConfiguration ) else - IFFACTORY( ::framework::ToolBoxFactory ) else IFFACTORY( ::framework::WindowStateConfiguration ) else IFFACTORY( ::framework::RecentFilesMenuController ) else IFFACTORY( ::framework::UICategoryDescription ) else diff --git a/framework/source/uifactory/toolboxfactory.cxx b/framework/source/uifactory/toolboxfactory.cxx index fe0104c28e3b..a0a517cfc130 100644 --- a/framework/source/uifactory/toolboxfactory.cxx +++ b/framework/source/uifactory/toolboxfactory.cxx @@ -17,8 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <uifactory/toolboxfactory.hxx> - #include <uielement/toolbarwrapper.hxx> #include <threadhelp/resetableguard.hxx> @@ -27,15 +25,16 @@ #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> - #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> +#include <cppuhelper/weak.hxx> #include <vcl/svapp.hxx> +#include <rtl/ref.hxx> #include <rtl/ustrbuf.hxx> -//_________________________________________________________________________________________________________________ -// Defines -//_________________________________________________________________________________________________________________ +#include <macros/xserviceinfo.hxx> +#include <services.h> +#include <uifactory/menubarfactory.hxx> using namespace com::sun::star::uno; using namespace com::sun::star::lang; @@ -43,13 +42,22 @@ using namespace com::sun::star::frame; using namespace com::sun::star::beans; using namespace com::sun::star::util; using namespace ::com::sun::star::ui; +using namespace framework; -namespace framework +namespace { + +class ToolBoxFactory : public MenuBarFactory { + public: + ToolBoxFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext ); + + // XInterface, XTypeProvider, XServiceInfo + DECLARE_XSERVICEINFO + + // XUIElementFactory + virtual css::uno::Reference< css::ui::XUIElement > SAL_CALL createUIElement( const OUString& ResourceURL, const css::uno::Sequence< css::beans::PropertyValue >& Args ) throw ( css::container::NoSuchElementException, css::lang::IllegalArgumentException, css::uno::RuntimeException ); +}; -//***************************************************************************************************************** -// XInterface, XTypeProvider, XServiceInfo -//***************************************************************************************************************** DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( ToolBoxFactory , ::cppu::OWeakObject , SERVICENAME_TOOLBARFACTORY , @@ -80,4 +88,15 @@ throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::l } +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_comp_framework_ToolBarFactory_get_implementation( + css::uno::XComponentContext * context, + uno_Sequence * arguments) +{ + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + rtl::Reference<ToolBoxFactory> x(new ToolBoxFactory(context)); + x->acquire(); + return static_cast<cppu::OWeakObject *>(x.get()); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/util/fwk.component b/framework/util/fwk.component index 010fa147fd84..c51fc5b09405 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -111,7 +111,8 @@ constructor="com_sun_star_comp_framework_ToolBarControllerFactory_get_implementation"> <service name="com.sun.star.frame.ToolbarControllerFactory"/> </implementation> - <implementation name="com.sun.star.comp.framework.ToolBarFactory"> + <implementation name="com.sun.star.comp.framework.ToolBarFactory" + constructor="com_sun_star_comp_framework_ToolBarFactory_get_implementation"> <service name="com.sun.star.ui.ToolBarFactory"/> </implementation> <implementation name="com.sun.star.comp.framework.UICategoryDescription"> |