summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configmgr/source/configurationprovider.cxx20
-rw-r--r--ucb/source/core/ucbstore.cxx11
2 files changed, 7 insertions, 24 deletions
diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx
index c9043ea6e8f2..db10168e4b8f 100644
--- a/configmgr/source/configurationprovider.cxx
+++ b/configmgr/source/configurationprovider.cxx
@@ -25,6 +25,7 @@
#include "boost/noncopyable.hpp"
#include "com/sun/star/beans/NamedValue.hpp"
#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/configuration/theDefaultProvider.hpp"
#include "com/sun/star/lang/EventObject.hpp"
#include "com/sun/star/lang/Locale.hpp"
#include "com/sun/star/lang/XLocalizable.hpp"
@@ -32,7 +33,6 @@
#include "com/sun/star/lang/XServiceInfo.hpp"
#include "com/sun/star/lang/XSingleComponentFactory.hpp"
#include "com/sun/star/uno/Any.hxx"
-#include "com/sun/star/uno/DeploymentException.hpp"
#include "com/sun/star/uno/Exception.hpp"
#include "com/sun/star/uno/Reference.hxx"
#include "com/sun/star/uno/RuntimeException.hpp"
@@ -432,23 +432,7 @@ Factory::createInstanceWithArgumentsAndContext(
throw (css::uno::Exception, css::uno::RuntimeException)
{
if (Arguments.getLength() == 0) {
- css::uno::Reference< css::uno::XInterface > instance;
- if (!(Context->getValueByName(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "/singletons/"
- "com.sun.star.configuration.theDefaultProvider")))
- >>= instance) ||
- !instance.is())
- {
- throw css::uno::DeploymentException(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "component context fails to supply singleton"
- " com.sun.star.configuration.theDefaultProvider")),
- Context);
- }
- return instance;
+ return css::configuration::theDefaultProvider::get(Context);
} else {
rtl::OUString locale;
for (sal_Int32 i = 0; i < Arguments.getLength(); ++i) {
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index 61a40c3bc474..6fdffba75003 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -31,13 +31,16 @@
#include <cppuhelper/interfacecontainer.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/PropertySetInfoChange.hpp>
+#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
#include <com/sun/star/util/XChangesBatch.hpp>
+#include <comphelper/processfactory.hxx>
#include "ucbstore.hxx"
using namespace com::sun::star::beans;
+using namespace com::sun::star::configuration;
using namespace com::sun::star::container;
using namespace com::sun::star::lang;
using namespace com::sun::star::ucb;
@@ -1037,12 +1040,8 @@ Reference< XMultiServiceFactory > PropertySetRegistry::getConfigProvider()
try
{
m_pImpl->m_xConfigProvider
- = Reference< XMultiServiceFactory >(
- m_xSMgr->createInstance(
- OUString(
- "com.sun.star.configuration."
- "ConfigurationProvider" ) ),
- UNO_QUERY_THROW );
+ = theDefaultProvider::get(
+ comphelper::getComponentContext( m_xSMgr ) );
}
catch (const Exception&)
{