diff options
author | Rüdiger Timm <rt@openoffice.org> | 2006-03-06 09:22:49 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2006-03-06 09:22:49 +0000 |
commit | 69244deab0790e6cdc768d9bf6dfe6b89fbbe00a (patch) | |
tree | b1cb58cd5b767ef2f6e079a61367a94ba64a3f15 | |
parent | 0e72caec2403b7c43a1bce4304a7b401cd9e08de (diff) |
INTEGRATION: CWS dbo510 (1.7.40); FILE MERGED
2006/02/15 10:40:37 dbo 1.7.40.2: #i59034# using containerToSequence()
2005/11/01 22:16:00 dbo 1.7.40.1: adopted to ServiceDecl
Issue number:
Submitted by:
Reviewed by:
-rw-r--r-- | desktop/source/deployment/registry/package/dp_package.cxx | 51 |
1 files changed, 39 insertions, 12 deletions
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index 5518ee36fd86..61bf34265de4 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dp_package.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: rt $ $Date: 2005-09-08 17:30:56 $ + * last change: $Author: rt $ $Date: 2006-03-06 10:22:49 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -39,10 +39,14 @@ #include "dp_interact.h" #include "rtl/uri.hxx" #include "cppuhelper/exc_hlp.hxx" +#include "cppuhelper/implbase1.hxx" #include "ucbhelper/content.hxx" #include "svtools/inettype.hxx" #include "comphelper/anytostring.hxx" +#include "comphelper/makesequence.hxx" +#include "comphelper/sequence.hxx" #include "com/sun/star/lang/WrappedTargetException.hpp" +#include "com/sun/star/lang/XServiceInfo.hpp" #include "com/sun/star/beans/UnknownPropertyException.hpp" #include "com/sun/star/io/XOutputStream.hpp" #include "com/sun/star/io/XInputStream.hpp" @@ -71,8 +75,11 @@ namespace backend { namespace bundle { namespace { +typedef cppu::ImplInheritanceHelper1<PackageRegistryBackend, + lang::XServiceInfo> ImplBaseT; + //============================================================================== -class BackendImpl : public PackageRegistryBackend +class BackendImpl : public ImplBaseT { class PackageImpl : public ::dp_registry::backend::Package { @@ -165,9 +172,15 @@ public: BackendImpl( Sequence<Any> const & args, Reference<XComponentContext> const & xComponentContext, - OUString const & implName, Reference<deployment::XPackageRegistry> const & xRootRegistry ); + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (RuntimeException); + virtual sal_Bool SAL_CALL supportsService( OUString const& name ) + throw (RuntimeException); + virtual Sequence<OUString> SAL_CALL getSupportedServiceNames() + throw (RuntimeException); + // XPackageRegistry virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL getSupportedPackageTypes() throw (RuntimeException); @@ -177,9 +190,8 @@ public: BackendImpl::BackendImpl( Sequence<Any> const & args, Reference<XComponentContext> const & xComponentContext, - OUString const & implName, Reference<deployment::XPackageRegistry> const & xRootRegistry ) - : PackageRegistryBackend( args, xComponentContext, implName ), + : ImplBaseT( args, xComponentContext ), m_xRootRegistry( xRootRegistry ), m_xBundleTypeInfo( new Package::TypeInfo( OUSTR("application/vnd.sun.star.package-bundle"), @@ -207,6 +219,25 @@ void BackendImpl::disposing() PackageRegistryBackend::disposing(); } +// XServiceInfo +OUString BackendImpl::getImplementationName() throw (RuntimeException) +{ + return OUSTR("com.sun.star.comp.deployment.bundle.PackageRegistryBackend"); +} + +sal_Bool BackendImpl::supportsService( OUString const& name ) + throw (RuntimeException) +{ + return getSupportedServiceNames()[0].equals(name); +} + +Sequence<OUString> BackendImpl::getSupportedServiceNames() + throw (RuntimeException) +{ + return comphelper::makeSequence( + OUString::createFromAscii(BACKEND_SERVICE_NAME) ); +} + // XPackageRegistry //______________________________________________________________________________ Sequence< Reference<deployment::XPackageTypeInfo> > @@ -618,8 +649,7 @@ void BackendImpl::PackageImpl::exportTo( xContext->getServiceManager()->createInstanceWithContext( OUSTR("com.sun.star.io.Pipe"), xContext ), UNO_QUERY_THROW ); xManifestWriter->writeManifestSequence( - xPipe, Sequence< Sequence<beans::PropertyValue> >( - &manifest[ 0 ], manifest.size() ) ); + xPipe, comphelper::containerToSequence(manifest) ); // write buffered pipe data to content: ::ucb::Content manifestContent( @@ -1040,10 +1070,7 @@ Reference<deployment::XPackageRegistry> create( args[ 1 ] <<= cachePath; args[ 2 ] <<= readOnly; } - return new BackendImpl( - args, xComponentContext, - OUSTR("com.sun.star.comp.deployment.bundle.PackageRegistryBackend"), - xRootRegistry ); + return new BackendImpl( args, xComponentContext, xRootRegistry ); } } // namespace bundle |