[Libreoffice-commits] core.git: filter/Library_textfd.mk filter/source solenv/bin

Chris Sherlock chris.sherlock at collabora.com
Wed Feb 18 02:10:39 PST 2015


 filter/Library_textfd.mk                        |    1 
 filter/source/textfilterdetect/fdcomp.cxx       |   36 ++++++++++++++++++++++++
 filter/source/textfilterdetect/filterdetect.cxx |   13 ++++----
 filter/source/textfilterdetect/textfd.component |    8 ++---
 solenv/bin/native-code.py                       |    3 --
 5 files changed, 47 insertions(+), 14 deletions(-)

New commits:
commit 93a63e07119d63cfb73a970db67c7d73d4b82d9a
Author: Chris Sherlock <chris.sherlock at collabora.com>
Date:   Wed Feb 18 21:09:51 2015 +1100

    Revert "filter: use constructor for filter module"
    
    This reverts commit a2b197ff1f7676c2314a312fa8f40c6bf8871c7c.

diff --git a/filter/Library_textfd.mk b/filter/Library_textfd.mk
index d5ecb7b..ef470b7 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 0000000..61266bc
--- /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 aff3126..0b7ae1f 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 da668435..0b0d722 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>
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index e265333..929eafb 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -211,11 +211,10 @@ 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 = {


More information about the Libreoffice-commits mailing list