diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-01-09 14:28:16 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-01-17 12:24:51 +0100 |
commit | 10074976b70c9a3586c0ed584767cfb844d11287 (patch) | |
tree | 3587703c0829aa9ff5e7eb557dbbaff59a6d0a21 /framework | |
parent | fb20f52279c8c13d2417e3232efe4fcbb52a4cc6 (diff) |
fwk: Use constructor feature for StatusIndicatorFactory.
Change-Id: I0595ec98df7bf4114dfb4c21aedd2d2744fda11e
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/helper/statusindicatorfactory.hxx | 29 | ||||
-rw-r--r-- | framework/source/helper/statusindicatorfactory.cxx | 28 | ||||
-rw-r--r-- | framework/source/register/registerservices.cxx | 2 | ||||
-rw-r--r-- | framework/source/services/frame.cxx | 1 | ||||
-rw-r--r-- | framework/source/uielement/progressbarwrapper.cxx | 1 | ||||
-rw-r--r-- | framework/util/fwk.component | 3 |
6 files changed, 34 insertions, 30 deletions
diff --git a/framework/inc/helper/statusindicatorfactory.hxx b/framework/inc/helper/statusindicatorfactory.hxx index 79ae934d5398..4d8b486f184b 100644 --- a/framework/inc/helper/statusindicatorfactory.hxx +++ b/framework/inc/helper/statusindicatorfactory.hxx @@ -48,11 +48,9 @@ #include <com/sun/star/awt/WindowEvent.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/frame/XFrame.hpp> - #include <com/sun/star/util/XUpdatable.hpp> -//_______________________________________________ -// include others +#include <cppuhelper/supportsservice.hxx> #include <vcl/status.hxx> #include <cppuhelper/implbase4.hxx> #include <osl/thread.hxx> @@ -208,14 +206,27 @@ class StatusIndicatorFactory : private ThreadHelpBase // interface public: - - //--------------------------------------- - // ctor StatusIndicatorFactory(const css::uno::Reference< css::uno::XComponentContext >& xContext); - //--------------------------------------- - // XInterface, XTypeProvider, XServiceInfo - DECLARE_XSERVICEINFO + virtual OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException) + { + return OUString("com.sun.star.comp.framework.StatusIndicatorFactory"); + } + + 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.task.StatusIndicatorFactory"); + return aSeq; + } //--------------------------------------- // XInitialization diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx index 6f9746046d9f..a81aacfe9440 100644 --- a/framework/source/helper/statusindicatorfactory.cxx +++ b/framework/source/helper/statusindicatorfactory.cxx @@ -44,6 +44,7 @@ #include <unotools/mediadescriptor.hxx> #include <vcl/svapp.hxx> #include <osl/mutex.hxx> +#include <rtl/ref.hxx> #include <officecfg/Office/Common.hxx> @@ -54,23 +55,6 @@ sal_Int32 StatusIndicatorFactory::m_nInReschedule = 0; /// static counter for r const char PROGRESS_RESOURCE[] = "private:resource/progressbar/progressbar"; //----------------------------------------------- - -DEFINE_XSERVICEINFO_MULTISERVICE_2(StatusIndicatorFactory , - ::cppu::OWeakObject , - OUString("com.sun.star.task.StatusIndicatorFactory"), - OUString("com.sun.star.comp.framework.StatusIndicatorFactory")) - -DEFINE_INIT_SERVICE(StatusIndicatorFactory, - { - /*Attention - I think we don't need any mutex or lock here ... because we are called by our own static method impl_createInstance() - to create a new instance of this class by our own supported service factory. - see macro DEFINE_XSERVICEINFO_MULTISERVICE and "impl_initService()" for further information! - */ - } - ) - -//----------------------------------------------- StatusIndicatorFactory::StatusIndicatorFactory(const css::uno::Reference< css::uno::XComponentContext >& xContext) : ThreadHelpBase ( ) , m_xContext (xContext ) @@ -619,4 +603,14 @@ void StatusIndicatorFactory::impl_stopWakeUpThread() } // namespace framework +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_comp_framework_StatusIndicatorFactory_get_implementation( + css::uno::XComponentContext *context, + css::uno::Sequence<css::uno::Any> const &) +{ + rtl::Reference<framework::StatusIndicatorFactory> x(new framework::StatusIndicatorFactory(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 e8d23217285d..ed10f4410f4f 100644 --- a/framework/source/register/registerservices.cxx +++ b/framework/source/register/registerservices.cxx @@ -55,7 +55,6 @@ #include <uifactory/toolboxfactory.hxx> #include "uiconfiguration/windowstateconfiguration.hxx" #include <services/autorecovery.hxx> -#include <helper/statusindicatorfactory.hxx> #include <uielement/recentfilesmenucontroller.hxx> #include <uifactory/statusbarfactory.hxx> #include <uiconfiguration/uicategorydescription.hxx> @@ -92,7 +91,6 @@ COMPONENTGETFACTORY ( fwk, IFFACTORY( ::framework::WindowStateConfiguration ) else IFFACTORY( ::framework::ToolbarControllerFactory ) else IFFACTORY( ::framework::AutoRecovery ) else - IFFACTORY( ::framework::StatusIndicatorFactory ) else IFFACTORY( ::framework::RecentFilesMenuController ) else IFFACTORY( ::framework::StatusBarFactory ) else IFFACTORY( ::framework::UICategoryDescription ) else diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index 7cbc89195f27..44221a014d27 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -25,7 +25,6 @@ #include <dispatch/windowcommanddispatch.hxx> #include <loadenv/loadenv.hxx> #include <helper/oframes.hxx> -#include <helper/statusindicatorfactory.hxx> #include <framework/titlehelper.hxx> #include <svtools/openfiledroptargetlistener.hxx> #include <classes/taskcreator.hxx> diff --git a/framework/source/uielement/progressbarwrapper.cxx b/framework/source/uielement/progressbarwrapper.cxx index 7d6a931adb1d..230023752f02 100644 --- a/framework/source/uielement/progressbarwrapper.cxx +++ b/framework/source/uielement/progressbarwrapper.cxx @@ -26,6 +26,7 @@ #include <com/sun/star/ui/UIElementType.hpp> #include <com/sun/star/lang/DisposedException.hpp> +#include <vcl/status.hxx> #include <vcl/svapp.hxx> #include <toolkit/helper/vclunohelper.hxx> diff --git a/framework/util/fwk.component b/framework/util/fwk.component index 09d919511fe4..c98e0a32b20f 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -96,7 +96,8 @@ <implementation name="com.sun.star.comp.framework.StatusBarFactory"> <service name="com.sun.star.ui.StatusBarFactory"/> </implementation> - <implementation name="com.sun.star.comp.framework.StatusIndicatorFactory"> + <implementation name="com.sun.star.comp.framework.StatusIndicatorFactory" + constructor="com_sun_star_comp_framework_StatusIndicatorFactory_get_implementation"> <service name="com.sun.star.task.StatusIndicatorFactory"/> </implementation> <implementation name="com.sun.star.comp.framework.TaskCreator"> |