extensions/source/bibliography/bib.component | 5 +- extensions/source/bibliography/bibload.cxx | 56 ++------------------------- solenv/bin/native-code.py | 3 - 3 files changed, 11 insertions(+), 53 deletions(-)
New commits: commit e2e66c4a37350155a4dbb6ec5e2811b9f87a6883 Author: Noel Grandin <[email protected]> AuthorDate: Thu Jul 16 10:16:52 2020 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Thu Jul 16 11:37:14 2020 +0200 extensions/bib: create instances with uno constructors See tdf#74608 for motivation. Change-Id: I022d29f4c39f79ed8e0fafe0687e95088279e046 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98875 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/extensions/source/bibliography/bib.component b/extensions/source/bibliography/bib.component index 37963bb90497..19841cc9e970 100644 --- a/extensions/source/bibliography/bib.component +++ b/extensions/source/bibliography/bib.component @@ -18,8 +18,9 @@ --> <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" - prefix="bib" xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.extensions.Bibliography"> + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.extensions.Bibliography" + constructor="extensions_BibliographyLoader_get_implementation"> <service name="com.sun.star.frame.Bibliography"/> <service name="com.sun.star.frame.FrameLoader"/> </implementation> diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx index 10067f17b23c..b8a7dafa7a3e 100644 --- a/extensions/source/bibliography/bibload.cxx +++ b/extensions/source/bibliography/bibload.cxx @@ -66,8 +66,6 @@ using namespace ::com::sun::star::form; using namespace ::com::sun::star::container; using namespace ::com::sun::star::frame; -static Reference< XInterface > BibliographyLoader_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ); - namespace { class BibliographyLoader : public cppu::WeakImplHelper @@ -94,15 +92,8 @@ public: // XServiceInfo OUString SAL_CALL getImplementationName() override; - sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; + sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - static OUString getImplementationName_Static() throw( ) - - { - //! - return "com.sun.star.extensions.Bibliography"; - //! - } //XNameAccess virtual Any SAL_CALL getByName(const OUString& aName) override; @@ -122,11 +113,6 @@ public: virtual void SAL_CALL addVetoableChangeListener(const OUString& PropertyName, const Reference< XVetoableChangeListener > & aListener) override; virtual void SAL_CALL removeVetoableChangeListener(const OUString& PropertyName, const Reference< XVetoableChangeListener > & aListener) override; - static Sequence<OUString> getSupportedServiceNames_Static() throw( ); - - /// @throws Exception - friend Reference< XInterface > (::BibliographyLoader_CreateInstance)( const Reference< XMultiServiceFactory > & rSMgr ); - // XLoader virtual void SAL_CALL load(const Reference< XFrame > & aFrame, const OUString& aURL, const Sequence< PropertyValue >& aArgs, @@ -151,17 +137,10 @@ BibliographyLoader::~BibliographyLoader() } -Reference< XInterface > BibliographyLoader_CreateInstance( const Reference< XMultiServiceFactory > & /*rSMgr*/ ) -{ - return *(new BibliographyLoader); -} - - // XServiceInfo OUString BibliographyLoader::getImplementationName() - { - return getImplementationName_Static(); + return "com.sun.star.extensions.Bibliography"; } // XServiceInfo @@ -172,38 +151,15 @@ sal_Bool BibliographyLoader::supportsService(const OUString& ServiceName) // XServiceInfo Sequence< OUString > BibliographyLoader::getSupportedServiceNames() -{ - return getSupportedServiceNames_Static(); -} - -// ORegistryServiceManager_Static -Sequence< OUString > BibliographyLoader::getSupportedServiceNames_Static() throw( ) { return { "com.sun.star.frame.FrameLoader", "com.sun.star.frame.Bibliography" }; } -extern "C" +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +extensions_BibliographyLoader_get_implementation( + css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&) { - SAL_DLLPUBLIC_EXPORT void * bib_component_getFactory( - const char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) - { - void * pRet = nullptr; - if (BibliographyLoader::getImplementationName_Static().equalsAscii( pImplName ) ) - { - // create the factory - Reference< XSingleServiceFactory > xFactory = - cppu::createSingleFactory( - static_cast<css::lang::XMultiServiceFactory *>(pServiceManager), - BibliographyLoader::getImplementationName_Static(), - BibliographyLoader_CreateInstance, - BibliographyLoader::getSupportedServiceNames_Static() ); - // acquire, because we return an interface pointer instead of a reference - xFactory->acquire(); - pRet = xFactory.get(); - } - return pRet; - } - + return cppu::acquire(new BibliographyLoader()); } void BibliographyLoader::cancel() diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py index 11952f14333d..931435367b5d 100755 --- a/solenv/bin/native-code.py +++ b/solenv/bin/native-code.py @@ -35,7 +35,6 @@ core_factory_list = [ ("libvcllo.a", "vcl_component_getFactory"), ("libsvtlo.a", "svt_component_getFactory"), ("libMacOSXSpelllo.a", "MacOSXSpell_component_getFactory", "#ifdef IOS"), - ("libbiblo.a", "bib_component_getFactory"), ] core_constructor_list = [ @@ -143,6 +142,8 @@ core_constructor_list = [ ("com_sun_star_comp_extensions_LoggerPool", "#ifdef ANDROID"), ("com_sun_star_comp_extensions_PlainTextFormatter", "#ifdef ANDROID"), ("com_sun_star_comp_extensions_SimpleTextFormatter", "#ifdef ANDROID"), +# extensions/source/bibliography/bib.component + "extensions_BibliographyLoader_get_implementation", # filter/source/config/cache/filterconfig1.component "filter_TypeDetection_get_implementation", "filter_FrameLoaderFactory_get_implementation", _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
