[Libreoffice-commits] core.git: writerfilter/Library_writerfilter.mk writerfilter/source writerfilter/util

Chris Sherlock chris.sherlock at collabora.com
Thu Feb 19 10:15:59 PST 2015


 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 ++-
 9 files changed, 26 insertions(+), 91 deletions(-)

New commits:
commit b8a5e0cd17d53b787762f9827939c02ff25b92a5
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 35f6402..5d43ff5 100644
--- a/writerfilter/source/filter/ImportFilter.cxx
+++ b/writerfilter/source/filter/ImportFilter.cxx
@@ -298,14 +298,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();
@@ -352,4 +344,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 421e485..de5b505 100644
--- a/writerfilter/source/filter/RtfFilter.cxx
+++ b/writerfilter/source/filter/RtfFilter.cxx
@@ -177,9 +177,10 @@ uno::Sequence<OUString> RtfFilter_getSupportedServiceNames() throw(uno::RuntimeE
     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 bfe30c0..dcd3a2e 100644
--- a/writerfilter/source/filter/RtfFilter.hxx
+++ b/writerfilter/source/filter/RtfFilter.hxx
@@ -76,7 +76,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>


More information about the Libreoffice-commits mailing list