summaryrefslogtreecommitdiff
path: root/unotools/source/config/itemholder1.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'unotools/source/config/itemholder1.cxx')
-rw-r--r--unotools/source/config/itemholder1.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/unotools/source/config/itemholder1.cxx b/unotools/source/config/itemholder1.cxx
index 1d2b90ede043..de973654dd9f 100644
--- a/unotools/source/config/itemholder1.cxx
+++ b/unotools/source/config/itemholder1.cxx
@@ -22,6 +22,7 @@
#include <comphelper/processfactory.hxx>
#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <unotools/misccfg.hxx>
#include <unotools/useroptions.hxx>
@@ -64,12 +65,11 @@ ItemHolder1::ItemHolder1()
{
try
{
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
+ css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
css::uno::Reference< css::lang::XComponent > xCfg(
- xSMGR->createInstance(::rtl::OUString("com.sun.star.configuration.ConfigurationProvider")),
- css::uno::UNO_QUERY);
- if (xCfg.is())
- xCfg->addEventListener(static_cast< css::lang::XEventListener* >(this));
+ css::configuration::theDefaultProvider::get( xContext ),
+ css::uno::UNO_QUERY_THROW );
+ xCfg->addEventListener(static_cast< css::lang::XEventListener* >(this));
}
#ifdef DBG_UTIL
catch(const css::uno::Exception& rEx)