[Libreoffice-commits] core.git: solenv/bin ucb/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 22 14:05:47 UTC 2020


 solenv/bin/native-code.py              |    3 +
 ucb/source/ucp/file/filtask.cxx        |   13 -------
 ucb/source/ucp/file/filtask.hxx        |    4 --
 ucb/source/ucp/file/prov.cxx           |   59 ++++-----------------------------
 ucb/source/ucp/file/prov.hxx           |    8 ----
 ucb/source/ucp/file/ucpfile1.component |    5 +-
 6 files changed, 13 insertions(+), 79 deletions(-)

New commits:
commit 47c05f54ca3e74f0fe308ba559aa5929532d095e
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Wed Jul 22 13:47:57 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Jul 22 16:05:06 2020 +0200

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

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 343c0d44c30a..6007ca156aa6 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -25,7 +25,6 @@ core_factory_list = [
     ("libi18npoollo.a", "i18npool_component_getFactory"),
     ("libsmlo.a", "sm_component_getFactory"),
     ("libucb1.a", "ucb_component_getFactory"),
-    ("libucpfile1.a", "ucpfile_component_getFactory"),
     ("libxstor.a", "xstor_component_getFactory"),
     ("libodfflatxmllo.a", "odfflatxml_component_getFactory"),
     ("libvcllo.a", "vcl_component_getFactory"),
@@ -330,6 +329,8 @@ core_constructor_list = [
     "stardiv_Toolkit_VCLXPointer_get_implementation",
     "stardiv_Toolkit_VCLXPopupMenu_get_implementation",
     "stardiv_Toolkit_VCLXToolkit_get_implementation",
+# ucb/source/ucp/file/ucpfile1.component
+    "ucb_file_FileProvider_get_implementation",
 # ucb/source/ucp/expand/ucpexpand1.component
     ("ucb_expand_ExpandContentProviderImpl_get_implementation.a", "#ifdef ANDROID"),
 # ucb/source/sorter/srtrs1.component
diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx
index b03f758ab038..658b47e2a9ed 100644
--- a/ucb/source/ucp/file/filtask.cxx
+++ b/ucb/source/ucp/file/filtask.cxx
@@ -2943,17 +2943,4 @@ TaskManager::getScheme( OUString& Scheme )
   Scheme = "file";
 }
 
-OUString
-TaskManager::getImplementationName_static()
-{
-  return "com.sun.star.comp.ucb.FileProvider";
-}
-
-
-uno::Sequence< OUString >
-TaskManager::getSupportedServiceNames_static()
-{
-  return { "com.sun.star.ucb.FileContentProvider" };
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/file/filtask.hxx b/ucb/source/ucp/file/filtask.hxx
index f0c20a74e2a5..65bf19ae3e5d 100644
--- a/ucb/source/ucp/file/filtask.hxx
+++ b/ucb/source/ucp/file/filtask.hxx
@@ -642,10 +642,6 @@ namespace fileaccess
         // Methods for "writeComponentInfo" and "createComponentFactory"
 
         static void getScheme( OUString& Scheme );
-
-        static OUString getImplementationName_static();
-
-        static css::uno::Sequence< OUString > getSupportedServiceNames_static();
     };
 
 } // end namespace TaskHandling
diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx
index 182713f76704..6cf0ace2daf2 100644
--- a/ucb/source/ucp/file/prov.cxx
+++ b/ucb/source/ucp/file/prov.cxx
@@ -48,35 +48,6 @@ using namespace com::sun::star::container;
 #endif
 
 
-extern "C" SAL_DLLPUBLIC_EXPORT void * ucpfile_component_getFactory(
-    const char * pImplName, void * pServiceManager, void * )
-{
-    void * pRet = nullptr;
-
-    Reference< XMultiServiceFactory > xSMgr(
-            static_cast< XMultiServiceFactory * >( pServiceManager ) );
-    Reference< XSingleServiceFactory > xFactory;
-
-
-    // File Content Provider.
-
-
-    if ( fileaccess::TaskManager::getImplementationName_static().
-            equalsAscii( pImplName ) )
-    {
-        xFactory = FileProvider::createServiceFactory( xSMgr );
-    }
-
-
-    if ( xFactory.is() )
-    {
-        xFactory->acquire();
-        pRet = xFactory.get();
-    }
-
-    return pRet;
-}
-
 /****************************************************************************/
 /*                                                                          */
 /*                                                                          */
@@ -121,7 +92,7 @@ FileProvider::initialize(
 OUString SAL_CALL
 FileProvider::getImplementationName()
 {
-    return fileaccess::TaskManager::getImplementationName_static();
+    return "com.sun.star.comp.ucb.FileProvider";
 }
 
 sal_Bool SAL_CALL FileProvider::supportsService(const OUString& ServiceName )
@@ -132,29 +103,9 @@ sal_Bool SAL_CALL FileProvider::supportsService(const OUString& ServiceName )
 Sequence< OUString > SAL_CALL
 FileProvider::getSupportedServiceNames()
 {
-    return fileaccess::TaskManager::getSupportedServiceNames_static();
-}
-
-Reference< XSingleServiceFactory >
-FileProvider::createServiceFactory(
-                   const Reference< XMultiServiceFactory >& rxServiceMgr )
-{
-    return cppu::createSingleFactory(
-        rxServiceMgr,
-        fileaccess::TaskManager::getImplementationName_static(),
-        FileProvider::CreateInstance,
-        fileaccess::TaskManager::getSupportedServiceNames_static() );
+    return { "com.sun.star.ucb.FileContentProvider" };
 }
 
-Reference< XInterface > SAL_CALL
-FileProvider::CreateInstance(
-    const Reference< XMultiServiceFactory >& xMultiServiceFactory )
-{
-    XServiceInfo* xP = new FileProvider(comphelper::getComponentContext(xMultiServiceFactory));
-    return Reference< XInterface >::query( xP );
-}
-
-
 // XContent
 
 
@@ -493,4 +444,10 @@ OUString SAL_CALL FileProvider::getSystemPathFromFileURL( const OUString& URL )
     return aSystemPath;
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+ucb_file_FileProvider_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
+{
+    return cppu::acquire(new FileProvider(context));
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/file/prov.hxx b/ucb/source/ucp/file/prov.hxx
index 845ab416d8bc..640bf1e9c1d7 100644
--- a/ucb/source/ucp/file/prov.hxx
+++ b/ucb/source/ucp/file/prov.hxx
@@ -69,14 +69,6 @@ namespace fileaccess {
         getSupportedServiceNames() override;
 
 
-        static css::uno::Reference< css::lang::XSingleServiceFactory >
-        createServiceFactory(
-            const css::uno::Reference< css::lang::XMultiServiceFactory >& rxServiceMgr );
-
-        static css::uno::Reference< css::uno::XInterface > SAL_CALL
-        CreateInstance(
-            const css::uno::Reference< css::lang::XMultiServiceFactory >& xMultiServiceFactory );
-
         // XInitialization
         virtual void SAL_CALL
         initialize(
diff --git a/ucb/source/ucp/file/ucpfile1.component b/ucb/source/ucp/file/ucpfile1.component
index 53ebf6a0c0de..5a2efaf3308a 100644
--- a/ucb/source/ucp/file/ucpfile1.component
+++ b/ucb/source/ucp/file/ucpfile1.component
@@ -18,8 +18,9 @@
  -->
 
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
-    prefix="ucpfile" xmlns="http://openoffice.org/2010/uno-components">
-  <implementation name="com.sun.star.comp.ucb.FileProvider">
+    xmlns="http://openoffice.org/2010/uno-components">
+  <implementation name="com.sun.star.comp.ucb.FileProvider"
+    constructor="ucb_file_FileProvider_get_implementation">
     <service name="com.sun.star.ucb.FileContentProvider"/>
   </implementation>
 </component>


More information about the Libreoffice-commits mailing list