summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-01-08 10:44:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-01-08 10:44:40 +0100
commit29e15349bf9b472dc6fe3fe2d33443e0cbbbeee9 (patch)
tree6f6f51b673cd383bfd3436fe364830e16cdae2f6 /configmgr
parent5201aa548165fb043b367fd58c647696942ae8df (diff)
Fix some configmgr XServiceInfo
Change-Id: I208f5892f6fb54d53ed4d17ddb189f0a24051a17
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/configurationprovider.cxx27
-rw-r--r--configmgr/source/readonlyaccess.cxx3
2 files changed, 25 insertions, 5 deletions
diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx
index 94f00a3acaec..637657b0353b 100644
--- a/configmgr/source/configurationprovider.cxx
+++ b/configmgr/source/configurationprovider.cxx
@@ -60,6 +60,7 @@
#include "components.hxx"
#include "configurationprovider.hxx"
#include "lock.hxx"
+#include "defaultprovider.hxx"
#include "rootaccess.hxx"
namespace configmgr { namespace configuration_provider {
@@ -90,10 +91,19 @@ class Service:
{
public:
Service(
+ css::uno::Reference< css::uno::XComponentContext > const context):
+ ServiceBase(*static_cast< osl::Mutex * >(this)), context_(context),
+ default_(true)
+ {
+ lock_ = lock();
+ assert(context.is());
+ }
+
+ Service(
css::uno::Reference< css::uno::XComponentContext > const context,
OUString const & locale):
ServiceBase(*static_cast< osl::Mutex * >(this)), context_(context),
- locale_(locale)
+ locale_(locale), default_(false)
{
lock_ = lock();
assert(context.is());
@@ -106,7 +116,11 @@ private:
virtual OUString SAL_CALL getImplementationName()
throw (css::uno::RuntimeException)
- { return configuration_provider::getImplementationName(); }
+ {
+ return default_
+ ? default_provider::getImplementationName()
+ : configuration_provider::getImplementationName();
+ }
virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
throw (css::uno::RuntimeException)
@@ -114,7 +128,11 @@ private:
virtual css::uno::Sequence< OUString > SAL_CALL
getSupportedServiceNames() throw (css::uno::RuntimeException)
- { return configuration_provider::getSupportedServiceNames(); }
+ {
+ return default_
+ ? default_provider::getSupportedServiceNames()
+ : configuration_provider::getSupportedServiceNames();
+ }
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(
OUString const & aServiceSpecifier)
@@ -159,6 +177,7 @@ private:
css::uno::Reference< css::uno::XComponentContext > context_;
OUString locale_;
+ bool default_;
boost::shared_ptr<osl::Mutex> lock_;
};
@@ -444,7 +463,7 @@ Factory::createInstanceWithArgumentsAndContext(
css::uno::Reference< css::uno::XInterface > createDefault(
css::uno::Reference< css::uno::XComponentContext > const & context)
{
- return static_cast< cppu::OWeakObject * >(new Service(context, ""));
+ return static_cast< cppu::OWeakObject * >(new Service(context));
}
OUString getImplementationName() {
diff --git a/configmgr/source/readonlyaccess.cxx b/configmgr/source/readonlyaccess.cxx
index 3e297c0d75d0..67d0e0f6d53f 100644
--- a/configmgr/source/readonlyaccess.cxx
+++ b/configmgr/source/readonlyaccess.cxx
@@ -131,7 +131,8 @@ OUString getImplementationName() {
}
css::uno::Sequence< OUString > getSupportedServiceNames() {
- return css::uno::Sequence< OUString >();
+ OUString name("com.sun.star.configuration.ReadOnlyAccess");
+ return css::uno::Sequence< OUString >(&name, 1);
}
} }