summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock@collabora.com>2015-02-18 21:11:30 +1100
committerJan Holesovsky <kendy@collabora.com>2015-02-18 10:17:10 +0000
commit99a09427e763a6fd020031e475357a989fc91994 (patch)
tree83f21cc67048f214cbbb5284fa56d6a31a00a8b8 /filter
parent93a63e07119d63cfb73a970db67c7d73d4b82d9a (diff)
filter: use constructor for filter module
Change-Id: Ic03555dc06909da1c60c8edc7aa17d4cb41c468b Reviewed-on: https://gerrit.libreoffice.org/14533 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'filter')
-rw-r--r--filter/Library_textfd.mk1
-rw-r--r--filter/source/textfilterdetect/fdcomp.cxx36
-rw-r--r--filter/source/textfilterdetect/filterdetect.cxx13
-rw-r--r--filter/source/textfilterdetect/textfd.component8
4 files changed, 12 insertions, 46 deletions
diff --git a/filter/Library_textfd.mk b/filter/Library_textfd.mk
index ef470b7e9d51..d5ecb7bf732a 100644
--- a/filter/Library_textfd.mk
+++ b/filter/Library_textfd.mk
@@ -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 \
))
diff --git a/filter/source/textfilterdetect/fdcomp.cxx b/filter/source/textfilterdetect/fdcomp.cxx
deleted file mode 100644
index 61266bcb9adc..000000000000
--- a/filter/source/textfilterdetect/fdcomp.cxx
+++ /dev/null
@@ -1,36 +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/.
- */
-
-#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 0b7ae1fc8994..aff31263c6c0 100644
--- a/filter/source/textfilterdetect/filterdetect.cxx
+++ b/filter/source/textfilterdetect/filterdetect.cxx
@@ -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: */
diff --git a/filter/source/textfilterdetect/textfd.component b/filter/source/textfilterdetect/textfd.component
index 0b0d722cf17d..da6684355bbb 100644
--- a/filter/source/textfilterdetect/textfd.component
+++ b/filter/source/textfilterdetect/textfd.component
@@ -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>