diff options
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/Library_ucpdav1.mk | 7 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/ucpdav1.component | 7 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/webdavprovider.cxx | 52 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/webdavprovider.hxx | 7 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/webdavservices.cxx | 56 |
5 files changed, 21 insertions, 108 deletions
diff --git a/ucb/Library_ucpdav1.mk b/ucb/Library_ucpdav1.mk index b9e1d1037897..127d046eb72b 100644 --- a/ucb/Library_ucpdav1.mk +++ b/ucb/Library_ucpdav1.mk @@ -10,8 +10,6 @@ $(eval $(call gb_Library_Library,ucpdav1)) -$(eval $(call gb_Library_set_componentfile,ucpdav1,ucb/source/ucp/webdav-neon/ucpdav1)) - $(eval $(call gb_Library_use_sdk_api,ucpdav1)) $(eval $(call gb_Library_set_include,ucpdav1,\ @@ -31,6 +29,8 @@ $(eval $(call gb_Library_use_libraries,ucpdav1,\ ifeq ($(WITH_WEBDAV),neon) +$(eval $(call gb_Library_set_componentfile,ucpdav1,ucb/source/ucp/webdav-neon/ucpdav1)) + $(eval $(call gb_Library_use_externals,ucpdav1,\ boost_headers \ libxml2 \ @@ -69,6 +69,8 @@ $(eval $(call gb_Library_add_exception_objects,ucpdav1,\ else # WITH_WEBDAV == serf +$(eval $(call gb_Library_set_componentfile,ucpdav1,ucb/source/ucp/webdav/ucpdav1)) + $(eval $(call gb_Library_use_externals,ucpdav1,\ boost_headers \ apr \ @@ -110,7 +112,6 @@ $(eval $(call gb_Library_add_exception_objects,ucpdav1,\ ucb/source/ucp/webdav/webdavprovider \ ucb/source/ucp/webdav/webdavresponseparser \ ucb/source/ucp/webdav/webdavresultset \ - ucb/source/ucp/webdav/webdavservices \ )) endif # WITH_WEBDAV diff --git a/ucb/source/ucp/webdav/ucpdav1.component b/ucb/source/ucp/webdav/ucpdav1.component index 50a3d87b28e0..bb16e3b3979d 100644 --- a/ucb/source/ucp/webdav/ucpdav1.component +++ b/ucb/source/ucp/webdav/ucpdav1.component @@ -17,11 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> - - -<component loader="com.sun.star.loader.SharedLibrary" +<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.comp.WebDAVContentProvider"> + <implementation name="com.sun.star.comp.WebDAVContentProvider" + constructor="ucb_webdav_ContentProvider_get_implementation"> <service name="com.sun.star.ucb.WebDAVContentProvider"/> </implementation> </component> diff --git a/ucb/source/ucp/webdav/webdavprovider.cxx b/ucb/source/ucp/webdav/webdavprovider.cxx index 570b36e6180c..cc19bc7f0a61 100644 --- a/ucb/source/ucp/webdav/webdavprovider.cxx +++ b/ucb/source/ucp/webdav/webdavprovider.cxx @@ -82,56 +82,25 @@ XTYPEPROVIDER_IMPL_3( ContentProvider, // XServiceInfo methods. -OUString SAL_CALL ContentProvider::getImplementationName() -{ - return getImplementationName_Static(); -} -OUString ContentProvider::getImplementationName_Static() +OUString +ContentProvider::getImplementationName() { return "com.sun.star.comp.WebDAVContentProvider"; } -sal_Bool SAL_CALL ContentProvider::supportsService( const OUString& ServiceName ) -{ - return cppu::supportsService( this, ServiceName ); -} - -css::uno::Sequence< OUString > SAL_CALL ContentProvider::getSupportedServiceNames() -{ - return getSupportedServiceNames_Static(); -} - -/// @throws css::uno::Exception -static css::uno::Reference< css::uno::XInterface > -ContentProvider_CreateInstance( const css::uno::Reference< css::lang::XMultiServiceFactory> & rSMgr ) -{ - css::lang::XServiceInfo* pX = - static_cast<css::lang::XServiceInfo*>(new ContentProvider( comphelper::getComponentContext(rSMgr) )); - return css::uno::Reference< css::uno::XInterface >::query( pX ); -} - css::uno::Sequence< OUString > -ContentProvider::getSupportedServiceNames_Static() +ContentProvider::getSupportedServiceNames() { - css::uno::Sequence< OUString > aSNS { WEBDAV_CONTENT_PROVIDER_SERVICE_NAME }; - return aSNS; + return { WEBDAV_CONTENT_PROVIDER_SERVICE_NAME }; } -// Service factory implementation. - -css::uno::Reference< css::lang::XSingleServiceFactory > -ContentProvider::createServiceFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& rxServiceMgr ) +sal_Bool +ContentProvider::supportsService(const OUString& s) { - return cppu::createOneInstanceFactory( - rxServiceMgr, - ContentProvider::getImplementationName_Static(), - ContentProvider_CreateInstance, - ContentProvider::getSupportedServiceNames_Static() ); + return cppu::supportsService(this, s); } - - // XContentProvider methods. @@ -198,4 +167,11 @@ ContentProvider::queryContent( return xContent; } +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +ucb_webdav_ContentProvider_get_implementation( + css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) +{ + return cppu::acquire(new ContentProvider(context)); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucb/source/ucp/webdav/webdavprovider.hxx b/ucb/source/ucp/webdav/webdavprovider.hxx index 3ae22eb9857a..ff6e9af34ca4 100644 --- a/ucb/source/ucp/webdav/webdavprovider.hxx +++ b/ucb/source/ucp/webdav/webdavprovider.hxx @@ -84,13 +84,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 ); - // XContentProvider virtual css::uno::Reference< css::ucb::XContent > SAL_CALL queryContent( const css::uno::Reference< css::ucb::XContentIdentifier >& Identifier ) override; diff --git a/ucb/source/ucp/webdav/webdavservices.cxx b/ucb/source/ucp/webdav/webdavservices.cxx deleted file mode 100644 index 419c9740d3e0..000000000000 --- a/ucb/source/ucp/webdav/webdavservices.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 <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/lang/XSingleServiceFactory.hpp> -#include "webdavprovider.hxx" - -using namespace com::sun::star; - -extern "C" SAL_DLLPUBLIC_EXPORT void * ucpdav1_component_getFactory( - const char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) -{ - void * pRet = nullptr; - - uno::Reference< lang::XMultiServiceFactory > xSMgr( - static_cast< lang::XMultiServiceFactory * >( pServiceManager ) ); - uno::Reference< lang::XSingleServiceFactory > xFactory; - - - // WebDAV Content Provider. - - - if ( ::http_dav_ucp::ContentProvider::getImplementationName_Static(). - equalsAscii( pImplName ) ) - { - xFactory = ::http_dav_ucp::ContentProvider::createServiceFactory( xSMgr ); - } - - - if ( xFactory.is() ) - { - xFactory->acquire(); - pRet = xFactory.get(); - } - - return pRet; -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |