diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-01-16 13:57:03 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-01-16 17:27:00 +0100 |
commit | 6059652fba10c0c03b8270c75cc53d6f60ce86c4 (patch) | |
tree | 9880193619c19ab29a14a685011d71d2e21de9e6 /cppuhelper | |
parent | 882aaee5ff76dbcba74ecea615393628519e14e1 (diff) |
Move addSingletonContextEntries to ServiceManager
Change-Id: I2a4c5b1f1f735e2bf5a8670d2f957f84388f0164
Diffstat (limited to 'cppuhelper')
-rw-r--r-- | cppuhelper/source/defaultbootstrap.cxx | 17 | ||||
-rw-r--r-- | cppuhelper/source/servicemanager.cxx | 22 | ||||
-rw-r--r-- | cppuhelper/source/servicemanager.hxx | 7 |
3 files changed, 28 insertions, 18 deletions
diff --git a/cppuhelper/source/defaultbootstrap.cxx b/cppuhelper/source/defaultbootstrap.cxx index e0ff2d812280..9f0cb52d32e9 100644 --- a/cppuhelper/source/defaultbootstrap.cxx +++ b/cppuhelper/source/defaultbootstrap.cxx @@ -92,22 +92,7 @@ cppu::defaultBootstrap_InitialComponentContext(rtl::OUString const & iniUri) css::uno::makeAny( cppuhelper::detail::create_bootstrap_macro_expander_factory()), true)); - cppuhelper::ServiceManager::Data const & data = smgr->getData(); - for (cppuhelper::ServiceManager::Data::ImplementationMap::const_iterator i( - data.singletons.begin()); - i != data.singletons.end(); ++i) - { - assert(!i->second.empty()); - assert(i->second[0].get() != 0); - SAL_INFO_IF( - i->second.size() > 1, "cppuhelper", - "Arbitrarily chosing " << i->second[0]->info->name - << " among multiple implementations for " << i->first); - context_values.push_back( - cppu::ContextEntry_Init( - "/singletons/" + i->first, - css::uno::makeAny(i->second[0]->info->name), true)); - } + smgr->addSingletonContextEntries(&context_values); context_values.push_back( cppu::ContextEntry_Init( "/services/com.sun.star.security.AccessController/mode", diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx index bdf1b1a39474..dcb7af9c7bca 100644 --- a/cppuhelper/source/servicemanager.cxx +++ b/cppuhelper/source/servicemanager.cxx @@ -29,6 +29,7 @@ #include "com/sun/star/uno/Reference.hxx" #include "com/sun/star/uno/XComponentContext.hpp" #include "cppuhelper/bootstrap.hxx" +#include "cppuhelper/component_context.hxx" #include "cppuhelper/implbase1.hxx" #include "cppuhelper/implbase3.hxx" #include "cppuhelper/shlib.hxx" @@ -38,6 +39,7 @@ #include "rtl/ref.hxx" #include "rtl/uri.hxx" #include "rtl/ustring.hxx" +#include "sal/log.hxx" #include "xmlreader/xmlreader.hxx" #include "paths.hxx" @@ -596,6 +598,26 @@ void FactoryWrapper::loadImplementation( } +void cppuhelper::ServiceManager::addSingletonContextEntries( + std::vector< cppu::ContextEntry_Init > * entries) const +{ + assert(entries != 0); + for (Data::ImplementationMap::const_iterator i(data_.singletons.begin()); + i != data_.singletons.end(); ++i) + { + assert(!i->second.empty()); + assert(i->second[0].get() != 0); + SAL_INFO_IF( + i->second.size() > 1, "cppuhelper", + "Arbitrarily chosing " << i->second[0]->info->name + << " among multiple implementations for " << i->first); + entries->push_back( + cppu::ContextEntry_Init( + "/singletons/" + i->first, + css::uno::makeAny(i->second[0]->info->name), true)); + } +} + void cppuhelper::ServiceManager::loadImplementation( css::uno::Reference< css::uno::XComponentContext > const & context, boost::shared_ptr< Data::ImplementationInfo > const & info, diff --git a/cppuhelper/source/servicemanager.hxx b/cppuhelper/source/servicemanager.hxx index 013bef0493e1..b57891e4b821 100644 --- a/cppuhelper/source/servicemanager.hxx +++ b/cppuhelper/source/servicemanager.hxx @@ -34,6 +34,8 @@ #include "registry/registry.hxx" #include "rtl/ustring.hxx" +namespace cppu { struct ContextEntry_Init; } + namespace cppuhelper { typedef cppu::WeakComponentImplHelper8< @@ -142,13 +144,14 @@ public: context_ = context; } + void addSingletonContextEntries( + std::vector< cppu::ContextEntry_Init > * entries) const; + css::uno::Reference< css::uno::XComponentContext > getContext() const { assert(context_.is()); return context_; } - Data const & getData() const { return data_; } - void loadImplementation( css::uno::Reference< css::uno::XComponentContext > const & context, boost::shared_ptr< Data::ImplementationInfo > const & info, |