summaryrefslogtreecommitdiff
path: root/cppuhelper
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-01-15 17:22:16 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-01-16 11:39:02 +0100
commitaed1f0d5d543c534b4b9c3517802a24e700f0b5a (patch)
treef17bca0ce3036020ec6b2343c2405155f65bd476 /cppuhelper
parent3250fad6374ef276e198faabbb1d655adeeb28f0 (diff)
Simplify defaultbootstrap.cxx
Change-Id: Ice206b1dabf8dbcad613f886574e737c039d2119
Diffstat (limited to 'cppuhelper')
-rw-r--r--cppuhelper/source/defaultbootstrap.cxx70
1 files changed, 32 insertions, 38 deletions
diff --git a/cppuhelper/source/defaultbootstrap.cxx b/cppuhelper/source/defaultbootstrap.cxx
index 23411b1ffbb4..e4b3cd537117 100644
--- a/cppuhelper/source/defaultbootstrap.cxx
+++ b/cppuhelper/source/defaultbootstrap.cxx
@@ -52,12 +52,33 @@
namespace {
-css::uno::Reference< css::uno::XComponentContext > bootstrapComponentContext(
- css::uno::Reference< css::registry::XSimpleRegistry > const & typeRegistry,
- rtl::OUString const & serviceUris, rtl::Bootstrap const & bootstrap)
+rtl::OUString getBootstrapVariable(
+ rtl::Bootstrap const & bootstrap, rtl::OUString const & name)
{
+ rtl::OUString v;
+ if (!bootstrap.getFrom(name, v)) {
+ throw css::uno::DeploymentException(
+ "Cannot obtain " + name + " from uno ini",
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return v;
+}
+
+}
+
+css::uno::Reference< css::uno::XComponentContext >
+cppu::defaultBootstrap_InitialComponentContext(rtl::OUString const & iniUri)
+ SAL_THROW((css::uno::Exception))
+{
+ rtl::Bootstrap bs(iniUri);
+ if (bs.getHandle() == 0) {
+ throw css::uno::DeploymentException(
+ "Cannot open uno ini " + iniUri,
+ css::uno::Reference< css::uno::XInterface >());
+ }
rtl::Reference< cppuhelper::ServiceManager > smgr(
- new cppuhelper::ServiceManager(serviceUris));
+ new cppuhelper::ServiceManager(
+ getBootstrapVariable(bs, "UNO_SERVICES")));
cppu::ContextEntry_Init entry;
std::vector< cppu::ContextEntry_Init > context_values;
context_values.push_back(
@@ -95,7 +116,7 @@ css::uno::Reference< css::uno::XComponentContext > bootstrapComponentContext(
"/singletons/" + i->first,
css::uno::makeAny(i->second[0]->info->name), true));
}
- cppu::add_access_control_entries(&context_values, bootstrap);
+ cppu::add_access_control_entries(&context_values, bs);
assert(!context_values.empty());
css::uno::Reference< css::uno::XComponentContext > context(
createComponentContext(
@@ -106,9 +127,13 @@ css::uno::Reference< css::uno::XComponentContext > bootstrapComponentContext(
context->getValueByName(
"/singletons/com.sun.star.reflection.theTypeDescriptionManager"),
css::uno::UNO_QUERY_THROW);
- if (typeRegistry.is()) {
+ css::uno::Reference< css::registry::XSimpleRegistry > typereg(
+ cppuhelper::createTypeRegistry(
+ getBootstrapVariable(bs, "UNO_TYPES"),
+ getBootstrapVariable(bs, "URE_INTERNAL_LIB_DIR")));
+ if (typereg.is()) {
css::uno::Sequence< css::uno::Any > arg(1);
- arg[0] <<= typeRegistry;
+ arg[0] <<= typereg;
css::uno::Reference< css::container::XSet >(
tdmgr, css::uno::UNO_QUERY_THROW)->
insert(
@@ -122,37 +147,6 @@ css::uno::Reference< css::uno::XComponentContext > bootstrapComponentContext(
return context;
}
-rtl::OUString getBootstrapVariable(
- rtl::Bootstrap const & bootstrap, rtl::OUString const & name)
-{
- rtl::OUString v;
- if (!bootstrap.getFrom(name, v)) {
- throw css::uno::DeploymentException(
- "Cannot obtain " + name + " from uno ini",
- css::uno::Reference< css::uno::XInterface >());
- }
- return v;
-}
-
-}
-
-css::uno::Reference< css::uno::XComponentContext >
-cppu::defaultBootstrap_InitialComponentContext(rtl::OUString const & iniUri)
- SAL_THROW((css::uno::Exception))
-{
- rtl::Bootstrap bs(iniUri);
- if (bs.getHandle() == 0) {
- throw css::uno::DeploymentException(
- "Cannot open uno ini " + iniUri,
- css::uno::Reference< css::uno::XInterface >());
- }
- return bootstrapComponentContext(
- cppuhelper::createTypeRegistry(
- getBootstrapVariable(bs, "UNO_TYPES"),
- getBootstrapVariable(bs, "URE_INTERNAL_LIB_DIR")),
- getBootstrapVariable(bs, "UNO_SERVICES"), bs);
-}
-
css::uno::Reference< css::uno::XComponentContext >
cppu::defaultBootstrap_InitialComponentContext()
SAL_THROW((css::uno::Exception))
6081b089710f4dd0b1d2ad3'>TODO: refcount ImplFontListCaolán McNamara Change-Id: Ie125f1ac9c14a41e25c3e54beafca2f9e34e4c6f Reviewed-on: https://gerrit.libreoffice.org/59310 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> 2018-08-20TODO: refcount ImplFontCacheCaolán McNamara Change-Id: Ia4499c2a1515aebaff9edf0e843fc66c7fb1414e Reviewed-on: https://gerrit.libreoffice.org/59309 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> 2018-07-31Add missing sal/log.hxx headersGabor Kelemen rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directory vcl Change-Id: I205fe0f4e80a66cd9c3b19f7e9716411da1d1cf5 Reviewed-on: https://gerrit.libreoffice.org/58221 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> 2018-06-08hold LogicalFontInstance with rtl::ReferenceNoel Grandin instead of manual reference counting. Also the releasing of not-currently-in-use LogicalFontInstance objects from the cache is made less aggressive - we now only flush entries until we have less than CACHE_SIZE instances, instead of flushing the whole cache. Change-Id: Ib235b132776b5f09ae8ae93a933c2eebe5fa9610 Reviewed-on: https://gerrit.libreoffice.org/55384 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2018-06-05tdf#42949 remove unused compheler includes ..Jochen Nitschke and fix the fallout Change-Id: I15bc5d626f4d157cbc69a87392078b41e621d14e Reviewed-on: https://gerrit.libreoffice.org/54882 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>