summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-01-09 20:39:18 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2014-01-17 12:25:03 +0100
commit5b034290cf8a1c6465ffe51fb6ac26c546d6d179 (patch)
treebd34aa0c08267915e39019a885471e3ec7f4ac3c /framework
parentdb69bd9187e3aace05803052221b8f8a064051c6 (diff)
fwk: Use constructor feature for LayoutManager.
Change-Id: I8f5167f7e522585ce8b80ebd8a9a0031aea50d74
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/services/layoutmanager.hxx28
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx14
-rw-r--r--framework/source/register/registerservices.cxx2
-rw-r--r--framework/util/fwk.component3
4 files changed, 33 insertions, 14 deletions
diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx
index 853e4495a134..167f954cc86c 100644
--- a/framework/inc/services/layoutmanager.hxx
+++ b/framework/inc/services/layoutmanager.hxx
@@ -20,19 +20,12 @@
#ifndef INCLUDED_FRAMEWORK_INC_SERVICES_LAYOUTMANAGER_HXX
#define INCLUDED_FRAMEWORK_INC_SERVICES_LAYOUTMANAGER_HXX
-/** Attention: stl headers must(!) be included at first. Otherwise it can make trouble
- with solaris headers ...
-*/
-#include <vector>
-
#include <threadhelp/threadhelpbase.hxx>
#include <threadhelp/resetableguard.hxx>
#include <threadhelp/writeguard.hxx>
#include <threadhelp/readguard.hxx>
-#include <macros/generic.hxx>
#include <macros/xinterface.hxx>
#include <macros/xtypeprovider.hxx>
-#include <macros/xserviceinfo.hxx>
#include <properties.h>
#include <stdtypes.h>
#include <uielement/menubarmanager.hxx>
@@ -62,6 +55,7 @@
#include <cppuhelper/propshlp.hxx>
#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/interfacecontainer.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <comphelper/propertycontainer.hxx>
#include <tools/wintypes.hxx>
#include <svtools/miscopt.hxx>
@@ -99,7 +93,25 @@ namespace framework
/** declaration of XInterface, XTypeProvider, XServiceInfo */
FWK_DECLARE_XINTERFACE
FWK_DECLARE_XTYPEPROVIDER
- DECLARE_XSERVICEINFO
+ virtual OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ {
+ return OUString("com.sun.star.comp.framework.LayoutManager");
+ }
+
+ virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ {
+ return cppu::supportsService(this, ServiceName);
+ }
+
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
+ throw (css::uno::RuntimeException)
+ {
+ css::uno::Sequence< OUString > aSeq(1);
+ aSeq[0] = OUString("com.sun.star.frame.LayoutManager");
+ return aSeq;
+ }
//---------------------------------------------------------------------------------------------------------
// XLayoutManager
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 309ab5bee73e..5fdcfdd91ab3 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -20,7 +20,6 @@
#include <services/layoutmanager.hxx>
#include <helpers.hxx>
#include <threadhelp/resetableguard.hxx>
-#include <services.h>
#include <framework/sfxhelperfunctions.hxx>
#include <uielement/menubarwrapper.hxx>
@@ -75,6 +74,7 @@
#include <rtl/instance.hxx>
#include <unotools/cmdoptions.hxx>
+#include <rtl/ref.hxx>
#include <rtl/strbuf.hxx>
#include <algorithm>
@@ -98,8 +98,6 @@ namespace framework
IMPLEMENT_FORWARD_XTYPEPROVIDER2( LayoutManager, LayoutManager_Base, LayoutManager_PBase )
IMPLEMENT_FORWARD_XINTERFACE2( LayoutManager, LayoutManager_Base, LayoutManager_PBase )
-DEFINE_XSERVICEINFO_MULTISERVICE_2( LayoutManager, ::cppu::OWeakObject, "com.sun.star.frame.LayoutManager", OUString("com.sun.star.comp.framework.LayoutManager"))
-DEFINE_INIT_SERVICE( LayoutManager, {} )
LayoutManager::LayoutManager( const Reference< XComponentContext >& xContext ) : LayoutManager_Base()
, ThreadHelpBase( &Application::GetSolarMutex())
@@ -3224,4 +3222,14 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL LayoutManager::getPropertySet
} // namespace framework
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_framework_LayoutManager_get_implementation(
+ css::uno::XComponentContext *context,
+ css::uno::Sequence<css::uno::Any> const &)
+{
+ rtl::Reference<framework::LayoutManager> x(new framework::LayoutManager(context));
+ x->acquire();
+ return static_cast<cppu::OWeakObject *>(x.get());
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/register/registerservices.cxx b/framework/source/register/registerservices.cxx
index ca2a0373c090..924cfa3fa6db 100644
--- a/framework/source/register/registerservices.cxx
+++ b/framework/source/register/registerservices.cxx
@@ -36,7 +36,6 @@
#include <services/desktop.hxx>
#include <services/frame.hxx>
#include <jobs/jobexecutor.hxx>
-#include <services/layoutmanager.hxx>
#include <uifactory/uielementfactorymanager.hxx>
#include <uifactory/uicontrollerfactory.hxx>
#include <uielement/controlmenucontroller.hxx>
@@ -66,7 +65,6 @@ COMPONENTGETFACTORY ( fwk,
IFFACTORY( ::framework::Desktop ) else
IFFACTORY( ::framework::Frame ) else
IFFACTORY( ::framework::JobExecutor ) else
- IFFACTORY( ::framework::LayoutManager ) else
IFFACTORY( ::framework::UIElementFactoryManager ) else
IFFACTORY( ::framework::PopupMenuControllerFactory ) else
IFFACTORY( ::framework::ControlMenuController ) else
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index 55739063cc31..d0a782e298b2 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -57,7 +57,8 @@
constructor="com_sun_star_comp_framework_LangSelectionStatusbarController_get_implementation">
<service name="com.sun.star.frame.StatusbarController"/>
</implementation>
- <implementation name="com.sun.star.comp.framework.LayoutManager">
+ <implementation name="com.sun.star.comp.framework.LayoutManager"
+ constructor="com_sun_star_comp_framework_LayoutManager_get_implementation">
<service name="com.sun.star.frame.LayoutManager"/>
</implementation>
<implementation name="com.sun.star.comp.framework.MenuBarFactory">