From c2ca6fabd1afc3fc07001721c2069d3c8db7000a Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 29 Sep 2012 17:20:22 +0200 Subject: Use comphelper::getComponentContext ...and some further clean up. Change-Id: Id294c0f38fe0041646fc86cacbd2e19734c746a9 --- unotools/source/config/lingucfg.cxx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'unotools/source/config') diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index be309293d466..e8956c464d18 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -24,7 +24,6 @@ #include #include #include "com/sun/star/util/XMacroExpander.hpp" -#include "com/sun/star/beans/XPropertySet.hpp" #include #include #include @@ -939,16 +938,12 @@ static uno::Reference< util::XMacroExpander > lcl_GetMacroExpander() { if ( !xMacroExpander.is() ) { - uno::Reference< uno::XComponentContext > xContext; - uno::Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY ); - xProps->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext"))) >>= xContext; - if ( xContext.is() ) - { - aG_xMacroExpander = uno::Reference< com::sun::star::util::XMacroExpander >( xContext->getValueByName( + uno::Reference< uno::XComponentContext > xContext( + comphelper::getProcessComponentContext() ); + aG_xMacroExpander = uno::Reference< com::sun::star::util::XMacroExpander >( xContext->getValueByName( OUString(RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.util.theMacroExpander"))), uno::UNO_QUERY ); - xMacroExpander = aG_xMacroExpander; - } + xMacroExpander = aG_xMacroExpander; } } -- cgit v1.2.3