diff options
author | Noel Grandin <noel@peralex.com> | 2013-02-08 11:02:37 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-02-11 08:02:13 +0200 |
commit | 591ef7844079e93ff627c7e194c04d520d2f1d55 (patch) | |
tree | 39c16f140ef2eae20f00a6c078d49519d4bd6bdc /sfx2 | |
parent | 81c967e06e4247dec7ecb9ffec695ba31cb4f057 (diff) |
fdo#46808, Use singleton util::theMacroExpander new-style constructor
And deprecate the old-style service util::MacroExpander
Change-Id: Ifcefe31a8f8c68c6d44d6ec19616727eb607e1cd
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/doctemplates.cxx | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 49e71cdcbc42..94ba00bd2c4f 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -38,7 +38,7 @@ #include <com/sun/star/beans/XPropertySetInfo.hpp> #include <com/sun/star/beans/XPropertyContainer.hpp> #include <com/sun/star/beans/StringPair.hpp> -#include <com/sun/star/util/XMacroExpander.hpp> +#include <com/sun/star/util/theMacroExpander.hpp> #include <com/sun/star/configuration/theDefaultProvider.hpp> #include <com/sun/star/container/XContainerQuery.hpp> #include <com/sun/star/document/XTypeDetection.hpp> @@ -580,17 +580,10 @@ void SfxDocTplService_Impl::getDirList() uno::Reference< XComponentContext > xCtx( comphelper::getComponentContext( mxFactory ) ); - uno::Reference< util::XMacroExpander > xExpander; + uno::Reference< util::XMacroExpander > xExpander = util::theMacroExpander::get(xCtx); const rtl::OUString aPrefix( "vnd.sun.star.expand:" ); - xCtx->getValueByName( - rtl::OUString( "/singletons/com.sun.star.util.theMacroExpander" ) ) - >>= xExpander; - - OSL_ENSURE( xExpander.is(), - "Unable to obtain macro expander singleton!" ); - for ( sal_uInt16 i=0; i<nCount; i++ ) { aURL.SetSmartProtocol( INET_PROT_FILE ); @@ -2852,7 +2845,7 @@ void SfxURLRelocator_Impl::implExpandURL( ::rtl::OUString& io_url ) if ( !mxMacroExpander.is() ) { ::comphelper::ComponentContext aContext( mxFactory ); - mxMacroExpander.set( aContext.getSingleton( "com.sun.star.util.theMacroExpander" ), UNO_QUERY_THROW ); + mxMacroExpander.set( theMacroExpander::get(aContext.getUNOContext()), UNO_QUERY_THROW ); } io_url = mxMacroExpander->expandMacros( io_url ); } |