diff options
Diffstat (limited to 'cppuhelper')
-rw-r--r-- | cppuhelper/source/compat.cxx | 11 | ||||
-rw-r--r-- | cppuhelper/source/loadsharedlibcomponentfactory.hxx | 34 | ||||
-rw-r--r-- | cppuhelper/source/servicemanager.cxx | 7 | ||||
-rw-r--r-- | cppuhelper/source/shlib.cxx | 48 |
4 files changed, 79 insertions, 21 deletions
diff --git a/cppuhelper/source/compat.cxx b/cppuhelper/source/compat.cxx index c5075402f5ad..97605b01826b 100644 --- a/cppuhelper/source/compat.cxx +++ b/cppuhelper/source/compat.cxx @@ -103,6 +103,17 @@ invokeStaticComponentFactory( for (;;) { std::abort(); } // avoid "must return a value" warnings } +SAL_DLLPUBLIC_EXPORT css::uno::Reference<css::uno::XInterface> SAL_CALL +loadSharedLibComponentFactory( + rtl::OUString const &, rtl::OUString const &, rtl::OUString const &, + css::uno::Reference<css::lang::XMultiServiceFactory> const &, + css::uno::Reference<css::registry::XRegistryKey> const &, + rtl::OUString const &) + SAL_THROW((css::loader::CannotActivateFactoryException)) +{ + for (;;) { std::abort(); } // avoid "must return a value" warnings +} + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppuhelper/source/loadsharedlibcomponentfactory.hxx b/cppuhelper/source/loadsharedlibcomponentfactory.hxx new file mode 100644 index 000000000000..b0986dd76f48 --- /dev/null +++ b/cppuhelper/source/loadsharedlibcomponentfactory.hxx @@ -0,0 +1,34 @@ +/* -*- 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/. + */ + +#ifndef CPPUHELPER_SOURCE_LOADSHAREDLIBCOMPONENTFACTORY_HXX +#define CPPUHELPER_SOURCE_LOADSHAREDLIBCOMPONENTFACTORY_HXX + +#include <sal/config.h> + +#include <com/sun/star/uno/Reference.hxx> + +namespace com { namespace sun { namespace star { + namespace lang { class XMultiServiceFactory; } + namespace uno { class XInterface; } +} } } +namespace rtl { class OUString; } + +namespace cppuhelper { namespace detail { + +css::uno::Reference<css::uno::XInterface> loadSharedLibComponentFactory( + rtl::OUString const & uri, rtl::OUString const & prefix, + rtl::OUString const & rImplName, + css::uno::Reference<css::lang::XMultiServiceFactory> const & xMgr); + +} } + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx index 055bdd37b6d0..ae2060d06058 100644 --- a/cppuhelper/source/servicemanager.cxx +++ b/cppuhelper/source/servicemanager.cxx @@ -41,6 +41,8 @@ #include "rtl/strbuf.hxx" #include "sal/log.hxx" +#include <loadsharedlibcomponentfactory.hxx> + using rtl::OUString; using rtl::OString; using rtl::OStringBuffer; @@ -652,9 +654,8 @@ void cppuhelper::ServiceManager::loadImplementation( if (!prefix.isEmpty()) { prefix += "_"; } - f0 = cppu::loadSharedLibComponentFactory( - uri, rtl::OUString(), info->name, this, - css::uno::Reference< css::registry::XRegistryKey >(), prefix); + f0 = cppuhelper::detail::loadSharedLibComponentFactory( + uri, prefix, info->name, this); } else { SAL_WARN_IF( !info->prefix.isEmpty(), "cppuhelper", diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx index e941b9d19f56..8ad77f516190 100644 --- a/cppuhelper/source/shlib.cxx +++ b/cppuhelper/source/shlib.cxx @@ -27,6 +27,8 @@ #include "com/sun/star/beans/XPropertySet.hpp" +#include <loadsharedlibcomponentfactory.hxx> + #include <stdio.h> #ifdef ANDROID @@ -44,12 +46,11 @@ using namespace ::com::sun::star::uno; using rtl::OString; using rtl::OUString; -namespace cppu -{ +namespace { #ifndef DISABLE_DYNLOADING -static void getLibEnv(oslModule lib, +void getLibEnv(oslModule lib, uno::Environment * pEnv, OUString * pSourceEnv_name, uno::Environment const & cTargetEnv, @@ -104,7 +105,7 @@ static void getLibEnv(oslModule lib, #endif -extern "C" {static void s_getFactory(va_list * pParam) +extern "C" void s_getFactory(va_list * pParam) { component_getFactoryFunc pSym = va_arg(*pParam, component_getFactoryFunc); OString const * pImplName = va_arg(*pParam, OString const *); @@ -113,7 +114,12 @@ extern "C" {static void s_getFactory(va_list * pParam) void ** ppSSF = va_arg(*pParam, void **); *ppSSF = pSym(pImplName->getStr(), pSMgr, pKey); -}} +} + +} + +namespace cppu +{ /* For backwards compatibility */ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory( @@ -122,7 +128,14 @@ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory( Reference< registry::XRegistryKey > const & xKey ) SAL_THROW( (loader::CannotActivateFactoryException) ) { - return loadSharedLibComponentFactory( uri, rPath, rImplName, xMgr, xKey, rtl::OUString() ); + assert(rPath.isEmpty()); + assert(!xKey.is()); + (void) rPath; + (void) xKey; + return cppuhelper::detail::loadSharedLibComponentFactory( + uri, "", rImplName, xMgr); +} + } namespace @@ -255,17 +268,12 @@ extern "C" } #endif -Reference< XInterface > SAL_CALL loadSharedLibComponentFactory( - OUString const & uri, OUString const & rPath, OUString const & rImplName, - Reference< lang::XMultiServiceFactory > const & xMgr, - Reference< registry::XRegistryKey > const & xKey, - OUString const & rPrefix ) - SAL_THROW( (loader::CannotActivateFactoryException) ) +namespace cppuhelper { namespace detail { + +css::uno::Reference<css::uno::XInterface> loadSharedLibComponentFactory( + OUString const & uri, OUString const & rPrefix, OUString const & rImplName, + css::uno::Reference<css::lang::XMultiServiceFactory> const & xMgr) { - assert(rPath.isEmpty()); - assert(!xKey.is()); - (void) rPath; - (void) xKey; #ifndef DISABLE_DYNLOADING OUString moduleUri(uri); @@ -387,6 +395,8 @@ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory( return xRet; } +} } + #ifndef DISABLE_DYNLOADING //============================================================================== @@ -401,6 +411,8 @@ extern "C" { static void s_writeInfo(va_list * pParam) }} +namespace cppu { + void SAL_CALL writeSharedLibComponentInfo( OUString const & uri, OUString const & rPath, Reference< lang::XMultiServiceFactory > const & xMgr, @@ -502,8 +514,8 @@ void SAL_CALL writeSharedLibComponentInfo( } } -#endif // DISABLE_DYNLOADING - } +#endif // DISABLE_DYNLOADING + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |