[Libreoffice-commits] core.git: ucb/Library_cached1.mk ucb/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 15 06:48:34 UTC 2020


 ucb/Library_cached1.mk                           |    1 
 ucb/source/cacher/cached1.component              |   14 ++-
 ucb/source/cacher/cachedcontentresultset.cxx     |   35 +++-----
 ucb/source/cacher/cachedcontentresultset.hxx     |   11 --
 ucb/source/cacher/cachedcontentresultsetstub.cxx |   32 +++-----
 ucb/source/cacher/cachedcontentresultsetstub.hxx |   11 --
 ucb/source/cacher/cacheddynamicresultset.cxx     |   36 +++------
 ucb/source/cacher/cacheddynamicresultset.hxx     |   10 --
 ucb/source/cacher/cacheddynamicresultsetstub.cxx |   35 +++-----
 ucb/source/cacher/cacheddynamicresultsetstub.hxx |    5 -
 ucb/source/cacher/cacheserv.cxx                  |   90 -----------------------
 11 files changed, 65 insertions(+), 215 deletions(-)

New commits:
commit d4813c671aa423feec8b457a3a8bea5c7671d118
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Jul 14 16:34:32 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Jul 15 08:47:48 2020 +0200

    ucb/cacher: create instances with uno constructors
    
    See tdf#74608 for motivation.
    
    Change-Id: I56261af8f540c214419e01b81c789cb6a4c31d31
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98747
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/ucb/Library_cached1.mk b/ucb/Library_cached1.mk
index 4708f9fedf1f..d2b84a95f23e 100644
--- a/ucb/Library_cached1.mk
+++ b/ucb/Library_cached1.mk
@@ -29,7 +29,6 @@ $(eval $(call gb_Library_add_exception_objects,cached1,\
 	ucb/source/cacher/cachedcontentresultsetstub \
 	ucb/source/cacher/cacheddynamicresultset \
 	ucb/source/cacher/cacheddynamicresultsetstub \
-	ucb/source/cacher/cacheserv \
 	ucb/source/cacher/contentresultsetwrapper \
 	ucb/source/cacher/dynamicresultsetwrapper \
 ))
diff --git a/ucb/source/cacher/cached1.component b/ucb/source/cacher/cached1.component
index e2c893230482..ff460c510cd0 100644
--- a/ucb/source/cacher/cached1.component
+++ b/ucb/source/cacher/cached1.component
@@ -18,17 +18,21 @@
  -->
 
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
-    prefix="cached1" xmlns="http://openoffice.org/2010/uno-components">
-  <implementation name="com.sun.star.comp.ucb.CachedContentResultSetFactory">
+    xmlns="http://openoffice.org/2010/uno-components">
+  <implementation name="com.sun.star.comp.ucb.CachedContentResultSetFactory"
+    constructor="ucb_CachedContentResultSetFactory_get_implementation">
     <service name="com.sun.star.ucb.CachedContentResultSetFactory"/>
   </implementation>
-  <implementation name="com.sun.star.comp.ucb.CachedContentResultSetStubFactory">
+  <implementation name="com.sun.star.comp.ucb.CachedContentResultSetStubFactory"
+    constructor="ucb_CachedContentResultSetStubFactory_get_implementation">
     <service name="com.sun.star.ucb.CachedContentResultSetStubFactory"/>
   </implementation>
-  <implementation name="com.sun.star.comp.ucb.CachedDynamicResultSetFactory">
+  <implementation name="com.sun.star.comp.ucb.CachedDynamicResultSetFactory"
+    constructor="ucb_CachedDynamicResultSetFactory_get_implementation">
     <service name="com.sun.star.ucb.CachedDynamicResultSetFactory"/>
   </implementation>
-  <implementation name="com.sun.star.comp.ucb.CachedDynamicResultSetStubFactory">
+  <implementation name="com.sun.star.comp.ucb.CachedDynamicResultSetStubFactory"
+    constructor="ucb_CachedDynamicResultSetStubFactory_get_implementation">
     <service name="com.sun.star.ucb.CachedDynamicResultSetStubFactory"/>
   </implementation>
 </component>
diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx
index 5b21d033fe99..4972891d3ff3 100644
--- a/ucb/source/cacher/cachedcontentresultset.cxx
+++ b/ucb/source/cacher/cachedcontentresultset.cxx
@@ -936,7 +936,7 @@ sal_Bool SAL_CALL CachedContentResultSet::supportsService( const OUString& Servi
 
 css::uno::Sequence< OUString > SAL_CALL CachedContentResultSet::getSupportedServiceNames()
 {
-    return { CACHED_CONTENT_RESULTSET_SERVICE_NAME };
+    return { "com.sun.star.ucb.CachedContentResultSet" };
 }
 
 
@@ -2055,38 +2055,31 @@ CachedContentResultSetFactory::~CachedContentResultSetFactory()
 
 // CachedContentResultSetFactory XServiceInfo methods.
 
-XSERVICEINFO_COMMOM_IMPL( CachedContentResultSetFactory,
-                          "com.sun.star.comp.ucb.CachedContentResultSetFactory" )
-/// @throws css::uno::Exception
-static css::uno::Reference< css::uno::XInterface >
-CachedContentResultSetFactory_CreateInstance( const css::uno::Reference< css::lang::XMultiServiceFactory> & rSMgr )
+OUString SAL_CALL CachedContentResultSetFactory::getImplementationName()
 {
-    css::lang::XServiceInfo* pX = new CachedContentResultSetFactory( ucbhelper::getComponentContext(rSMgr) );
-    return css::uno::Reference< css::uno::XInterface >::query( pX );
+    return "com.sun.star.comp.ucb.CachedContentResultSetFactory";
 }
-
-css::uno::Sequence< OUString >
-CachedContentResultSetFactory::getSupportedServiceNames_Static()
+sal_Bool SAL_CALL CachedContentResultSetFactory::supportsService( const OUString& ServiceName )
+{
+    return cppu::supportsService( this, ServiceName );
+}
+css::uno::Sequence< OUString > SAL_CALL CachedContentResultSetFactory::getSupportedServiceNames()
 {
-    css::uno::Sequence< OUString > aSNS { CACHED_CONTENT_RESULTSET_FACTORY_NAME };
-    return aSNS;
+    return { "com.sun.star.ucb.CachedContentResultSetFactory" };
 }
 
 // Service factory implementation.
 
 
-css::uno::Reference< css::lang::XSingleServiceFactory >
-CachedContentResultSetFactory::createServiceFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& rxServiceMgr )
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+ucb_CachedContentResultSetFactory_get_implementation(
+    css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&)
 {
-    return cppu::createOneInstanceFactory(
-                rxServiceMgr,
-                CachedContentResultSetFactory::getImplementationName_Static(),
-                CachedContentResultSetFactory_CreateInstance,
-                CachedContentResultSetFactory::getSupportedServiceNames_Static() );
+    return cppu::acquire(new CachedContentResultSetFactory(context));
 }
 
 
-
 // CachedContentResultSetFactory XCachedContentResultSetFactory methods.
 
 
diff --git a/ucb/source/cacher/cachedcontentresultset.hxx b/ucb/source/cacher/cachedcontentresultset.hxx
index f6a86e704aae..31ff8aac4faa 100644
--- a/ucb/source/cacher/cachedcontentresultset.hxx
+++ b/ucb/source/cacher/cachedcontentresultset.hxx
@@ -36,10 +36,6 @@
 
 #include <memory>
 
-#define CACHED_CONTENT_RESULTSET_SERVICE_NAME "com.sun.star.ucb.CachedContentResultSet"
-#define CACHED_CONTENT_RESULTSET_FACTORY_NAME "com.sun.star.ucb.CachedContentResultSetFactory"
-
-
 namespace com::sun::star::script {
     class XTypeConverter;
 }
@@ -382,13 +378,6 @@ public:
     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
 
-    static OUString getImplementationName_Static();
-    static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-
-    static css::uno::Reference< css::lang::XSingleServiceFactory >
-    createServiceFactory( const css::uno::Reference<
-                          css::lang::XMultiServiceFactory >& rxServiceMgr );
-
     // XCachedContentResultSetFactory
 
     virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL
diff --git a/ucb/source/cacher/cachedcontentresultsetstub.cxx b/ucb/source/cacher/cachedcontentresultsetstub.cxx
index 43a8a25e0843..9f8b94116504 100644
--- a/ucb/source/cacher/cachedcontentresultsetstub.cxx
+++ b/ucb/source/cacher/cachedcontentresultsetstub.cxx
@@ -172,7 +172,7 @@ sal_Bool SAL_CALL CachedContentResultSetStub::supportsService( const OUString& S
 
 css::uno::Sequence< OUString > SAL_CALL CachedContentResultSetStub::getSupportedServiceNames()
 {
-    return { CACHED_CRS_STUB_SERVICE_NAME };
+    return { "com.sun.star.ucb.CachedContentResultSetStub" };
 }
 
 
@@ -508,36 +508,32 @@ CachedContentResultSetStubFactory::~CachedContentResultSetStubFactory()
 
 // CachedContentResultSetStubFactory XServiceInfo methods.
 
-XSERVICEINFO_COMMOM_IMPL( CachedContentResultSetStubFactory,
-                          "com.sun.star.comp.ucb.CachedContentResultSetStubFactory" )
-/// @throws css::uno::Exception
-static css::uno::Reference< css::uno::XInterface >
-CachedContentResultSetStubFactory_CreateInstance( const css::uno::Reference< css::lang::XMultiServiceFactory> & )
+OUString SAL_CALL CachedContentResultSetStubFactory::getImplementationName()
 {
-    css::lang::XServiceInfo* pX = new CachedContentResultSetStubFactory;
-    return css::uno::Reference< css::uno::XInterface >::query( pX );
+    return "com.sun.star.comp.ucb.CachedContentResultSetStubFactory";
 }
-css::uno::Sequence< OUString >
-CachedContentResultSetStubFactory::getSupportedServiceNames_Static()
+sal_Bool SAL_CALL CachedContentResultSetStubFactory::supportsService( const OUString& ServiceName )
 {
-    return { CACHED_CRS_STUB_FACTORY_NAME };
+    return cppu::supportsService( this, ServiceName );
+}
+css::uno::Sequence< OUString > SAL_CALL CachedContentResultSetStubFactory::getSupportedServiceNames()
+{
+    return { "com.sun.star.ucb.CachedContentResultSetStubFactory" };
 }
 
 // Service factory implementation.
 
 
-css::uno::Reference< css::lang::XSingleServiceFactory >
-CachedContentResultSetStubFactory::createServiceFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& rxServiceMgr )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+ucb_CachedContentResultSetStubFactory_get_implementation(
+    css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)
 {
-    return cppu::createOneInstanceFactory(
-                rxServiceMgr,
-                CachedContentResultSetStubFactory::getImplementationName_Static(),
-                CachedContentResultSetStubFactory_CreateInstance,
-                CachedContentResultSetStubFactory::getSupportedServiceNames_Static() );
+    return cppu::acquire(new CachedContentResultSetStubFactory());
 }
 
 
 
+
 // CachedContentResultSetStubFactory XCachedContentResultSetStubFactory methods.
 
 
diff --git a/ucb/source/cacher/cachedcontentresultsetstub.hxx b/ucb/source/cacher/cachedcontentresultsetstub.hxx
index d5e2838a269a..90faa6e0862f 100644
--- a/ucb/source/cacher/cachedcontentresultsetstub.hxx
+++ b/ucb/source/cacher/cachedcontentresultsetstub.hxx
@@ -30,10 +30,6 @@
 #include <com/sun/star/ucb/XCachedContentResultSetStubFactory.hpp>
 #include <cppuhelper/implbase.hxx>
 
-#define CACHED_CRS_STUB_SERVICE_NAME "com.sun.star.ucb.CachedContentResultSetStub"
-#define CACHED_CRS_STUB_FACTORY_NAME "com.sun.star.ucb.CachedContentResultSetStubFactory"
-
-
 class CachedContentResultSetStub
                 : public ContentResultSetWrapper
                 , public css::lang::XTypeProvider
@@ -159,13 +155,6 @@ public:
     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
 
-    static OUString getImplementationName_Static();
-    static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-
-    static css::uno::Reference< css::lang::XSingleServiceFactory >
-    createServiceFactory( const css::uno::Reference<
-                          css::lang::XMultiServiceFactory >& rxServiceMgr );
-
     // XCachedContentResultSetStubFactory
 
     virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL
diff --git a/ucb/source/cacher/cacheddynamicresultset.cxx b/ucb/source/cacher/cacheddynamicresultset.cxx
index cc5e47c4ee4f..eaac536179bd 100644
--- a/ucb/source/cacher/cacheddynamicresultset.cxx
+++ b/ucb/source/cacher/cacheddynamicresultset.cxx
@@ -130,7 +130,7 @@ sal_Bool SAL_CALL CachedDynamicResultSet::supportsService( const OUString& Servi
 
 css::uno::Sequence< OUString > SAL_CALL CachedDynamicResultSet::getSupportedServiceNames()
 {
-    return { CACHED_DRS_SERVICE_NAME };
+    return { "com.sun.star.ucb.CachedDynamicResultSet" };
 }
 
 
@@ -160,38 +160,30 @@ CachedDynamicResultSetFactory::~CachedDynamicResultSetFactory()
 
 // CachedDynamicResultSetFactory XServiceInfo methods.
 
-XSERVICEINFO_COMMOM_IMPL( CachedDynamicResultSetFactory,
-                         "com.sun.star.comp.ucb.CachedDynamicResultSetFactory" )
-/// @throws css::uno::Exception
-static css::uno::Reference< css::uno::XInterface >
-CachedDynamicResultSetFactory_CreateInstance( const css::uno::Reference< css::lang::XMultiServiceFactory> & rSMgr )
+OUString SAL_CALL CachedDynamicResultSetFactory::getImplementationName()
 {
-    css::lang::XServiceInfo* pX = new CachedDynamicResultSetFactory( ucbhelper::getComponentContext(rSMgr) );
-    return css::uno::Reference< css::uno::XInterface >::query( pX );
+    return "com.sun.star.comp.ucb.CachedDynamicResultSetFactory";
 }
-
-css::uno::Sequence< OUString >
-CachedDynamicResultSetFactory::getSupportedServiceNames_Static()
+sal_Bool SAL_CALL CachedDynamicResultSetFactory::supportsService( const OUString& ServiceName )
+{
+    return cppu::supportsService( this, ServiceName );
+}
+css::uno::Sequence< OUString > SAL_CALL CachedDynamicResultSetFactory::getSupportedServiceNames()
 {
-    css::uno::Sequence< OUString > aSNS { CACHED_DRS_FACTORY_NAME };
-    return aSNS;
+    return { "com.sun.star.ucb.CachedDynamicResultSetFactory" };
 }
 
 // Service factory implementation.
 
 
-css::uno::Reference< css::lang::XSingleServiceFactory >
-CachedDynamicResultSetFactory::createServiceFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& rxServiceMgr )
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+ucb_CachedDynamicResultSetFactory_get_implementation(
+    css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&)
 {
-    return cppu::createOneInstanceFactory(
-                rxServiceMgr,
-                CachedDynamicResultSetFactory::getImplementationName_Static(),
-                CachedDynamicResultSetFactory_CreateInstance,
-                CachedDynamicResultSetFactory::getSupportedServiceNames_Static() );
+    return cppu::acquire(new CachedDynamicResultSetFactory(context));
 }
 
-
-
 // CachedDynamicResultSetFactory XCachedDynamicResultSetFactory methods.
 
 
diff --git a/ucb/source/cacher/cacheddynamicresultset.hxx b/ucb/source/cacher/cacheddynamicresultset.hxx
index e5cb903564af..0aed42510542 100644
--- a/ucb/source/cacher/cacheddynamicresultset.hxx
+++ b/ucb/source/cacher/cacheddynamicresultset.hxx
@@ -29,9 +29,6 @@
 #include <com/sun/star/ucb/XCachedDynamicResultSetFactory.hpp>
 #include <cppuhelper/implbase.hxx>
 
-#define CACHED_DRS_SERVICE_NAME "com.sun.star.ucb.CachedDynamicResultSet"
-#define CACHED_DRS_FACTORY_NAME "com.sun.star.ucb.CachedDynamicResultSetFactory"
-
 
 class CachedDynamicResultSet
                 : public DynamicResultSetWrapper
@@ -98,13 +95,6 @@ public:
     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
 
-    static OUString getImplementationName_Static();
-    static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-
-    static css::uno::Reference< css::lang::XSingleServiceFactory >
-    createServiceFactory( const css::uno::Reference<
-                          css::lang::XMultiServiceFactory >& rxServiceMgr );
-
     // XCachedDynamicResultSetFactory
 
     virtual css::uno::Reference< css::ucb::XDynamicResultSet > SAL_CALL
diff --git a/ucb/source/cacher/cacheddynamicresultsetstub.cxx b/ucb/source/cacher/cacheddynamicresultsetstub.cxx
index 8ec25e605e30..d0841bb89ea1 100644
--- a/ucb/source/cacher/cacheddynamicresultsetstub.cxx
+++ b/ucb/source/cacher/cacheddynamicresultsetstub.cxx
@@ -132,7 +132,7 @@ sal_Bool SAL_CALL CachedDynamicResultSetStub::supportsService( const OUString& S
 
 css::uno::Sequence< OUString > SAL_CALL CachedDynamicResultSetStub::getSupportedServiceNames()
 {
-    return { CACHED_DRS_STUB_SERVICE_NAME };
+    return { "com.sun.star.ucb.CachedDynamicResultSetStub" };
 }
 
 
@@ -151,38 +151,31 @@ CachedDynamicResultSetStubFactory::~CachedDynamicResultSetStubFactory()
 
 // CachedDynamicResultSetStubFactory XServiceInfo methods.
 
-XSERVICEINFO_COMMOM_IMPL( CachedDynamicResultSetStubFactory,
-                          "com.sun.star.comp.ucb.CachedDynamicResultSetStubFactory" )
-/// @throws css::uno::Exception
-static css::uno::Reference< css::uno::XInterface >
-CachedDynamicResultSetStubFactory_CreateInstance( const css::uno::Reference< css::lang::XMultiServiceFactory> & rSMgr )
+OUString SAL_CALL CachedDynamicResultSetStubFactory::getImplementationName()
 {
-    css::lang::XServiceInfo* pX = new CachedDynamicResultSetStubFactory( ucbhelper::getComponentContext(rSMgr) );
-    return css::uno::Reference< css::uno::XInterface >::query( pX );
+    return "com.sun.star.comp.ucb.CachedDynamicResultSetStubFactory";
 }
-
-css::uno::Sequence< OUString >
-CachedDynamicResultSetStubFactory::getSupportedServiceNames_Static()
+sal_Bool SAL_CALL CachedDynamicResultSetStubFactory::supportsService( const OUString& ServiceName )
+{
+    return cppu::supportsService( this, ServiceName );
+}
+css::uno::Sequence< OUString > SAL_CALL CachedDynamicResultSetStubFactory::getSupportedServiceNames()
 {
-    css::uno::Sequence< OUString > aSNS { CACHED_DRS_STUB_FACTORY_NAME };
-    return aSNS;
+    return { "com.sun.star.ucb.CachedDynamicResultSetStubFactory" };
 }
 
 // Service factory implementation.
 
 
-css::uno::Reference< css::lang::XSingleServiceFactory >
-CachedDynamicResultSetStubFactory::createServiceFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& rxServiceMgr )
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+ucb_CachedDynamicResultSetStubFactory_get_implementation(
+    css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&)
 {
-    return cppu::createOneInstanceFactory(
-                rxServiceMgr,
-                CachedDynamicResultSetStubFactory::getImplementationName_Static(),
-                CachedDynamicResultSetStubFactory_CreateInstance,
-                CachedDynamicResultSetStubFactory::getSupportedServiceNames_Static() );
+    return cppu::acquire(new CachedDynamicResultSetStubFactory(context));
 }
 
 
-
 // CachedDynamicResultSetStubFactory XCachedDynamicResultSetStubFactory methods.
 
 
diff --git a/ucb/source/cacher/cacheddynamicresultsetstub.hxx b/ucb/source/cacher/cacheddynamicresultsetstub.hxx
index e6ca57a94070..5ce4f3bfacaa 100644
--- a/ucb/source/cacher/cacheddynamicresultsetstub.hxx
+++ b/ucb/source/cacher/cacheddynamicresultsetstub.hxx
@@ -28,8 +28,6 @@
 #include <com/sun/star/ucb/XCachedDynamicResultSetStubFactory.hpp>
 #include <cppuhelper/implbase.hxx>
 
-#define CACHED_DRS_STUB_SERVICE_NAME "com.sun.star.ucb.CachedDynamicResultSetStub"
-#define CACHED_DRS_STUB_FACTORY_NAME "com.sun.star.ucb.CachedDynamicResultSetStubFactory"
 
 
 class CachedDynamicResultSetStub
@@ -88,9 +86,6 @@ public:
     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
 
-    static OUString getImplementationName_Static();
-    static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
-
     static css::uno::Reference< css::lang::XSingleServiceFactory >
     createServiceFactory( const css::uno::Reference<
                           css::lang::XMultiServiceFactory >& rxServiceMgr );
diff --git a/ucb/source/cacher/cacheserv.cxx b/ucb/source/cacher/cacheserv.cxx
deleted file mode 100644
index 9e3d3b2a0a8b..000000000000
--- a/ucb/source/cacher/cacheserv.cxx
+++ /dev/null
@@ -1,90 +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 <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include "cachedcontentresultset.hxx"
-#include "cachedcontentresultsetstub.hxx"
-#include "cacheddynamicresultset.hxx"
-#include "cacheddynamicresultsetstub.hxx"
-
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-
-
-extern "C" SAL_DLLPUBLIC_EXPORT void * cached1_component_getFactory(
-    const char * pImplName, void * pServiceManager, void * )
-{
-    void * pRet = nullptr;
-
-    Reference< XMultiServiceFactory > xSMgr(
-            static_cast< XMultiServiceFactory * >( pServiceManager ) );
-    Reference< XSingleServiceFactory > xFactory;
-
-
-    // CachedContentResultSetFactory.
-
-
-    if ( CachedContentResultSetFactory::getImplementationName_Static().
-                equalsAscii( pImplName ) )
-    {
-        xFactory = CachedContentResultSetFactory::createServiceFactory( xSMgr );
-    }
-
-
-    // CachedContentResultSetStubFactory.
-
-
-    else if ( CachedContentResultSetStubFactory::getImplementationName_Static().
-                equalsAscii( pImplName ) )
-    {
-        xFactory = CachedContentResultSetStubFactory::createServiceFactory( xSMgr );
-    }
-
-
-    // CachedDynamicResultSetFactory.
-
-
-    else if ( CachedDynamicResultSetFactory::getImplementationName_Static().
-                equalsAscii( pImplName ) )
-    {
-        xFactory = CachedDynamicResultSetFactory::createServiceFactory( xSMgr );
-    }
-
-
-    // CachedDynamicResultSetStubFactory.
-
-
-    else if ( CachedDynamicResultSetStubFactory::getImplementationName_Static().
-                equalsAscii( pImplName ) )
-    {
-        xFactory = CachedDynamicResultSetStubFactory::createServiceFactory( xSMgr );
-    }
-
-
-    if ( xFactory.is() )
-    {
-        xFactory->acquire();
-        pRet = xFactory.get();
-    }
-
-    return pRet;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list