filter/Library_xmlfd.mk | 1 filter/source/xmlfilterdetect/fdcomp.cxx | 46 ------------------------- filter/source/xmlfilterdetect/filterdetect.cxx | 28 +++++---------- filter/source/xmlfilterdetect/filterdetect.hxx | 9 ---- filter/source/xmlfilterdetect/xmlfd.component | 5 +- solenv/bin/native-code.py | 3 + 6 files changed, 15 insertions(+), 77 deletions(-)
New commits: commit 629cdd66b5552a0159f8b06a563b1505eded01cd Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Sat Jul 11 19:55:57 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Jul 11 21:52:24 2020 +0200 filter/xmlfilterdetect: create instances with uno constructors See tdf#74608 for motivation. Change-Id: Ie16b3a2a11c4b5fee579c05d041d287d753ab2a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98567 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/filter/Library_xmlfd.mk b/filter/Library_xmlfd.mk index c95dcc692ec9..8ec02c3c0ff7 100644 --- a/filter/Library_xmlfd.mk +++ b/filter/Library_xmlfd.mk @@ -36,7 +36,6 @@ $(eval $(call gb_Library_use_libraries,xmlfd,\ )) $(eval $(call gb_Library_add_exception_objects,xmlfd,\ - filter/source/xmlfilterdetect/fdcomp \ filter/source/xmlfilterdetect/filterdetect \ )) diff --git a/filter/source/xmlfilterdetect/fdcomp.cxx b/filter/source/xmlfilterdetect/fdcomp.cxx deleted file mode 100644 index de4cbf5f41af..000000000000 --- a/filter/source/xmlfilterdetect/fdcomp.cxx +++ /dev/null @@ -1,46 +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 <sal/config.h> - -#include <cppuhelper/factory.hxx> -#include <cppuhelper/implementationentry.hxx> -#include <sal/types.h> - -#include "filterdetect.hxx" - -namespace { - -cppu::ImplementationEntry const services[] = { - { &FilterDetect_createInstance, &FilterDetect_getImplementationName, - &FilterDetect_getSupportedServiceNames, - &cppu::createSingleComponentFactory, nullptr, 0 }, - { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } -}; - -} - -extern "C" SAL_DLLPUBLIC_EXPORT void * xmlfd_component_getFactory( - char const * pImplName, void * pServiceManager, void * pRegistryKey) -{ - return cppu::component_getFactoryHelper( - pImplName, pServiceManager, pRegistryKey, services); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/filter/source/xmlfilterdetect/filterdetect.cxx b/filter/source/xmlfilterdetect/filterdetect.cxx index 03f323caf06e..b588fbc62a80 100644 --- a/filter/source/xmlfilterdetect/filterdetect.cxx +++ b/filter/source/xmlfilterdetect/filterdetect.cxx @@ -218,26 +218,10 @@ void SAL_CALL FilterDetect::initialize( const Sequence< Any >& /*aArguments*/ ) { } -OUString FilterDetect_getImplementationName () -{ - return "com.sun.star.comp.filters.XMLFilterDetect"; -} - -Sequence< OUString > FilterDetect_getSupportedServiceNames() -{ - Sequence < OUString > aRet { "com.sun.star.document.ExtendedTypeDetection" }; - return aRet; -} - -Reference< XInterface > FilterDetect_createInstance( const Reference< XComponentContext > & context) -{ - return static_cast< cppu::OWeakObject * >( new FilterDetect( context ) ); -} - // XServiceInfo OUString SAL_CALL FilterDetect::getImplementationName( ) { - return FilterDetect_getImplementationName(); + return "com.sun.star.comp.filters.XMLFilterDetect"; } sal_Bool SAL_CALL FilterDetect::supportsService( const OUString& rServiceName ) @@ -247,7 +231,15 @@ sal_Bool SAL_CALL FilterDetect::supportsService( const OUString& rServiceName ) Sequence< OUString > SAL_CALL FilterDetect::getSupportedServiceNames( ) { - return FilterDetect_getSupportedServiceNames(); + return { "com.sun.star.document.ExtendedTypeDetection" }; } +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +filter_XMLFilterDetect_get_implementation( + css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) +{ + return cppu::acquire(new FilterDetect(context)); +} + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/filter/source/xmlfilterdetect/filterdetect.hxx b/filter/source/xmlfilterdetect/filterdetect.hxx index 964f32419e31..9ba2121810ed 100644 --- a/filter/source/xmlfilterdetect/filterdetect.hxx +++ b/filter/source/xmlfilterdetect/filterdetect.hxx @@ -56,15 +56,6 @@ public: virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; }; -OUString FilterDetect_getImplementationName(); - -css::uno::Sequence< OUString > FilterDetect_getSupportedServiceNames(); - -css::uno::Reference< css::uno::XInterface > - FilterDetect_createInstance( - css::uno::Reference< - css::uno::XComponentContext > const & context); - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/filter/source/xmlfilterdetect/xmlfd.component b/filter/source/xmlfilterdetect/xmlfd.component index 2543ee98dd64..77a8ea0fdfe0 100644 --- a/filter/source/xmlfilterdetect/xmlfd.component +++ b/filter/source/xmlfilterdetect/xmlfd.component @@ -18,8 +18,9 @@ --> <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" - prefix="xmlfd" xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.comp.filters.XMLFilterDetect"> + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.filters.XMLFilterDetect" + constructor="filter_XMLFilterDetect_get_implementation"> <service name="com.sun.star.document.ExtendedTypeDetection"/> </implementation> </component> diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py index cbd3f9eb1779..504b334b6530 100755 --- a/solenv/bin/native-code.py +++ b/solenv/bin/native-code.py @@ -40,7 +40,6 @@ core_factory_list = [ ("libucphier1.a", "ucphier1_component_getFactory"), ("libucptdoc1lo.a", "ucptdoc1_component_getFactory"), ("libxstor.a", "xstor_component_getFactory"), - ("libxmlfdlo.a", "xmlfd_component_getFactory"), ("libxmlfalo.a", "xmlfa_component_getFactory"), ("libodfflatxmllo.a", "odfflatxml_component_getFactory"), ("libvcllo.a", "vcl_component_getFactory"), @@ -158,6 +157,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"), +# filter/source/xmlfilterdetect/xmlfd.component + "filter_XMLFilterDetect_get_implementation", # forms/util/frm.component ("com_sun_star_comp_forms_FormOperations_get_implementation", "#if HAVE_FEATURE_DBCONNECTIVITY"), ("com_sun_star_comp_forms_ODatabaseForm_get_implementation", "#if HAVE_FEATURE_DBCONNECTIVITY"), _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits