Kaydet (Commit) c936fcb0 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Some more configuration::theDefaultProvider simplifications

Change-Id: I91ded7801f4959f2dac7b5b3e4c8d1f3929f4ed9
üst 56d7afee
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "boost/noncopyable.hpp" #include "boost/noncopyable.hpp"
#include "com/sun/star/beans/NamedValue.hpp" #include "com/sun/star/beans/NamedValue.hpp"
#include "com/sun/star/beans/PropertyValue.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/EventObject.hpp"
#include "com/sun/star/lang/Locale.hpp" #include "com/sun/star/lang/Locale.hpp"
#include "com/sun/star/lang/XLocalizable.hpp" #include "com/sun/star/lang/XLocalizable.hpp"
...@@ -32,7 +33,6 @@ ...@@ -32,7 +33,6 @@
#include "com/sun/star/lang/XServiceInfo.hpp" #include "com/sun/star/lang/XServiceInfo.hpp"
#include "com/sun/star/lang/XSingleComponentFactory.hpp" #include "com/sun/star/lang/XSingleComponentFactory.hpp"
#include "com/sun/star/uno/Any.hxx" #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/Exception.hpp"
#include "com/sun/star/uno/Reference.hxx" #include "com/sun/star/uno/Reference.hxx"
#include "com/sun/star/uno/RuntimeException.hpp" #include "com/sun/star/uno/RuntimeException.hpp"
...@@ -432,23 +432,7 @@ Factory::createInstanceWithArgumentsAndContext( ...@@ -432,23 +432,7 @@ Factory::createInstanceWithArgumentsAndContext(
throw (css::uno::Exception, css::uno::RuntimeException) throw (css::uno::Exception, css::uno::RuntimeException)
{ {
if (Arguments.getLength() == 0) { if (Arguments.getLength() == 0) {
css::uno::Reference< css::uno::XInterface > instance; return css::configuration::theDefaultProvider::get(Context);
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;
} else { } else {
rtl::OUString locale; rtl::OUString locale;
for (sal_Int32 i = 0; i < Arguments.getLength(); ++i) { for (sal_Int32 i = 0; i < Arguments.getLength(); ++i) {
......
...@@ -31,13 +31,16 @@ ...@@ -31,13 +31,16 @@
#include <cppuhelper/interfacecontainer.hxx> #include <cppuhelper/interfacecontainer.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/PropertySetInfoChange.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/XHierarchicalNameAccess.hpp>
#include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XNameReplace.hpp> #include <com/sun/star/container/XNameReplace.hpp>
#include <com/sun/star/util/XChangesBatch.hpp> #include <com/sun/star/util/XChangesBatch.hpp>
#include <comphelper/processfactory.hxx>
#include "ucbstore.hxx" #include "ucbstore.hxx"
using namespace com::sun::star::beans; using namespace com::sun::star::beans;
using namespace com::sun::star::configuration;
using namespace com::sun::star::container; using namespace com::sun::star::container;
using namespace com::sun::star::lang; using namespace com::sun::star::lang;
using namespace com::sun::star::ucb; using namespace com::sun::star::ucb;
...@@ -1037,12 +1040,8 @@ Reference< XMultiServiceFactory > PropertySetRegistry::getConfigProvider() ...@@ -1037,12 +1040,8 @@ Reference< XMultiServiceFactory > PropertySetRegistry::getConfigProvider()
try try
{ {
m_pImpl->m_xConfigProvider m_pImpl->m_xConfigProvider
= Reference< XMultiServiceFactory >( = theDefaultProvider::get(
m_xSMgr->createInstance( comphelper::getComponentContext( m_xSMgr ) );
OUString(
"com.sun.star.configuration."
"ConfigurationProvider" ) ),
UNO_QUERY_THROW );
} }
catch (const Exception&) catch (const Exception&)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment