summaryrefslogtreecommitdiff
path: root/writerfilter/source
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock@collabora.com>2015-02-18 23:18:59 +1100
committerJan Holesovsky <kendy@collabora.com>2015-02-19 18:15:31 +0000
commitb8a5e0cd17d53b787762f9827939c02ff25b92a5 (patch)
treef339967ecc215865640424ab6f316114c47440fd /writerfilter/source
parentd74f5f8633d6fe39011d5a613e1dc62402e7a4e7 (diff)
writerfilter: use constructor for writerfilter module
Change-Id: Iada80d2c6989de2811cf35cb288a430e2eeba8e9 Reviewed-on: https://gerrit.libreoffice.org/14536 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'writerfilter/source')
-rw-r--r--writerfilter/source/filter/ImportFilter.cxx15
-rw-r--r--writerfilter/source/filter/RtfFilter.cxx7
-rw-r--r--writerfilter/source/filter/RtfFilter.hxx1
-rw-r--r--writerfilter/source/filter/WriterFilter.cxx56
-rw-r--r--writerfilter/source/filter/WriterFilter.hxx8
-rw-r--r--writerfilter/source/filter/WriterFilterDetection.cxx15
-rw-r--r--writerfilter/source/filter/WriterFilterDetection.hxx5
7 files changed, 20 insertions, 87 deletions
diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx
index 35f6402f81cc..5d43ff5e2ef0 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 421e4856397b..de5b5053133a 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 bfe30c071f97..dcd3a2e4c17e 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 9c55f2d3c0f5..000000000000
--- 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 8933f18826f1..8d82b0c92c18 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 da8bd4aa2cdf..f7db967d0a94 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 9c7de921d1cd..9b2ebac3ffc9 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: */