diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2006-03-06 09:20:17 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2006-03-06 09:20:17 +0000 |
commit | 0f5e98e1cfcf5e38b0dfbae7a4bf6adef2d24974 (patch) | |
tree | 91da16edb458658e16633dc20bb7946b43fea647 /desktop/source/deployment/migration | |
parent | c5a7050ed019f0629a28821b502b43528107a474 (diff) |
INTEGRATION: CWS dbo510 (1.5.40); FILE MERGED
2005/11/10 15:48:51 dbo 1.5.40.3: adopted to revised SreviceDecl
Issue number:
Submitted by:
Reviewed by:
2005/11/02 15:40:18 dbo 1.5.40.2: avoiding use of anonymous namespaces with service decl objects
Issue number:
Submitted by:
Reviewed by:
2005/11/01 22:16:39 dbo 1.5.40.1: adopted to ServiceDecl
Issue number:
Submitted by:
Reviewed by:
Diffstat (limited to 'desktop/source/deployment/migration')
-rw-r--r-- | desktop/source/deployment/migration/dp_migration.cxx | 60 |
1 files changed, 13 insertions, 47 deletions
diff --git a/desktop/source/deployment/migration/dp_migration.cxx b/desktop/source/deployment/migration/dp_migration.cxx index 0a39c7e0d3..445b239366 100644 --- a/desktop/source/deployment/migration/dp_migration.cxx +++ b/desktop/source/deployment/migration/dp_migration.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dp_migration.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: rt $ $Date: 2005-09-08 17:22:04 $ + * last change: $Author: rt $ $Date: 2006-03-06 10:20:17 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -35,11 +35,12 @@ #include "dp_misc.h" #include "dp_ucb.h" +#include "cppuhelper/implbase1.hxx" #include "cppuhelper/implbase2.hxx" #include "cppuhelper/exc_hlp.hxx" #include "ucbhelper/content.hxx" #include "comphelper/anytostring.hxx" -#include "com/sun/star/lang/XServiceInfo.hpp" +#include "comphelper/servicedecl.hxx" #include "com/sun/star/lang/WrappedTargetException.hpp" #include "com/sun/star/task/XJob.hpp" #include "com/sun/star/task/XInteractionAbort.hpp" @@ -58,15 +59,7 @@ using ::rtl::OUString; namespace dp_migration { -OUString SAL_CALL getImplementationName() -{ - return OUSTR("com.sun.star.comp.deployment.migration.Migration_2_0"); -} - -namespace { - -class MigrationImpl : public ::cppu::WeakImplHelper2< - lang::XServiceInfo, task::XJob > +class MigrationImpl : public ::cppu::WeakImplHelper1<task::XJob> { struct CommandEnvironmentImpl : public ::cppu::WeakImplHelper2< XCommandEnvironment, @@ -86,17 +79,12 @@ class MigrationImpl : public ::cppu::WeakImplHelper2< const Reference<XComponentContext> m_xContext; OUString m_userData; -public: +protected: virtual ~MigrationImpl(); +public: MigrationImpl( Sequence<Any> const & args, Reference<XComponentContext> const & xComponentContext ); - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (RuntimeException); - virtual sal_Bool SAL_CALL supportsService( OUString const & serviceName ) - throw (RuntimeException); - virtual Sequence<OUString> SAL_CALL getSupportedServiceNames() - throw (RuntimeException); // XJob virtual Any SAL_CALL execute( Sequence<beans::NamedValue> const & args ) throw (lang::IllegalArgumentException, Exception, RuntimeException); @@ -121,25 +109,6 @@ MigrationImpl::MigrationImpl( static_cast<sal_Int16>(-1) ); } -// XServiceInfo -OUString MigrationImpl::getImplementationName() throw (RuntimeException) -{ - return ::dp_migration::getImplementationName(); -} - -sal_Bool MigrationImpl::supportsService( OUString const & serviceName ) - throw (RuntimeException) -{ - return getImplementationName().equals(serviceName); -} - -Sequence<OUString> MigrationImpl::getSupportedServiceNames() - throw (RuntimeException) -{ - const OUString name( getImplementationName() ); - return Sequence<OUString>( &name, 1 ); -} - // XJob Any MigrationImpl::execute( Sequence<beans::NamedValue> const & ) throw (lang::IllegalArgumentException, Exception, RuntimeException) @@ -275,15 +244,12 @@ void MigrationImpl::CommandEnvironmentImpl::handle( } } -} // anon namespace - -Reference<XInterface> SAL_CALL create( - Sequence<Any> const & args, - Reference<XComponentContext> const & xComponentContext ) -{ - return static_cast< ::cppu::OWeakObject * >( - new MigrationImpl( args, xComponentContext ) ); -} +namespace sdecl = comphelper::service_decl; +extern sdecl::ServiceDecl const serviceDecl( + sdecl::class_<MigrationImpl, sdecl::with_args<true> >(), + // a private one (config entry): + "com.sun.star.comp.deployment.migration.Migration_2_0", + "com.sun.star.comp.deployment.migration.Migration_2_0" ); } // namespace dp_migration |