Kaydet (Commit) 99a09427 authored tarafından Chris Sherlock's avatar Chris Sherlock Kaydeden (comit) Jan Holesovsky

filter: use constructor for filter module

Change-Id: Ic03555dc06909da1c60c8edc7aa17d4cb41c468b
Reviewed-on: https://gerrit.libreoffice.org/14533Reviewed-by: 's avatarJan Holesovsky <kendy@collabora.com>
Tested-by: 's avatarJan Holesovsky <kendy@collabora.com>
üst 93a63e07
......@@ -30,7 +30,6 @@ $(eval $(call gb_Library_use_libraries,textfd,\
))
$(eval $(call gb_Library_add_exception_objects,textfd,\
filter/source/textfilterdetect/fdcomp \
filter/source/textfilterdetect/filterdetect \
))
......
/* -*- 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 "sal/config.h"
#include "cppuhelper/factory.hxx"
#include "cppuhelper/implementationentry.hxx"
#include "sal/types.h"
#include "filterdetect.hxx"
namespace {
static cppu::ImplementationEntry const services[] = {
{ &PlainTextFilterDetect_createInstance, &PlainTextFilterDetect_getImplementationName,
&PlainTextFilterDetect_getSupportedServiceNames,
&cppu::createSingleComponentFactory, 0, 0 },
{ 0, 0, 0, 0, 0, 0 }
};
}
extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL textfd_component_getFactory(
char const * pImplName, void * pServiceManager, void * pRegistryKey)
{
return cppu::component_getFactoryHelper(
pImplName, pServiceManager, pRegistryKey, services);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -188,12 +188,6 @@ uno::Sequence<OUString> PlainTextFilterDetect_getSupportedServiceNames()
return aRet;
}
uno::Reference<uno::XInterface> PlainTextFilterDetect_createInstance(
const uno::Reference<uno::XComponentContext> & rCxt)
{
return (cppu::OWeakObject*) new PlainTextFilterDetect(rCxt);
}
// XServiceInfo
OUString SAL_CALL PlainTextFilterDetect::getImplementationName()
throw (uno::RuntimeException, std::exception)
......@@ -213,4 +207,11 @@ uno::Sequence<OUString> SAL_CALL PlainTextFilterDetect::getSupportedServiceNames
return PlainTextFilterDetect_getSupportedServiceNames();
}
extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
com_sun_star_comp_filters_PlainTextFilterDetect_get_implementation(::com::sun::star::uno::XComponentContext* component,
::com::sun::star::uno::Sequence<css::uno::Any> const &)
{
return cppu::acquire(new PlainTextFilterDetect(component));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -9,7 +9,9 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="textfd" xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.filters.PlainTextFilterDetect">
<service name="com.sun.star.document.ExtendedTypeDetection"/>
</implementation>
<implementation name="com.sun.star.comp.filters.PlainTextFilterDetect"
constructor="com_sun_star_comp_filters_PlainTextFilterDetect_get_implementation">
<service name="com.sun.star.document.ExtendedTypeDetection"/>
<service name="com.sun.star.comp.filters.PlainTextFilterDetect"/>
</implementation>
</component>
......@@ -211,10 +211,11 @@ writer_factory_list = [
("libswdlo.a", "swd_component_getFactory"),
("libswlo.a", "sw_component_getFactory"),
("libwriterfilterlo.a", "writerfilter_component_getFactory"),
("libtextfdlo.a", "textfd_component_getFactory"),
]
writer_constructor_list = [
# filter/source/textfilterdetect/textfd.component
"com_sun_star_comp_filters_PlainTextFilterDetect_get_implementation"
]
factory_map = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment