21#include <rtl/bootstrap.hxx>
23#include <uno/lbnames.h>
24#include <uno/mapping.hxx>
30#include <com/sun/star/lang/XServiceInfo.hpp>
31#include <com/sun/star/lang/XSingleComponentFactory.hpp>
32#include <com/sun/star/util/XMacroExpander.hpp>
38constexpr OUStringLiteral
SERVICE_NAME_B =
u"com.sun.star.lang.BootstrapMacroExpander";
39constexpr OUStringLiteral
IMPL_NAME =
u"com.sun.star.lang.comp.cppuhelper.BootstrapMacroExpander";
52 static rtlBootstrapHandle s_bstrap = rtl_bootstrap_args_open(
getUnoIniUri().
pData);
53 return *
reinterpret_cast<Bootstrap const *
>(&s_bstrap);
62 rtl_bootstrap_expandMacros_from_handle(
77Sequence< OUString >
const & s_get_service_names()
79 static const Sequence< OUString > IMPL_NAMES {
86typedef cppu::WeakComponentImplHelper<
87 util::XMacroExpander, lang::XServiceInfo > t_uno_impl;
94class Bootstrap_MacroExpander :
public mutex_holder,
public t_uno_impl
97 virtual void SAL_CALL disposing()
override;
100 Bootstrap_MacroExpander()
105 virtual OUString SAL_CALL
expandMacros( OUString
const & exp )
override;
113void Bootstrap_MacroExpander::disposing()
118OUString Bootstrap_MacroExpander::getImplementationName()
120 return s_impl_name();
128Sequence< OUString > Bootstrap_MacroExpander::getSupportedServiceNames()
130 return s_get_service_names();
141Reference< XInterface > service_create(
142 SAL_UNUSED_PARAMETER Reference< XComponentContext >
const & )
156 s_get_service_names() ));
158 uno::Environment curr_env(Environment::getCurrent());
159 uno::Environment target_env(CPPU_CURRENT_LANGUAGE_BINDING_NAME);
161 uno::Mapping target2curr(target_env, curr_env);
163 return Reference<lang::XSingleComponentFactory>(
164 static_cast<lang::XSingleComponentFactory *
>(
165 target2curr.mapInterface(free.get(),
cppu::UnoType<
decltype(free)>::get())),
Base class to implement a UNO object supporting weak references, i.e.
constexpr OUStringLiteral IMPL_NAME
constexpr OUStringLiteral SERVICE_NAME_A
constexpr OUStringLiteral SERVICE_NAME_B
std::unique_ptr< sal_Int32[]> pData
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
css::uno::Reference< css::uno::XInterface >(SAL_CALL *ComponentFactoryFunc)(css CPPUHELPER_DLLPUBLIC css::uno::Reference< css::lang::XSingleComponentFactory > SAL_CALL createSingleComponentFactory(ComponentFactoryFunc fptr, ::rtl::OUString const &rImplementationName, css::uno::Sequence< ::rtl::OUString > const &rServiceNames, rtl_ModuleCount *pModCount=NULL)
Function pointer declaration.
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
A helper for implementations of com.sun.star.lang.XServiceInfo.
static Bootstrap const & get_unorc()
Reference< lang::XSingleComponentFactory > create_bootstrap_macro_expander_factory()
OUString expandMacros(OUString const &text)
Helper function to expand macros based on the unorc/uno.ini.
const rtl::Bootstrap * Bootstrap()