fwk: Use constructor feature for LayoutManager.

Change-Id: I8f5167f7e522585ce8b80ebd8a9a0031aea50d74
This commit is contained in:
Matúš Kukan
2014-01-09 20:39:18 +01:00
parent db69bd9187
commit 5b034290cf
4 changed files with 33 additions and 14 deletions

View File

@@ -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

View File

@@ -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: */

View File

@@ -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

View File

@@ -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">