package/Library_package2.mk | 1 package/inc/ZipPackage.hxx | 5 - package/inc/zipfileaccess.hxx | 7 - package/source/manifest/ManifestReader.cxx | 30 ++----- package/source/manifest/ManifestReader.hxx | 5 - package/source/manifest/ManifestWriter.cxx | 32 +------ package/source/manifest/ManifestWriter.hxx | 5 - package/source/manifest/UnoRegister.cxx | 70 ----------------- package/source/zippackage/ZipPackage.cxx | 38 ++------- package/source/zippackage/zipfileaccess.cxx | 31 ++----- package/util/package2.component | 14 ++- shell/Library_losessioninstall.mk | 1 shell/source/sessioninstall/SyncDbusSessionHelper.cxx | 23 +++++ shell/source/sessioninstall/SyncDbusSessionHelper.hxx | 8 + shell/source/sessioninstall/losessioninstall.component | 5 - shell/source/sessioninstall/services.cxx | 36 -------- solenv/bin/native-code.py | 6 + 17 files changed, 84 insertions(+), 233 deletions(-)
New commits: commit ae777762c15258be6598f8b8a056b2924e1fe756 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Jul 16 11:18:27 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Jul 17 08:48:02 2020 +0200 shell/sessioninstall: create instances with uno constructors See tdf#74608 for motivation. Change-Id: I1878cf052b3f250927d5bb72ddd523af28cf9337 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98917 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/shell/Library_losessioninstall.mk b/shell/Library_losessioninstall.mk index b3334092cdb2..c83b8fa9c358 100644 --- a/shell/Library_losessioninstall.mk +++ b/shell/Library_losessioninstall.mk @@ -31,7 +31,6 @@ $(eval $(call gb_Library_use_externals,losessioninstall,\ $(eval $(call gb_Library_add_exception_objects,losessioninstall,\ shell/source/sessioninstall/SyncDbusSessionHelper \ - shell/source/sessioninstall/services \ )) # vim:set noet sw=4 ts=4: diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx index 6e35a069f588..fc90c19a8fca 100644 --- a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx +++ b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx @@ -9,6 +9,7 @@ #include "SyncDbusSessionHelper.hxx" +#include <cppuhelper/supportsservice.hxx> #include <gio/gio.h> #include <memory> #include <vector> @@ -99,6 +100,21 @@ namespace shell::sessioninstall #endif } +Sequence< OUString > SAL_CALL SyncDbusSessionHelper::getSupportedServiceNames() +{ + return { "org.freedesktop.PackageKit.SyncDbusSessionHelper" }; +} + +OUString SAL_CALL SyncDbusSessionHelper::getImplementationName() +{ + return "org.libreoffice.comp.shell.sessioninstall.SyncDbusSessionHelper"; +} + +sal_Bool SAL_CALL SyncDbusSessionHelper::supportsService(const OUString& aServiceName) +{ + return cppu::supportsService(this, aServiceName); +} + void SyncDbusSessionHelper::InstallPackageFiles( css::uno::Sequence<OUString> const & files, OUString const & interaction) @@ -181,6 +197,13 @@ void SAL_CALL SyncDbusSessionHelper::IsInstalled( const OUString& sPackagename, o_isInstalled = bool(g_variant_get_boolean(g_variant_get_child_value(result.get(),0))); } +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +shell_sessioninstall_get_implementation( + css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&) +{ + return cppu::acquire(new SyncDbusSessionHelper(context)); +} + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.hxx b/shell/source/sessioninstall/SyncDbusSessionHelper.hxx index 8a8dd3bf235f..7812604c9e01 100644 --- a/shell/source/sessioninstall/SyncDbusSessionHelper.hxx +++ b/shell/source/sessioninstall/SyncDbusSessionHelper.hxx @@ -11,16 +11,22 @@ #define INCLUDED_SHELL_SOURCE_SESSIONINSTALL_SYNCDBUSSESSIONHELPER_HXX #include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> #include <org/freedesktop/PackageKit/SyncDbusSessionHelper.hpp> #include <cppuhelper/implbase.hxx> namespace shell::sessioninstall { - class SyncDbusSessionHelper : public ::cppu::WeakImplHelper< ::org::freedesktop::PackageKit::XSyncDbusSessionHelper > + class SyncDbusSessionHelper : public ::cppu::WeakImplHelper< ::org::freedesktop::PackageKit::XSyncDbusSessionHelper, css::lang::XServiceInfo > { public: SyncDbusSessionHelper(css::uno::Reference< css::uno::XComponentContext> const&); + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override; + // XModify Methods virtual void SAL_CALL InstallPackageFiles( const css::uno::Sequence< OUString >& files, const OUString& interaction ) override; diff --git a/shell/source/sessioninstall/losessioninstall.component b/shell/source/sessioninstall/losessioninstall.component index 9d63cd5ecca7..4dbc3bf0f2a3 100644 --- a/shell/source/sessioninstall/losessioninstall.component +++ b/shell/source/sessioninstall/losessioninstall.component @@ -8,8 +8,9 @@ * --> <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" - prefix="sessioninstall" xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="org.libreoffice.comp.shell.sessioninstall.SyncDbusSessionHelper"> + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="org.libreoffice.comp.shell.sessioninstall.SyncDbusSessionHelper" + constructor="shell_sessioninstall_get_implementation"> <service name="org.freedesktop.PackageKit.SyncDbusSessionHelper"/> </implementation> </component> diff --git a/shell/source/sessioninstall/services.cxx b/shell/source/sessioninstall/services.cxx deleted file mode 100644 index 69a7b2e4924e..000000000000 --- a/shell/source/sessioninstall/services.cxx +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include "SyncDbusSessionHelper.hxx" -#include <comphelper/servicedecl.hxx> - -namespace sdecl = ::comphelper::service_decl; - -sdecl::class_< ::shell::sessioninstall::SyncDbusSessionHelper> const SyncDbusSessionHelperServiceImpl; - -const sdecl::ServiceDecl SyncDbusSessionHelperServiceDecl( - SyncDbusSessionHelperServiceImpl, - "org.libreoffice.comp.shell.sessioninstall.SyncDbusSessionHelper", - "org.freedesktop.PackageKit.SyncDbusSessionHelper"); - -extern "C" -SAL_DLLPUBLIC_EXPORT void* losessioninstall_component_getFactory( char const* pImplName, - void*, void* ) -{ - return sdecl::component_getFactoryHelper( pImplName, {&SyncDbusSessionHelperServiceDecl} ); -} - -extern "C" -SAL_DLLPUBLIC_EXPORT void* sessioninstall_component_getFactory( char const* pImplName, void* pServiceManager, void* pRegistryKey ) -{ - return losessioninstall_component_getFactory(pImplName, pServiceManager, pRegistryKey); -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 2fc112e98ddcb46038eaff341734331a8558934f Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Jul 16 12:19:14 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Jul 17 08:47:55 2020 +0200 package: create instances with uno constructors See tdf#74608 for motivation. Change-Id: I17627bdd2f4f595343ad9bf524dc57cd03170b2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98921 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/package/Library_package2.mk b/package/Library_package2.mk index adca76fba2ed..9bb7e3194b98 100644 --- a/package/Library_package2.mk +++ b/package/Library_package2.mk @@ -46,7 +46,6 @@ $(eval $(call gb_Library_add_exception_objects,package2,\ package/source/manifest/ManifestImport \ package/source/manifest/ManifestReader \ package/source/manifest/ManifestWriter \ - package/source/manifest/UnoRegister \ package/source/zipapi/blowfishcontext \ package/source/zipapi/ByteChucker \ package/source/zipapi/ByteGrabber \ diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx index 779e5cd7ed41..ec39666fbbb1 100644 --- a/package/inc/ZipPackage.hxx +++ b/package/inc/ZipPackage.hxx @@ -161,11 +161,6 @@ public: virtual OUString SAL_CALL getImplementationName( ) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; - - // Uno componentiseralation - static OUString static_getImplementationName(); - static css::uno::Sequence < OUString > static_getSupportedServiceNames(); - static css::uno::Reference < css::lang::XSingleServiceFactory > createServiceFactory( css::uno::Reference < css::lang::XMultiServiceFactory > const & rServiceFactory ); }; #endif diff --git a/package/inc/zipfileaccess.hxx b/package/inc/zipfileaccess.hxx index 2cd403d54545..a3f96346d6ec 100644 --- a/package/inc/zipfileaccess.hxx +++ b/package/inc/zipfileaccess.hxx @@ -61,13 +61,6 @@ public: static bool StringGoodForPattern_Impl( const OUString& aString, const css::uno::Sequence< OUString >& aPattern ); - static css::uno::Sequence< OUString > impl_staticGetSupportedServiceNames(); - - static OUString impl_staticGetImplementationName(); - - static css::uno::Reference< css::uno::XInterface > impl_staticCreateSelfInstance( - const css::uno::Reference< css::lang::XMultiServiceFactory >& rxMSF ); - // XInitialization virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; diff --git a/package/source/manifest/ManifestReader.cxx b/package/source/manifest/ManifestReader.cxx index 50fd851b31b8..dcb296d7e6f0 100644 --- a/package/source/manifest/ManifestReader.cxx +++ b/package/source/manifest/ManifestReader.cxx @@ -81,24 +81,10 @@ Sequence< Sequence< PropertyValue > > SAL_CALL ManifestReader::readManifestSeque } // Component functions -static Reference < XInterface > ManifestReader_createInstance( Reference< XMultiServiceFactory > const & rServiceFactory ) -{ - return *new ManifestReader( comphelper::getComponentContext(rServiceFactory) ); -} -OUString ManifestReader::static_getImplementationName() -{ - return "com.sun.star.packages.manifest.comp.ManifestReader"; -} - -Sequence < OUString > ManifestReader::static_getSupportedServiceNames() -{ - Sequence < OUString > aNames { "com.sun.star.packages.manifest.ManifestReader" }; - return aNames; -} OUString ManifestReader::getImplementationName() { - return static_getImplementationName(); + return "com.sun.star.packages.manifest.comp.ManifestReader"; } sal_Bool SAL_CALL ManifestReader::supportsService(OUString const & rServiceName) @@ -108,14 +94,16 @@ sal_Bool SAL_CALL ManifestReader::supportsService(OUString const & rServiceName) Sequence < OUString > ManifestReader::getSupportedServiceNames() { - return static_getSupportedServiceNames(); + return { "com.sun.star.packages.manifest.ManifestReader" }; } -Reference < XSingleServiceFactory > ManifestReader::createServiceFactory( Reference < XMultiServiceFactory > const & rServiceFactory ) + + +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +package_ManifestReader_get_implementation( + css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&) { - return cppu::createSingleFactory (rServiceFactory, - static_getImplementationName(), - ManifestReader_createInstance, - static_getSupportedServiceNames()); + return cppu::acquire(new ManifestReader(context)); } + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/manifest/ManifestReader.hxx b/package/source/manifest/ManifestReader.hxx index e30884424f77..d9546cd30ddf 100644 --- a/package/source/manifest/ManifestReader.hxx +++ b/package/source/manifest/ManifestReader.hxx @@ -49,11 +49,6 @@ public: virtual OUString SAL_CALL getImplementationName( ) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; - - // Component constructor - static OUString static_getImplementationName(); - static css::uno::Sequence < OUString > static_getSupportedServiceNames(); - static css::uno::Reference < css::lang::XSingleServiceFactory > createServiceFactory( css::uno::Reference < css::lang::XMultiServiceFactory > const & rServiceFactory ); }; #endif diff --git a/package/source/manifest/ManifestWriter.cxx b/package/source/manifest/ManifestWriter.cxx index 8fbb9bd6a177..08c12510afee 100644 --- a/package/source/manifest/ManifestWriter.cxx +++ b/package/source/manifest/ManifestWriter.cxx @@ -72,26 +72,9 @@ void SAL_CALL ManifestWriter::writeManifestSequence( const Reference< XOutputStr } } -// Component methods -static Reference < XInterface > ManifestWriter_createInstance( Reference< XMultiServiceFactory > const & rServiceFactory ) -{ - return *new ManifestWriter( comphelper::getComponentContext(rServiceFactory) ); -} - -OUString ManifestWriter::static_getImplementationName() -{ - return "com.sun.star.packages.manifest.comp.ManifestWriter"; -} - -Sequence < OUString > ManifestWriter::static_getSupportedServiceNames() -{ - Sequence<OUString> aNames { "com.sun.star.packages.manifest.ManifestWriter" }; - return aNames; -} - OUString ManifestWriter::getImplementationName() { - return static_getImplementationName(); + return "com.sun.star.packages.manifest.comp.ManifestWriter"; } sal_Bool SAL_CALL ManifestWriter::supportsService(OUString const & rServiceName) @@ -100,14 +83,15 @@ sal_Bool SAL_CALL ManifestWriter::supportsService(OUString const & rServiceName) } Sequence < OUString > ManifestWriter::getSupportedServiceNames() { - return static_getSupportedServiceNames(); + return { "com.sun.star.packages.manifest.ManifestWriter" }; } -Reference < XSingleServiceFactory > ManifestWriter::createServiceFactory( Reference < XMultiServiceFactory > const & rServiceFactory ) + + +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +package_ManifestWriter_get_implementation( + css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&) { - return cppu::createSingleFactory (rServiceFactory, - static_getImplementationName(), - ManifestWriter_createInstance, - static_getSupportedServiceNames()); + return cppu::acquire(new ManifestWriter(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/manifest/ManifestWriter.hxx b/package/source/manifest/ManifestWriter.hxx index 7d83a7383bc9..1378ebf8edd7 100644 --- a/package/source/manifest/ManifestWriter.hxx +++ b/package/source/manifest/ManifestWriter.hxx @@ -49,11 +49,6 @@ public: virtual OUString SAL_CALL getImplementationName( ) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; - - // Component constructor - static OUString static_getImplementationName(); - static css::uno::Sequence < OUString > static_getSupportedServiceNames(); - static css::uno::Reference < css::lang::XSingleServiceFactory > createServiceFactory( css::uno::Reference < css::lang::XMultiServiceFactory > const & rServiceFactory ); }; #endif diff --git a/package/source/manifest/UnoRegister.cxx b/package/source/manifest/UnoRegister.cxx deleted file mode 100644 index aa14db7d7c6f..000000000000 --- a/package/source/manifest/UnoRegister.cxx +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "ManifestReader.hxx" -#include "ManifestWriter.hxx" -#include <cppuhelper/factory.hxx> -#include <com/sun/star/registry/XRegistryKey.hpp> -#include <ZipPackage.hxx> - -#include <zipfileaccess.hxx> - -using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::registry; -using namespace ::com::sun::star::packages; - -/** - * This function is called to get service factories for an implementation. - * @param pImplName name of implementation - * @param pServiceManager generic uno interface providing a service manager to instantiate components - * @param pRegistryKey registry data key to read and write component persistent data - * @return a component factory (generic uno interface) - */ -extern "C" SAL_DLLPUBLIC_EXPORT void * package2_component_getFactory( - const char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) -{ - void * pRet = nullptr; - uno::Reference< XMultiServiceFactory > xSMgr( - static_cast< XMultiServiceFactory * >( pServiceManager ) ); - uno::Reference< XSingleServiceFactory > xFactory; - - if (ManifestReader::static_getImplementationName().equalsAscii( pImplName ) ) - xFactory = ManifestReader::createServiceFactory ( xSMgr ); - else if (ManifestWriter::static_getImplementationName().equalsAscii( pImplName ) ) - xFactory = ManifestWriter::createServiceFactory ( xSMgr ); - else if (ZipPackage::static_getImplementationName().equalsAscii( pImplName ) ) - xFactory = ZipPackage::createServiceFactory ( xSMgr ); - else if ( OZipFileAccess::impl_staticGetImplementationName().equalsAscii( pImplName ) ) - xFactory = ::cppu::createSingleFactory( xSMgr, - OZipFileAccess::impl_staticGetImplementationName(), - OZipFileAccess::impl_staticCreateSelfInstance, - OZipFileAccess::impl_staticGetSupportedServiceNames() ); - - if ( xFactory.is() ) - { - xFactory->acquire(); - pRet = xFactory.get(); - } - return pRet; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 02aed7a66a2e..4e113e91d3bb 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -1661,34 +1661,15 @@ Sequence< ElementChange > SAL_CALL ZipPackage::getPendingChanges() return uno::Sequence < ElementChange > (); } -/** - * Function to create a new component instance; is needed by factory helper implementation. - * @param xMgr service manager to if the components needs other component instances - */ -static uno::Reference < XInterface > ZipPackage_createInstance( - const uno::Reference< XMultiServiceFactory > & xMgr ) -{ - return uno::Reference< XInterface >( *new ZipPackage( comphelper::getComponentContext(xMgr) ) ); -} - -OUString ZipPackage::static_getImplementationName() -{ - return "com.sun.star.packages.comp.ZipPackage"; -} - -Sequence< OUString > ZipPackage::static_getSupportedServiceNames() -{ - return { "com.sun.star.packages.Package" }; -} OUString ZipPackage::getImplementationName() { - return static_getImplementationName(); + return "com.sun.star.packages.comp.ZipPackage"; } Sequence< OUString > ZipPackage::getSupportedServiceNames() { - return static_getSupportedServiceNames(); + return { "com.sun.star.packages.Package" }; } sal_Bool SAL_CALL ZipPackage::supportsService( OUString const & rServiceName ) @@ -1696,14 +1677,6 @@ sal_Bool SAL_CALL ZipPackage::supportsService( OUString const & rServiceName ) return cppu::supportsService(this, rServiceName); } -uno::Reference < XSingleServiceFactory > ZipPackage::createServiceFactory( uno::Reference < XMultiServiceFactory > const & rServiceFactory ) -{ - return cppu::createSingleFactory ( rServiceFactory, - static_getImplementationName(), - ZipPackage_createInstance, - static_getSupportedServiceNames() ); -} - Sequence< sal_Int8 > ZipPackage::getUnoTunnelId() { static ::cppu::OImplementationId implId; @@ -1872,4 +1845,11 @@ void SAL_CALL ZipPackage::removeVetoableChangeListener( const OUString& /*Proper { } +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +package_ZipPackage_get_implementation( + css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&) +{ + return cppu::acquire(new ZipPackage(context)); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx index 31e38aff1dcd..b813c165d46e 100644 --- a/package/source/zippackage/zipfileaccess.cxx +++ b/package/source/zippackage/zipfileaccess.cxx @@ -449,38 +449,29 @@ void SAL_CALL OZipFileAccess::removeEventListener( const uno::Reference< lang::X m_pListenersContainer->removeInterface( xListener ); } -uno::Sequence< OUString > OZipFileAccess::impl_staticGetSupportedServiceNames() -{ - uno::Sequence< OUString > aRet(2); - aRet[0] = "com.sun.star.packages.zip.ZipFileAccess"; - aRet[1] = "com.sun.star.comp.packages.zip.ZipFileAccess"; - return aRet; -} - -OUString OZipFileAccess::impl_staticGetImplementationName() +OUString SAL_CALL OZipFileAccess::getImplementationName() { return "com.sun.star.comp.package.zip.ZipFileAccess"; } -uno::Reference< uno::XInterface > OZipFileAccess::impl_staticCreateSelfInstance( - const uno::Reference< lang::XMultiServiceFactory >& rxMSF ) +sal_Bool SAL_CALL OZipFileAccess::supportsService( const OUString& ServiceName ) { - return uno::Reference< uno::XInterface >( *new OZipFileAccess( comphelper::getComponentContext(rxMSF) ) ); + return cppu::supportsService(this, ServiceName); } -OUString SAL_CALL OZipFileAccess::getImplementationName() +uno::Sequence< OUString > SAL_CALL OZipFileAccess::getSupportedServiceNames() { - return impl_staticGetImplementationName(); + return { "com.sun.star.packages.zip.ZipFileAccess", + "com.sun.star.comp.packages.zip.ZipFileAccess" }; } -sal_Bool SAL_CALL OZipFileAccess::supportsService( const OUString& ServiceName ) -{ - return cppu::supportsService(this, ServiceName); -} -uno::Sequence< OUString > SAL_CALL OZipFileAccess::getSupportedServiceNames() +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +package_OZipFileAccess_get_implementation( + css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&) { - return impl_staticGetSupportedServiceNames(); + return cppu::acquire(new OZipFileAccess(context)); } + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/util/package2.component b/package/util/package2.component index 6691a0173bbe..d436d9a35a81 100644 --- a/package/util/package2.component +++ b/package/util/package2.component @@ -18,18 +18,22 @@ --> <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" - prefix="package2" xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.comp.package.zip.ZipFileAccess"> + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.package.zip.ZipFileAccess" + constructor="package_OZipFileAccess_get_implementation"> <service name="com.sun.star.comp.packages.zip.ZipFileAccess"/> <service name="com.sun.star.packages.zip.ZipFileAccess"/> </implementation> - <implementation name="com.sun.star.packages.comp.ZipPackage"> + <implementation name="com.sun.star.packages.comp.ZipPackage" + constructor="package_ZipPackage_get_implementation"> <service name="com.sun.star.packages.Package"/> </implementation> - <implementation name="com.sun.star.packages.manifest.comp.ManifestReader"> + <implementation name="com.sun.star.packages.manifest.comp.ManifestReader" + constructor="package_ManifestReader_get_implementation"> <service name="com.sun.star.packages.manifest.ManifestReader"/> </implementation> - <implementation name="com.sun.star.packages.manifest.comp.ManifestWriter"> + <implementation name="com.sun.star.packages.manifest.comp.ManifestWriter" + constructor="package_ManifestWriter_get_implementation"> <service name="com.sun.star.packages.manifest.ManifestWriter"/> </implementation> </component> diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py index 8153cebb6596..164b8039735d 100755 --- a/solenv/bin/native-code.py +++ b/solenv/bin/native-code.py @@ -23,7 +23,6 @@ core_factory_list = [ ("libembobj.a", "embobj_component_getFactory"), ("libfilterconfiglo.a", "filterconfig1_component_getFactory"), ("libi18npoollo.a", "i18npool_component_getFactory"), - ("libpackage2.a", "package2_component_getFactory"), ("libsmlo.a", "sm_component_getFactory"), ("libsrtrs1.a", "srtrs1_component_getFactory"), ("libucb1.a", "ucb_component_getFactory"), @@ -244,6 +243,11 @@ core_constructor_list = [ ("lingucomponent_SpellChecker_get_implementation", "#ifndef IOS"), "lingucomponent_LangGuess_get_implementation", "lingucomponent_Hyphenator_get_implementation", +# package/util/package2.component + "package_OZipFileAccess_get_implementation", + "package_ZipPackage_get_implementation", + "package_ManifestReader_get_implementation", + "package_ManifestWriter_get_implementation", # sax/source/expatwrap/expwrap.component "com_sun_star_comp_extensions_xml_sax_FastParser_get_implementation", "com_sun_star_comp_extensions_xml_sax_ParserExpat_get_implementation", _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits