Kaydet (Commit) b8a5e0cd authored tarafından Chris Sherlock's avatar Chris Sherlock Kaydeden (comit) Jan Holesovsky

writerfilter: use constructor for writerfilter module

Change-Id: Iada80d2c6989de2811cf35cb288a430e2eeba8e9
Reviewed-on: https://gerrit.libreoffice.org/14536Reviewed-by: 's avatarJan Holesovsky <kendy@collabora.com>
Tested-by: 's avatarJan Holesovsky <kendy@collabora.com>
üst d74f5f86
......@@ -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 \
......
......@@ -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: */
......@@ -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: */
......@@ -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
......
/* -*- 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: */
......@@ -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: */
......@@ -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: */
......@@ -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: */
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment