[Libreoffice-commits] core.git: Branch 'distro/collabora/viewer' - 3 commits - filter/Library_textfd.mk filter/source solenv/bin writerfilter/Library_writerfilter.mk writerfilter/source writerfilter/util

Jan Holesovsky kendy at collabora.com
Thu Feb 19 11:20:08 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                            |    8 ++
 writerfilter/Library_writerfilter.mk                 |    1 
 writerfilter/source/filter/ImportFilter.cxx          |   15 ++---
 writerfilter/source/filter/RtfFilter.cxx             |    7 +-
 writerfilter/source/filter/RtfFilter.hxx             |    1 
 writerfilter/source/filter/WriterFilter.cxx          |   56 -------------------
 writerfilter/source/filter/WriterFilter.hxx          |    8 --
 writerfilter/source/filter/WriterFilterDetection.cxx |   15 ++---
 writerfilter/source/filter/WriterFilterDetection.hxx |    5 -
 writerfilter/util/writerfilter.component             |    9 ++-
 14 files changed, 44 insertions(+), 139 deletions(-)

New commits:
commit 4a99e6315a11c249f479f567cfc0017c51e02160
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Thu Feb 19 20:17:58 2015 +0100

    native-code.py: Writerfilter implementation is now converted to constructors.
    
    Change-Id: Idcb8731523e3cc54653193e9755b3a59995d4bc8

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 520dc64..a316e40 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -209,12 +209,15 @@ writer_factory_list = [
     ("libsblo.a", "sb_component_getFactory"),
     ("libswdlo.a", "swd_component_getFactory"),
     ("libswlo.a", "sw_component_getFactory"),
-    ("libwriterfilterlo.a", "writerfilter_component_getFactory"),
     ]
 
 writer_constructor_list = [
 # filter/source/textfilterdetect/textfd.component 
-    "com_sun_star_comp_filters_PlainTextFilterDetect_get_implementation"
+    "com_sun_star_comp_filters_PlainTextFilterDetect_get_implementation",
+# writerfilter/util/writerfilter.component
+    "com_sun_star_comp_Writer_RtfFilter_get_implementation",
+    "com_sun_star_comp_Writer_WriterFilter_get_implementation",
+    "com_sun_star_comp_Writer_WriterFilterDetector_get_implementation",
     ]
 
 factory_map = {
commit fd82a7c481fb273fa63ab7ae54c9c612e6b6c7f8
Author: Chris Sherlock <chris.sherlock at collabora.com>
Date:   Wed Feb 18 23:18:59 2015 +1100

    writerfilter: use constructor for writerfilter module
    
    Change-Id: Iada80d2c6989de2811cf35cb288a430e2eeba8e9
    Reviewed-on: https://gerrit.libreoffice.org/14536
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/writerfilter/Library_writerfilter.mk b/writerfilter/Library_writerfilter.mk
index 1bdfa8ee..f3af37a 100644
--- a/writerfilter/Library_writerfilter.mk
+++ b/writerfilter/Library_writerfilter.mk
@@ -114,7 +114,6 @@ $(eval $(call gb_Library_add_exception_objects,writerfilter,\
     writerfilter/source/dmapper/util \
     writerfilter/source/filter/ImportFilter \
     writerfilter/source/filter/RtfFilter \
-    writerfilter/source/filter/WriterFilter \
     writerfilter/source/filter/WriterFilterDetection \
     writerfilter/source/ooxml/Handler \
     writerfilter/source/ooxml/OOXMLBinaryObjectReference \
diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx
index d14ce08..1d5c70a4 100644
--- a/writerfilter/source/filter/ImportFilter.cxx
+++ b/writerfilter/source/filter/ImportFilter.cxx
@@ -217,14 +217,6 @@ uno::Sequence< OUString > WriterFilter_getSupportedServiceNames(  ) throw (uno::
    return aRet;
 }
 
-uno::Reference< uno::XInterface > WriterFilter_createInstance( const uno::Reference< uno::XComponentContext >& xContext)
-                throw( uno::Exception )
-{
-   return (cppu::OWeakObject*) new WriterFilter( xContext );
-}
-
-
-
 OUString WriterFilter::getImplementationName(  ) throw (uno::RuntimeException, std::exception)
 {
    return WriterFilter_getImplementationName();
@@ -271,4 +263,11 @@ void WriterFilter::putPropertiesToDocumentGrabBag( const comphelper::SequenceAsH
     }
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
+com_sun_star_comp_Writer_WriterFilter_get_implementation(::com::sun::star::uno::XComponentContext* component,
+                ::com::sun::star::uno::Sequence<css::uno::Any> const &)
+{
+    return cppu::acquire(new WriterFilter(component));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/filter/RtfFilter.cxx b/writerfilter/source/filter/RtfFilter.cxx
index d737394..0dcc642 100644
--- a/writerfilter/source/filter/RtfFilter.cxx
+++ b/writerfilter/source/filter/RtfFilter.cxx
@@ -176,9 +176,10 @@ uno::Sequence< OUString > RtfFilter_getSupportedServiceNames() throw(uno::Runtim
     return aRet;
 }
 
-uno::Reference< uno::XInterface > RtfFilter_createInstance(const uno::Reference< uno::XComponentContext >& xContext) throw(uno::Exception)
+extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
+com_sun_star_comp_Writer_RtfFilter_get_implementation(::com::sun::star::uno::XComponentContext* component,
+        ::com::sun::star::uno::Sequence<css::uno::Any> const &)
 {
-    return (cppu::OWeakObject*) new RtfFilter(xContext);
+    return cppu::acquire(new RtfFilter(component));
 }
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/filter/RtfFilter.hxx b/writerfilter/source/filter/RtfFilter.hxx
index d9814e0..7acea9a 100644
--- a/writerfilter/source/filter/RtfFilter.hxx
+++ b/writerfilter/source/filter/RtfFilter.hxx
@@ -75,7 +75,6 @@ public:
 
 OUString RtfFilter_getImplementationName() throw (css::uno::RuntimeException);
 css::uno::Sequence<OUString> SAL_CALL RtfFilter_getSupportedServiceNames() throw (css::uno::RuntimeException);
-css::uno::Reference<css::uno::XInterface> SAL_CALL RtfFilter_createInstance(const css::uno::Reference<css::uno::XComponentContext>& xContext) throw(css::uno::Exception);
 
 #endif
 
diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx
deleted file mode 100644
index 9c55f2d..0000000
--- a/writerfilter/source/filter/WriterFilter.cxx
+++ /dev/null
@@ -1,56 +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 <cppuhelper/implementationentry.hxx>
-#include <WriterFilter.hxx>
-#include <WriterFilterDetection.hxx>
-#include <RtfFilter.hxx>
-
-using namespace ::com::sun::star;
-
-WriterFilter::WriterFilter( const uno::Reference< uno::XComponentContext >& rxContext)  :
-    m_xContext( rxContext )
-{
-}
-
-
-WriterFilter::~WriterFilter()
-{
-}
-
-extern "C"
-{
-/* shared lib exports implemented with helpers */
-static const struct ::cppu::ImplementationEntry s_component_entries [] =
-{
-    { WriterFilter_createInstance, WriterFilter_getImplementationName, WriterFilter_getSupportedServiceNames, ::cppu::createSingleComponentFactory, nullptr, 0 },
-    { WriterFilterDetection_createInstance, WriterFilterDetection_getImplementationName, WriterFilterDetection_getSupportedServiceNames, ::cppu::createSingleComponentFactory, nullptr, 0} ,
-    { RtfFilter_createInstance, RtfFilter_getImplementationName, RtfFilter_getSupportedServiceNames, ::cppu::createSingleComponentFactory, nullptr, 0 },
-    { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } // terminate with NULL
-};
-
-SAL_DLLPUBLIC_EXPORT void * SAL_CALL writerfilter_component_getFactory(sal_Char const * implName, void * xMgr, void * xRegistry )
-{
-    return ::cppu::component_getFactoryHelper(implName, xMgr, xRegistry, s_component_entries );
-}
-
-} //extern "C"
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/filter/WriterFilter.hxx b/writerfilter/source/filter/WriterFilter.hxx
index 8933f18..8d82b0c 100644
--- a/writerfilter/source/filter/WriterFilter.hxx
+++ b/writerfilter/source/filter/WriterFilter.hxx
@@ -47,8 +47,8 @@ protected:
 
 
 public:
-   WriterFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext);
-   virtual ~WriterFilter();
+   WriterFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext) {}
+   virtual ~WriterFilter() {}
 
     // XFilter
     virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
@@ -91,10 +91,6 @@ bool SAL_CALL WriterFilter_supportsService( const OUString& ServiceName )
 ::com::sun::star::uno::Sequence< OUString > SAL_CALL WriterFilter_getSupportedServiceNames(  )
     throw ( ::com::sun::star::uno::RuntimeException );
 
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL WriterFilter_createInstance(
-                                                                        const ::com::sun::star::uno::Reference<
-                                                                        ::com::sun::star::uno::XComponentContext > &xContext)
-    throw( ::com::sun::star::uno::Exception );
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/filter/WriterFilterDetection.cxx b/writerfilter/source/filter/WriterFilterDetection.cxx
index da8bd4a..f7db967 100644
--- a/writerfilter/source/filter/WriterFilterDetection.cxx
+++ b/writerfilter/source/filter/WriterFilterDetection.cxx
@@ -109,14 +109,6 @@ uno::Sequence< OUString > WriterFilterDetection_getSupportedServiceNames(  ) thr
    return aRet;
 }
 
-
-uno::Reference< uno::XInterface > WriterFilterDetection_createInstance( const uno::Reference< uno::XComponentContext >& xContext)
-                throw( uno::Exception )
-{
-   return (cppu::OWeakObject*) new WriterFilterDetection( xContext );
-}
-
-
 OUString WriterFilterDetection::getImplementationName(  ) throw (uno::RuntimeException, std::exception)
 {
    return WriterFilterDetection_getImplementationName();
@@ -134,4 +126,11 @@ uno::Sequence< OUString > WriterFilterDetection::getSupportedServiceNames(  ) th
     return WriterFilterDetection_getSupportedServiceNames();
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
+com_sun_star_comp_Writer_WriterFilterDetector_get_implementation( ::com::sun::star::uno::XComponentContext* component,
+        ::com::sun::star::uno::Sequence<css::uno::Any> const &)
+{
+    return cppu::acquire(new WriterFilterDetection(component));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/filter/WriterFilterDetection.hxx b/writerfilter/source/filter/WriterFilterDetection.hxx
index 9c7de92..9b2ebac 100644
--- a/writerfilter/source/filter/WriterFilterDetection.hxx
+++ b/writerfilter/source/filter/WriterFilterDetection.hxx
@@ -59,11 +59,6 @@ bool SAL_CALL WriterFilterDetection_supportsService( const OUString& ServiceName
 ::com::sun::star::uno::Sequence< OUString > SAL_CALL WriterFilterDetection_getSupportedServiceNames(  )
     throw ( ::com::sun::star::uno::RuntimeException );
 
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL WriterFilterDetection_createInstance(
-                                                                        const ::com::sun::star::uno::Reference<
-                                                                        ::com::sun::star::uno::XComponentContext > &xContext)
-    throw( ::com::sun::star::uno::Exception );
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/util/writerfilter.component b/writerfilter/util/writerfilter.component
index 1f0bdd8..28693e6 100644
--- a/writerfilter/util/writerfilter.component
+++ b/writerfilter/util/writerfilter.component
@@ -19,14 +19,17 @@
 
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
     prefix="writerfilter" xmlns="http://openoffice.org/2010/uno-components">
-  <implementation name="com.sun.star.comp.Writer.WriterFilter">
+  <implementation name="com.sun.star.comp.Writer.WriterFilter"
+        constructor="com_sun_star_comp_Writer_WriterFilter_get_implementation">
     <service name="com.sun.star.document.ExportFilter"/>
     <service name="com.sun.star.document.ImportFilter"/>
   </implementation>
-  <implementation name="com.sun.star.comp.Writer.WriterFilterDetector">
+  <implementation name="com.sun.star.comp.Writer.WriterFilterDetector"
+        constructor="com_sun_star_comp_Writer_WriterFilterDetector_get_implementation">
     <service name="com.sun.star.document.ExtendedTypeDetection"/>
   </implementation>
-  <implementation name="com.sun.star.comp.Writer.RtfFilter">
+  <implementation name="com.sun.star.comp.Writer.RtfFilter"
+        constructor="com_sun_star_comp_Writer_RtfFilter_get_implementation">
     <service name="com.sun.star.document.ImportFilter"/>
     <service name="com.sun.star.document.ExportFilter"/>
   </implementation>
commit 8c8176103a1dbd2be467e7b04a9eef9932b7fd8d
Author: Chris Sherlock <chris.sherlock at collabora.com>
Date:   Wed Feb 18 21:11:30 2015 +1100

    filter: use constructor for filter module
    
    Change-Id: Ic03555dc06909da1c60c8edc7aa17d4cb41c468b
    Reviewed-on: https://gerrit.libreoffice.org/14533
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

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


More information about the Libreoffice-commits mailing list