summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-08-02 21:25:35 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-08-03 09:04:31 +0200
commit28dc7c3c5efe78d8e43abec89fb904100ace5d41 (patch)
tree376146c66839c74c800a2e09a65dbbf844ddec6b /oox
parent1da9761c72e0893ee01abacb341435a1539a1f93 (diff)
oox: create FastTokenHandler instances with an uno constructor
Change-Id: I1d7bca67c493d31a2a833a8254a9c01c76f1d286 Reviewed-on: https://gerrit.libreoffice.org/58495 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/services.hxx7
-rw-r--r--oox/source/core/fasttokenhandler.cxx30
-rw-r--r--oox/source/core/services.cxx1
-rw-r--r--oox/util/oox.component3
4 files changed, 14 insertions, 27 deletions
diff --git a/oox/inc/services.hxx b/oox/inc/services.hxx
index 59e490ad5f43..5b77f4b1d9a4 100644
--- a/oox/inc/services.hxx
+++ b/oox/inc/services.hxx
@@ -24,13 +24,6 @@
namespace oox {
namespace core {
- extern OUString FastTokenHandler_getImplementationName();
- extern css::uno::Sequence< OUString > FastTokenHandler_getSupportedServiceNames();
- /// @throws css::uno::Exception
- extern css::uno::Reference< css::uno::XInterface > FastTokenHandler_createInstance(
- const css::uno::Reference< css::uno::XComponentContext >& rxContext );
- }
- namespace core {
extern OUString FilterDetect_getImplementationName();
extern css::uno::Sequence< OUString > FilterDetect_getSupportedServiceNames();
/// @throws css::uno::Exception
diff --git a/oox/source/core/fasttokenhandler.cxx b/oox/source/core/fasttokenhandler.cxx
index 7709c6c5a25a..9925204fef46 100644
--- a/oox/source/core/fasttokenhandler.cxx
+++ b/oox/source/core/fasttokenhandler.cxx
@@ -26,27 +26,13 @@
#include <services.hxx>
+using namespace ::com::sun::star;
+
namespace oox {
namespace core {
using namespace ::com::sun::star::uno;
-OUString FastTokenHandler_getImplementationName()
-{
- return OUString( "com.sun.star.comp.oox.core.FastTokenHandler" );
-}
-
-Sequence< OUString > FastTokenHandler_getSupportedServiceNames()
-{
- Sequence<OUString> aServiceNames { "com.sun.star.xml.sax.FastTokenHandler" };
- return aServiceNames;
-}
-
-Reference< XInterface > FastTokenHandler_createInstance( const Reference< XComponentContext >& /*rxContext*/ )
-{
- return static_cast< ::cppu::OWeakObject* >( new FastTokenHandler );
-}
-
FastTokenHandler::FastTokenHandler() :
mrTokenMap( StaticTokenMap::get() )
{
@@ -59,7 +45,7 @@ FastTokenHandler::~FastTokenHandler()
// XServiceInfo
OUString SAL_CALL FastTokenHandler::getImplementationName()
{
- return FastTokenHandler_getImplementationName();
+ return OUString( "com.sun.star.comp.oox.core.FastTokenHandler" );
}
sal_Bool SAL_CALL FastTokenHandler::supportsService( const OUString& rServiceName )
@@ -69,7 +55,8 @@ sal_Bool SAL_CALL FastTokenHandler::supportsService( const OUString& rServiceNam
Sequence< OUString > SAL_CALL FastTokenHandler::getSupportedServiceNames()
{
- return FastTokenHandler_getSupportedServiceNames();
+ Sequence<OUString> aServiceNames { "com.sun.star.xml.sax.FastTokenHandler" };
+ return aServiceNames;
}
Sequence< sal_Int8 > FastTokenHandler::getUTF8Identifier( sal_Int32 nToken )
@@ -90,4 +77,11 @@ sal_Int32 FastTokenHandler::getTokenDirect( const char *pToken, sal_Int32 nLengt
} // namespace core
} // namespace oox
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
+com_sun_star_comp_oox_core_FastTokenHandler_get_implementation(
+ uno::XComponentContext* /*pCtx*/, uno::Sequence<uno::Any> const& /*rSeq*/)
+{
+ return cppu::acquire(new oox::core::FastTokenHandler());
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/core/services.cxx b/oox/source/core/services.cxx
index 85489f2bca6a..354501e79e2c 100644
--- a/oox/source/core/services.cxx
+++ b/oox/source/core/services.cxx
@@ -35,7 +35,6 @@ namespace {
// Impress" would actually want to make use of them:
static ::cppu::ImplementationEntry const spServices[] =
{
- IMPLEMENTATION_ENTRY( ::oox::core::FastTokenHandler ),
IMPLEMENTATION_ENTRY( ::oox::core::FilterDetect ),
IMPLEMENTATION_ENTRY( ::oox::docprop::DocumentPropertiesImport ),
IMPLEMENTATION_ENTRY( ::oox::ppt::PowerPointImport ),
diff --git a/oox/util/oox.component b/oox/util/oox.component
index 06b2eafb8d22..ccbba4d28759 100644
--- a/oox/util/oox.component
+++ b/oox/util/oox.component
@@ -19,7 +19,8 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="oox" xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.oox.core.FastTokenHandler">
+ <implementation name="com.sun.star.comp.oox.core.FastTokenHandler"
+ constructor="com_sun_star_comp_oox_core_FastTokenHandler_get_implementation">
<service name="com.sun.star.xml.sax.FastTokenHandler"/>
</implementation>
<implementation name="com.sun.star.comp.oox.FormatDetector">