[Libreoffice-commits] core.git: oox/inc oox/source oox/util

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Aug 3 07:04:55 UTC 2018


 oox/inc/services.hxx                 |    7 -------
 oox/source/core/fasttokenhandler.cxx |   30 ++++++++++++------------------
 oox/source/core/services.cxx         |    1 -
 oox/util/oox.component               |    3 ++-
 4 files changed, 14 insertions(+), 27 deletions(-)

New commits:
commit 28dc7c3c5efe78d8e43abec89fb904100ace5d41
Author:     Miklos Vajna <vmiklos at collabora.co.uk>
AuthorDate: Thu Aug 2 21:25:35 2018 +0200
Commit:     Miklos Vajna <vmiklos at collabora.co.uk>
CommitDate: Fri Aug 3 09:04:31 2018 +0200

    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 at collabora.co.uk>

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">


More information about the Libreoffice-commits mailing list