21#include <rtl/bootstrap.hxx>
23#include <uno/lbnames.h>
24#include <uno/mapping.hxx>
27#include <compbase2.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 {
87 util::XMacroExpander, lang::XServiceInfo > t_uno_impl;
89class Bootstrap_MacroExpander :
public t_uno_impl
92 Bootstrap_MacroExpander()
96 virtual OUString SAL_CALL
expandMacros( OUString
const & exp )
override;
106OUString Bootstrap_MacroExpander::getImplementationName()
108 return s_impl_name();
116Sequence< OUString > Bootstrap_MacroExpander::getSupportedServiceNames()
118 return s_get_service_names();
129Reference< XInterface > service_create(
130 SAL_UNUSED_PARAMETER Reference< XComponentContext >
const & )
144 s_get_service_names() ));
146 uno::Environment curr_env(Environment::getCurrent());
147 uno::Environment target_env(CPPU_CURRENT_LANGUAGE_BINDING_NAME);
149 uno::Mapping target2curr(target_env, curr_env);
151 return Reference<lang::XSingleComponentFactory>(
152 static_cast<lang::XSingleComponentFactory *
>(
153 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()