[Libreoffice-commits] core.git: configmgr/source

Stephan Bergmann sbergman at redhat.com
Wed Jan 8 01:45:10 PST 2014


 configmgr/source/configurationprovider.cxx |   27 +++++++++++++++++++++++----
 configmgr/source/readonlyaccess.cxx        |    3 ++-
 2 files changed, 25 insertions(+), 5 deletions(-)

New commits:
commit 29e15349bf9b472dc6fe3fe2d33443e0cbbbeee9
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jan 8 10:44:40 2014 +0100

    Fix some configmgr XServiceInfo
    
    Change-Id: I208f5892f6fb54d53ed4d17ddb189f0a24051a17

diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx
index 94f00a3..637657b 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 3e297c0..67d0e0f 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);
 }
 
 } }


More information about the Libreoffice-commits mailing list