summaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-07-11 19:55:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-11 21:52:24 +0200
commit629cdd66b5552a0159f8b06a563b1505eded01cd (patch)
treea5d61bae572996ef559eab69f603ace942681507 /filter
parentfilter/xslt: create instances with uno constructors (diff)
downloadcore-629cdd66b5552a0159f8b06a563b1505eded01cd.tar.gz
core-629cdd66b5552a0159f8b06a563b1505eded01cd.zip
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.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r--filter/Library_xmlfd.mk1
-rw-r--r--filter/source/xmlfilterdetect/fdcomp.cxx46
-rw-r--r--filter/source/xmlfilterdetect/filterdetect.cxx28
-rw-r--r--filter/source/xmlfilterdetect/filterdetect.hxx9
-rw-r--r--filter/source/xmlfilterdetect/xmlfd.component5
5 files changed, 13 insertions, 76 deletions
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>