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(); -} -Reference < XSingleServiceFactory > ManifestReader::createServiceFactory( Reference < XMultiServiceFactory > const & rServiceFactory ) -{ - return cppu::createSingleFactory (rServiceFactory, - static_getImplementationName(), - ManifestReader_createInstance, - static_getSupportedServiceNames()); + return { "com.sun.star.packages.manifest.ManifestReader" }; } + +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +package_ManifestReader_get_implementation( + css::uno::XComponentContext* context , css::uno::Sequence const&) +{ + 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 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 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 -#include -#include - -#include - -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() +OUString ZipPackage::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(); -} - 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 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,28 +449,9 @@ 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() -{ - return "com.sun.star.comp.package.zip.ZipFileAccess"; -} - -uno::Reference< uno::XInterface > OZipFileAccess::impl_staticCreateSelfInstance( - const uno::Reference< lang::XMultiServiceFactory >& rxMSF ) -{ - return uno::Reference< uno::XInterface >( *new OZipFileAccess( comphelper::getComponentContext(rxMSF) ) ); -} - OUString SAL_CALL OZipFileAccess::getImplementationName() { - return impl_staticGetImplementationName(); + return "com.sun.star.comp.package.zip.ZipFileAccess"; } sal_Bool SAL_CALL OZipFileAccess::supportsService( const OUString& ServiceName ) @@ -480,7 +461,17 @@ sal_Bool SAL_CALL OZipFileAccess::supportsService( const OUString& ServiceName ) uno::Sequence< OUString > SAL_CALL OZipFileAccess::getSupportedServiceNames() { - return impl_staticGetSupportedServiceNames(); + return { "com.sun.star.packages.zip.ZipFileAccess", + "com.sun.star.comp.packages.zip.ZipFileAccess" }; } + +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +package_OZipFileAccess_get_implementation( + css::uno::XComponentContext* context , css::uno::Sequence const&) +{ + 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 @@ --> - + xmlns="http://openoffice.org/2010/uno-components"> + - + - + - + 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",