diff options
author | Chris Sherlock <chris.sherlock@collabora.com> | 2015-02-18 21:09:51 +1100 |
---|---|---|
committer | Chris Sherlock <chris.sherlock@collabora.com> | 2015-02-18 21:09:51 +1100 |
commit | 93a63e07119d63cfb73a970db67c7d73d4b82d9a (patch) | |
tree | 9943f4ac8dfce1d720d90bc8af69b90c97aa75f0 /filter | |
parent | a2b197ff1f7676c2314a312fa8f40c6bf8871c7c (diff) |
Revert "filter: use constructor for filter module"
This reverts commit a2b197ff1f7676c2314a312fa8f40c6bf8871c7c.
Diffstat (limited to 'filter')
-rw-r--r-- | filter/Library_textfd.mk | 1 | ||||
-rw-r--r-- | filter/source/textfilterdetect/fdcomp.cxx | 36 | ||||
-rw-r--r-- | filter/source/textfilterdetect/filterdetect.cxx | 13 | ||||
-rw-r--r-- | filter/source/textfilterdetect/textfd.component | 8 |
4 files changed, 46 insertions, 12 deletions
diff --git a/filter/Library_textfd.mk b/filter/Library_textfd.mk index d5ecb7bf732a..ef470b7e9d51 100644 --- a/filter/Library_textfd.mk +++ b/filter/Library_textfd.mk @@ -30,6 +30,7 @@ $(eval $(call gb_Library_use_libraries,textfd,\ )) $(eval $(call gb_Library_add_exception_objects,textfd,\ + filter/source/textfilterdetect/fdcomp \ filter/source/textfilterdetect/filterdetect \ )) diff --git a/filter/source/textfilterdetect/fdcomp.cxx b/filter/source/textfilterdetect/fdcomp.cxx new file mode 100644 index 000000000000..61266bcb9adc --- /dev/null +++ b/filter/source/textfilterdetect/fdcomp.cxx @@ -0,0 +1,36 @@ +/* -*- 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: */ diff --git a/filter/source/textfilterdetect/filterdetect.cxx b/filter/source/textfilterdetect/filterdetect.cxx index aff31263c6c0..0b7ae1fc8994 100644 --- a/filter/source/textfilterdetect/filterdetect.cxx +++ b/filter/source/textfilterdetect/filterdetect.cxx @@ -188,6 +188,12 @@ 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) @@ -207,11 +213,4 @@ 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: */ diff --git a/filter/source/textfilterdetect/textfd.component b/filter/source/textfilterdetect/textfd.component index da6684355bbb..0b0d722cf17d 100644 --- a/filter/source/textfilterdetect/textfd.component +++ b/filter/source/textfilterdetect/textfd.component @@ -9,9 +9,7 @@ <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" - 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> + <implementation name="com.sun.star.comp.filters.PlainTextFilterDetect"> + <service name="com.sun.star.document.ExtendedTypeDetection"/> + </implementation> </component> |