diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-01-09 20:44:14 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-01-17 12:25:04 +0100 |
commit | 278880fbd1a9d74be486bf5a2248bfe64c7dc2fc (patch) | |
tree | 95564648c2d2652f65adcb5c540cc7ba6d4f0d24 /framework | |
parent | 5b034290cf8a1c6465ffe51fb6ac26c546d6d179 (diff) |
fwk: Use constructor feature for ImageManager.
Change-Id: I3f231980b1908495b1f5ec17f95c39c464d40ff8
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/uiconfiguration/imagemanager.hxx | 34 | ||||
-rw-r--r-- | framework/source/register/registerservices.cxx | 2 | ||||
-rw-r--r-- | framework/source/uiconfiguration/imagemanager.cxx | 27 | ||||
-rw-r--r-- | framework/util/fwk.component | 3 |
4 files changed, 35 insertions, 31 deletions
diff --git a/framework/inc/uiconfiguration/imagemanager.hxx b/framework/inc/uiconfiguration/imagemanager.hxx index eb08bca59073..28303a3491f3 100644 --- a/framework/inc/uiconfiguration/imagemanager.hxx +++ b/framework/inc/uiconfiguration/imagemanager.hxx @@ -21,19 +21,10 @@ #define INCLUDED_FRAMEWORK_INC_UICONFIGURATION_IMAGEMANAGER_HXX -/** Attention: stl headers must(!) be included at first. Otherwise it can make trouble - with solaris headers ... -*/ -#include <vector> -#include <list> #include <boost/unordered_map.hpp> #include <memory> #include <threadhelp/threadhelpbase.hxx> -#include <macros/generic.hxx> -#include <macros/xinterface.hxx> -#include <macros/xtypeprovider.hxx> -#include <macros/xserviceinfo.hxx> #include <stdtypes.h> #include <uiconfiguration/imagetype.hxx> @@ -47,9 +38,11 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/ui/ConfigurationEvent.hpp> #include <com/sun/star/embed/XTransactedObject.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/implbase2.hxx> #include <cppuhelper/interfacecontainer.hxx> +#include <cppuhelper/supportsservice.hxx> #include <rtl/ustring.hxx> #include <vcl/image.hxx> @@ -62,12 +55,29 @@ namespace framework public ::cppu::WeakImplHelper2< ::com::sun::star::ui::XImageManager, css::lang::XServiceInfo> { public: - // XInterface, XTypeProvider, XServiceInfo - DECLARE_XSERVICEINFO - ImageManager( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext ); virtual ~ImageManager(); + virtual OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException) + { + return OUString("com.sun.star.comp.framework.ImageManager"); + } + + 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.ui.ImageManager"); + return aSeq; + } + // XComponent virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); diff --git a/framework/source/register/registerservices.cxx b/framework/source/register/registerservices.cxx index 924cfa3fa6db..7ecd19e2276c 100644 --- a/framework/source/register/registerservices.cxx +++ b/framework/source/register/registerservices.cxx @@ -55,7 +55,6 @@ #include <services/sessionlistener.hxx> #include <services/taskcreatorsrv.hxx> -#include <uiconfiguration/imagemanager.hxx> #include <uifactory/windowcontentfactorymanager.hxx> #include <services/substitutepathvars.hxx> #include <services/pathsettings.hxx> @@ -86,7 +85,6 @@ COMPONENTGETFACTORY ( fwk, IFFACTORY( ::framework::StatusbarControllerFactory ) else IFFACTORY( ::framework::SessionListener ) else IFFACTORY( ::framework::TaskCreatorService ) else - IFFACTORY( ::framework::ImageManager ) else IFFACTORY( ::framework::WindowContentFactoryManager ) else IFFACTORY( ::framework::SubstitutePathVariables ) else IFFACTORY( ::framework::PathSettings ) else diff --git a/framework/source/uiconfiguration/imagemanager.cxx b/framework/source/uiconfiguration/imagemanager.cxx index f3f78547564b..4d08b66a59cc 100644 --- a/framework/source/uiconfiguration/imagemanager.cxx +++ b/framework/source/uiconfiguration/imagemanager.cxx @@ -22,7 +22,6 @@ #include <threadhelp/resetableguard.hxx> #include <xml/imagesconfiguration.hxx> #include <uiconfiguration/graphicnameaccess.hxx> -#include <services.h> #include "imagemanagerimpl.hxx" #include "properties.h" @@ -34,6 +33,7 @@ #include <com/sun/star/io/XStream.hpp> #include <vcl/svapp.hxx> +#include <rtl/ref.hxx> #include <rtl/ustrbuf.hxx> #include <osl/mutex.hxx> #include <comphelper/sequence.hxx> @@ -41,10 +41,6 @@ #include <vcl/pngread.hxx> #include <vcl/pngwrite.hxx> -//_________________________________________________________________________________________________________________ -// namespaces -//_________________________________________________________________________________________________________________ - using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::XInterface; using ::com::sun::star::uno::Exception; @@ -63,17 +59,6 @@ using namespace ::com::sun::star::beans; namespace framework { -//***************************************************************************************************************** -// XInterface, XTypeProvider, XServiceInfo -//***************************************************************************************************************** -DEFINE_XSERVICEINFO_MULTISERVICE_2 ( ImageManager , - ::cppu::OWeakObject , - "com.sun.star.ui.ImageManager" , - OUString("com.sun.star.comp.framework.ImageManager") - ) - -DEFINE_INIT_SERVICE ( ImageManager, {} ) - ImageManager::ImageManager( const uno::Reference< uno::XComponentContext >& rxContext ) : ThreadHelpBase( &Application::GetSolarMutex() ) , m_pImpl( new ImageManagerImpl(rxContext, this, false) ) @@ -222,4 +207,14 @@ sal_Bool SAL_CALL ImageManager::isReadOnly() throw (::com::sun::star::uno::Runti } // namespace framework +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_comp_framework_ImageManager_get_implementation( + css::uno::XComponentContext *context, + css::uno::Sequence<css::uno::Any> const &) +{ + rtl::Reference<framework::ImageManager> x(new framework::ImageManager(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 d0a782e298b2..aeb8f149568b 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -47,7 +47,8 @@ <implementation name="com.sun.star.comp.framework.GlobalAcceleratorConfiguration"> <service name="com.sun.star.ui.GlobalAcceleratorConfiguration"/> </implementation> - <implementation name="com.sun.star.comp.framework.ImageManager"> + <implementation name="com.sun.star.comp.framework.ImageManager" + constructor="com_sun_star_comp_framework_ImageManager_get_implementation"> <service name="com.sun.star.ui.ImageManager"/> </implementation> <implementation name="com.sun.star.comp.framework.JobExecutor"> |