diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-01-09 13:51:33 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-01-10 10:20:51 +0100 |
commit | c324047398ec550c84ff316b017cc905e129de0a (patch) | |
tree | f9fff083aea702ae6cab999f37110a6998754030 | |
parent | b1c878bfb10439d619341bf2edf03975547f0649 (diff) |
fwk: Use constructor feature for ToolbarControllerFactory.
Change-Id: Ic9834f937659e97fb064cf0a0074f6c02db0cb4b
-rw-r--r-- | framework/inc/uifactory/uicontrollerfactory.hxx | 9 | ||||
-rw-r--r-- | framework/source/register/registerservices.cxx | 1 | ||||
-rw-r--r-- | framework/source/uifactory/uicontrollerfactory.cxx | 32 | ||||
-rw-r--r-- | framework/util/fwk.component | 3 |
4 files changed, 28 insertions, 17 deletions
diff --git a/framework/inc/uifactory/uicontrollerfactory.hxx b/framework/inc/uifactory/uicontrollerfactory.hxx index 0eca2e0255c5..e7df645db3fb 100644 --- a/framework/inc/uifactory/uicontrollerfactory.hxx +++ b/framework/inc/uifactory/uicontrollerfactory.hxx @@ -76,15 +76,6 @@ class PopupMenuControllerFactory : public UIControllerFactory DECLARE_XSERVICEINFO }; -class ToolbarControllerFactory : public UIControllerFactory -{ - public: - ToolbarControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ); - - // XInterface, XTypeProvider, XServiceInfo - DECLARE_XSERVICEINFO -}; - } #endif // INCLUDED_FRAMEWORK_INC_UIFACTORY_UICONTROLLERFACTORY_HXX diff --git a/framework/source/register/registerservices.cxx b/framework/source/register/registerservices.cxx index f893b5b17af8..a35f8a1c3c8b 100644 --- a/framework/source/register/registerservices.cxx +++ b/framework/source/register/registerservices.cxx @@ -89,7 +89,6 @@ COMPONENTGETFACTORY ( fwk, IFFACTORY( ::framework::DocumentAcceleratorConfiguration ) else IFFACTORY( ::framework::ToolBoxFactory ) else IFFACTORY( ::framework::WindowStateConfiguration ) else - IFFACTORY( ::framework::ToolbarControllerFactory ) else IFFACTORY( ::framework::StatusIndicatorFactory ) else IFFACTORY( ::framework::RecentFilesMenuController ) else IFFACTORY( ::framework::StatusBarFactory ) else diff --git a/framework/source/uifactory/uicontrollerfactory.cxx b/framework/source/uifactory/uicontrollerfactory.cxx index 546138b8c22f..f6d539a20fba 100644 --- a/framework/source/uifactory/uicontrollerfactory.cxx +++ b/framework/source/uifactory/uicontrollerfactory.cxx @@ -232,6 +232,21 @@ PopupMenuControllerFactory::PopupMenuControllerFactory( const Reference< XCompon { } +} // namespace framework + +using namespace framework; + +namespace { + +class ToolbarControllerFactory : public UIControllerFactory +{ + public: + ToolbarControllerFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext ); + + // XInterface, XTypeProvider, XServiceInfo + DECLARE_XSERVICEINFO +}; + DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( ToolbarControllerFactory , ::cppu::OWeakObject , SERVICENAME_TOOLBARCONTROLLERFACTORY , @@ -247,12 +262,6 @@ ToolbarControllerFactory::ToolbarControllerFactory( const Reference< XComponentC { } -} // namespace framework - -using namespace framework; - -namespace { - class StatusbarControllerFactory : public UIControllerFactory { public: @@ -280,6 +289,17 @@ StatusbarControllerFactory::StatusbarControllerFactory( const Reference< XCompon } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_comp_framework_ToolBarControllerFactory_get_implementation( + css::uno::XComponentContext * context, + uno_Sequence * arguments) +{ + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; + rtl::Reference<ToolbarControllerFactory> x(new ToolbarControllerFactory(context)); + x->acquire(); + return static_cast<cppu::OWeakObject *>(x.get()); +} + +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_framework_StatusBarControllerFactory_get_implementation( css::uno::XComponentContext * context, uno_Sequence * arguments) diff --git a/framework/util/fwk.component b/framework/util/fwk.component index 1746091a6e50..a35aff32dc95 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -104,7 +104,8 @@ <implementation name="com.sun.star.comp.framework.TaskCreator"> <service name="com.sun.star.frame.TaskCreator"/> </implementation> - <implementation name="com.sun.star.comp.framework.ToolBarControllerFactory"> + <implementation name="com.sun.star.comp.framework.ToolBarControllerFactory" + 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"> |