summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-01-09 13:09:36 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2014-01-10 10:16:06 +0100
commit3d7306000070dd0422f1230e90f0d80b579db88e (patch)
treef5083df72b8c6579d66bb268e351049163b8dafb
parent0acccc9195baa257c2edc47eb34a654b7fd52a60 (diff)
fwk: Use constructor feature for AddonsToolBoxFactory.
Change-Id: Ifd0c71a5f37fa87c8acc2d810496925788be99ef
-rw-r--r--framework/inc/uifactory/addonstoolboxfactory.hxx71
-rw-r--r--framework/source/register/registerservices.cxx2
-rw-r--r--framework/source/uifactory/addonstoolboxfactory.cxx56
-rw-r--r--framework/util/fwk.component3
4 files changed, 47 insertions, 85 deletions
diff --git a/framework/inc/uifactory/addonstoolboxfactory.hxx b/framework/inc/uifactory/addonstoolboxfactory.hxx
deleted file mode 100644
index e6583e0f8cde..000000000000
--- a/framework/inc/uifactory/addonstoolboxfactory.hxx
+++ /dev/null
@@ -1,71 +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_ADDONSTOOLBOXFACTORY_HXX
-#define INCLUDED_FRAMEWORK_INC_UIFACTORY_ADDONSTOOLBOXFACTORY_HXX
-
-#include <stdtypes.h>
-#include <threadhelp/threadhelpbase.hxx>
-#include <macros/generic.hxx>
-#include <macros/xinterface.hxx>
-#include <macros/xtypeprovider.hxx>
-#include <macros/xserviceinfo.hxx>
-#include <services.h>
-
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XTypeProvider.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/ui/XUIElementFactory.hpp>
-#include <com/sun/star/frame/XModuleManager2.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-
-#include <cppuhelper/implbase2.hxx>
-#include <rtl/ustring.hxx>
-
-namespace framework
-{
-
-class AddonsToolBoxFactory : protected ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
- public ::cppu::WeakImplHelper2< com::sun::star::lang::XServiceInfo ,
- com::sun::star::ui::XUIElementFactory >
-{
- public:
- AddonsToolBoxFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext );
- virtual ~AddonsToolBoxFactory();
-
- // 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 );
-
- sal_Bool hasButtonsInContext( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& rPropSeq,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
-
- private:
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager2 > m_xModuleManager;
-};
-
-}
-
-#endif // INCLUDED_FRAMEWORK_INC_UIFACTORY_ADDONSTOOLBOXFACTORY_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/register/registerservices.cxx b/framework/source/register/registerservices.cxx
index b6796d8e8b97..768fbd2f5638 100644
--- a/framework/source/register/registerservices.cxx
+++ b/framework/source/register/registerservices.cxx
@@ -53,7 +53,6 @@
#include <accelerators/moduleacceleratorconfiguration.hxx>
#include <accelerators/documentacceleratorconfiguration.hxx>
#include <uifactory/toolboxfactory.hxx>
-#include <uifactory/addonstoolboxfactory.hxx>
#include "uiconfiguration/windowstateconfiguration.hxx"
#include <services/autorecovery.hxx>
#include <helper/statusindicatorfactory.hxx>
@@ -91,7 +90,6 @@ COMPONENTGETFACTORY ( fwk,
IFFACTORY( ::framework::ModuleAcceleratorConfiguration ) else
IFFACTORY( ::framework::DocumentAcceleratorConfiguration ) else
IFFACTORY( ::framework::ToolBoxFactory ) else
- IFFACTORY( ::framework::AddonsToolBoxFactory ) else
IFFACTORY( ::framework::WindowStateConfiguration ) else
IFFACTORY( ::framework::ToolbarControllerFactory ) else
IFFACTORY( ::framework::AutoRecovery ) else
diff --git a/framework/source/uifactory/addonstoolboxfactory.cxx b/framework/source/uifactory/addonstoolboxfactory.cxx
index 2c51b9d8d425..105f155faee0 100644
--- a/framework/source/uifactory/addonstoolboxfactory.cxx
+++ b/framework/source/uifactory/addonstoolboxfactory.cxx
@@ -17,26 +17,29 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <uifactory/addonstoolboxfactory.hxx>
-
#include <uielement/addonstoolbarwrapper.hxx>
#include <threadhelp/resetableguard.hxx>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
+#include <com/sun/star/frame/XModuleManager2.hpp>
#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
-
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
+#include <com/sun/star/ui/XUIElementFactory.hpp>
+#include <cppuhelper/implbase2.hxx>
#include <vcl/svapp.hxx>
+#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
-//_________________________________________________________________________________________________________________
-// Defines
-//_________________________________________________________________________________________________________________
+#include <macros/generic.hxx>
+#include <macros/xinterface.hxx>
+#include <macros/xtypeprovider.hxx>
+#include <macros/xserviceinfo.hxx>
+#include <services.h>
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
@@ -44,13 +47,33 @@ 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 {
-namespace framework
+class AddonsToolBoxFactory : protected ThreadHelpBase, // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public ::cppu::WeakImplHelper2< css::lang::XServiceInfo ,
+ css::ui::XUIElementFactory >
{
+ public:
+ AddonsToolBoxFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext );
+ virtual ~AddonsToolBoxFactory();
+
+ // 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 );
+
+ sal_Bool hasButtonsInContext( const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& rPropSeq,
+ const css::uno::Reference< css::frame::XFrame >& rFrame );
+
+ private:
+ css::uno::Reference< css::uno::XComponentContext > m_xContext;
+ css::uno::Reference< css::frame::XModuleManager2 > m_xModuleManager;
+};
+
-//*****************************************************************************************************************
-// XInterface, XTypeProvider, XServiceInfo
-//*****************************************************************************************************************
PRIVATE_DEFINE_XSERVICEINFO_NEWSTYLE( AddonsToolBoxFactory,
::cppu::OWeakObject,
SERVICENAME_TOOLBARFACTORY,
@@ -197,4 +220,15 @@ throw ( ::com::sun::star::container::NoSuchElementException,
}
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_framework_AddonsToolBarFactory_get_implementation(
+ css::uno::XComponentContext * context,
+ uno_Sequence * arguments)
+{
+ assert(arguments != 0 && arguments->nElements == 0); (void) arguments;
+ rtl::Reference<AddonsToolBoxFactory> x(new AddonsToolBoxFactory(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 1971d4a9d124..c066749d97a9 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -22,7 +22,8 @@
<implementation name="com.sun.star.comp.frame.SessionListener">
<service name="com.sun.star.frame.SessionListener"/>
</implementation>
- <implementation name="com.sun.star.comp.framework.AddonsToolBarFactory">
+ <implementation name="com.sun.star.comp.framework.AddonsToolBarFactory"
+ constructor="com_sun_star_comp_framework_AddonsToolBarFactory_get_implementation">
<service name="com.sun.star.ui.ToolBarFactory"/>
</implementation>
<implementation name="com.sun.star.comp.framework.AutoRecovery">