summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-01-09 14:07:36 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2014-01-10 10:24:49 +0100
commitffd95b11d401c7ae8186218a58b1228838209705 (patch)
tree3c6fa0df8256da48705ca2767385f03e558e7d33
parentbcda535f96f858c6176f9b2c0a3575804a78a10a (diff)
fwk: Use constructor feature for StatusBarFactory.
Change-Id: Ida879614e1b63bfd76f662f6286cc5f9f82ae64e
-rw-r--r--framework/inc/uifactory/statusbarfactory.hxx51
-rw-r--r--framework/source/register/registerservices.cxx2
-rw-r--r--framework/source/uifactory/statusbarfactory.cxx38
-rw-r--r--framework/util/fwk.component3
4 files changed, 31 insertions, 63 deletions
diff --git a/framework/inc/uifactory/statusbarfactory.hxx b/framework/inc/uifactory/statusbarfactory.hxx
deleted file mode 100644
index 3bbfbf456368..000000000000
--- a/framework/inc/uifactory/statusbarfactory.hxx
+++ /dev/null
@@ -1,51 +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_STATUSBARFACTORY_HXX
-#define INCLUDED_FRAMEWORK_INC_UIFACTORY_STATUSBARFACTORY_HXX
-
-#include <stdtypes.h>
-
-#include <macros/xserviceinfo.hxx>
-#include <services.h>
-#include <uifactory/menubarfactory.hxx>
-
-#include <rtl/ustring.hxx>
-
-namespace framework
-{
-
-class StatusBarFactory : public MenuBarFactory
-{
- public:
- StatusBarFactory( 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 // INCLUDED_FRAMEWORK_INC_UIFACTORY_STATUSBARFACTORY_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/register/registerservices.cxx b/framework/source/register/registerservices.cxx
index 57b435bc6987..36e31335e18c 100644
--- a/framework/source/register/registerservices.cxx
+++ b/framework/source/register/registerservices.cxx
@@ -55,7 +55,6 @@
#include "uiconfiguration/windowstateconfiguration.hxx"
#include <helper/statusindicatorfactory.hxx>
#include <uielement/recentfilesmenucontroller.hxx>
-#include <uifactory/statusbarfactory.hxx>
#include <uiconfiguration/uicategorydescription.hxx>
#include <services/sessionlistener.hxx>
#include <services/taskcreatorsrv.hxx>
@@ -89,7 +88,6 @@ COMPONENTGETFACTORY ( fwk,
IFFACTORY( ::framework::WindowStateConfiguration ) else
IFFACTORY( ::framework::StatusIndicatorFactory ) else
IFFACTORY( ::framework::RecentFilesMenuController ) else
- IFFACTORY( ::framework::StatusBarFactory ) else
IFFACTORY( ::framework::UICategoryDescription ) else
IFFACTORY( ::framework::SessionListener ) else
IFFACTORY( ::framework::SessionListener ) else
diff --git a/framework/source/uifactory/statusbarfactory.cxx b/framework/source/uifactory/statusbarfactory.cxx
index 729e1b719996..9927a72f17b4 100644
--- a/framework/source/uifactory/statusbarfactory.cxx
+++ b/framework/source/uifactory/statusbarfactory.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <uifactory/statusbarfactory.hxx>
#include <uifactory/menubarfactory.hxx>
#include <uielement/statusbarwrapper.hxx>
@@ -32,11 +31,10 @@
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
#include <vcl/svapp.hxx>
+#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
-
-//_________________________________________________________________________________________________________________
-// Defines
-//_________________________________________________________________________________________________________________
+#include <macros/xserviceinfo.hxx>
+#include <services.h>
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
@@ -45,12 +43,23 @@ using namespace com::sun::star::beans;
using namespace com::sun::star::util;
using namespace ::com::sun::star::ui;
-namespace framework
+using namespace framework;
+
+namespace {
+
+class StatusBarFactory : public MenuBarFactory
{
+ public:
+ StatusBarFactory( 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( StatusBarFactory ,
::cppu::OWeakObject ,
SERVICENAME_STATUSBARFACTORY ,
@@ -82,4 +91,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_StatusBarFactory_get_implementation(
+ css::uno::XComponentContext * context,
+ uno_Sequence * arguments)
+{
+ assert(arguments != 0 && arguments->nElements == 0); (void) arguments;
+ rtl::Reference<StatusBarFactory> x(new StatusBarFactory(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 fff861c36439..523218b96d58 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -96,7 +96,8 @@
constructor="com_sun_star_comp_framework_StatusBarControllerFactory_get_implementation">
<service name="com.sun.star.frame.StatusbarControllerFactory"/>
</implementation>
- <implementation name="com.sun.star.comp.framework.StatusBarFactory">
+ <implementation name="com.sun.star.comp.framework.StatusBarFactory"
+ constructor="com_sun_star_comp_framework_StatusBarFactory_get_implementation">
<service name="com.sun.star.ui.StatusBarFactory"/>
</implementation>
<implementation name="com.sun.star.comp.framework.StatusIndicatorFactory">