Kaydet (Commit) 2f7b3292 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

[API CHANGE] remove cppu::loadSharedLibComponentFactory w/ rPrefix again

...it was never meant to be called by client code anyway and is no longer needed
to be exposed since the global service manager implementation moved to
cppuhelper.

Change-Id: If2d0510b2364084d36edeb156a3459d9b8aeb983
üst 445d3d84
......@@ -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: */
/* -*- 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: */
......@@ -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",
......
......@@ -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: */
......@@ -54,36 +54,6 @@ SAL_CALL loadSharedLibComponentFactory(
::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > const & xKey )
SAL_THROW( (::com::sun::star::loader::CannotActivateFactoryException) );
/** Loads a shared library component and gets the factory out of it. You can give either a
fully qualified libname or single lib name. The libname need not be pre/postfixed
(e.g. xxx.dll). An optional 'prefix' parameter is used to determine the symbol
name of the entry point in the library.
@deprecated
This should never have been put into the URE interface. Do not call it from
client code.
@param uri URI of the library
@param rPath deprecated, must be empty
@param rImplName implementation to be retrieved from the library
@param xMgr service manager to be provided to the component
@param xKey deprecated, must be null
@param rPrefix optional component prefix
@return
factory instance (com::sun::star::lang::XSingleComponentFactory or legacy
com::sun::star::lang::XSingleServiceFactory)
@since LibreOffice 3.4
*/
CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
SAL_CALL loadSharedLibComponentFactory(
::rtl::OUString const & uri, ::rtl::OUString const & rPath,
::rtl::OUString const & rImplName,
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & xMgr,
::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > const & xKey,
::rtl::OUString const & rPrefix )
SAL_THROW( (::com::sun::star::loader::CannotActivateFactoryException) );
/** Invokes component_writeInfo() function of specified component library. You can give either
a fully qualified libname or single lib name. The libname need not be pre/postfixed
(e.g. xxx.dll).
......
......@@ -161,7 +161,7 @@ Reference<XInterface> SAL_CALL DllComponentLoader::activate(
{
return loadSharedLibComponentFactory(
cppu::bootstrap_expandUri(rLibName), OUString(), rImplName, m_xSMgr,
css::uno::Reference<css::registry::XRegistryKey>(), OUString() );
css::uno::Reference<css::registry::XRegistryKey>());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment