diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-12 08:57:24 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-23 11:45:47 +0200 |
commit | 5aa2cd1d3f85958917f47523ee430af11ac1751d (patch) | |
tree | 0a5e62c012841e51410500c5b6a52db1938c5ed3 /basctl | |
parent | f4776bf465ee682f65d1e978b031c928d9d310a5 (diff) |
fdo#46808, use service constructor for uri::UriReferenceFactory
Change-Id: I4e72bf5880fa28cb96d93ede7730a63220af7fa6
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/scriptdocument.cxx | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx index 0e1fa088ed43..3826f5a31783 100644 --- a/basctl/source/basicide/scriptdocument.cxx +++ b/basctl/source/basicide/scriptdocument.cxx @@ -25,7 +25,7 @@ #include "doceventnotifier.hxx" #include "documentenumeration.hxx" -#include <com/sun/star/uri/XUriReferenceFactory.hpp> +#include <com/sun/star/uri/UriReferenceFactory.hpp> #include <com/sun/star/util/XMacroExpander.hpp> #include <com/sun/star/document/MacroExecMode.hpp> #include <com/sun/star/frame/XStorable.hpp> @@ -88,6 +88,7 @@ namespace basctl using ::com::sun::star::uno::makeAny; using ::com::sun::star::script::XLibraryContainer2; using ::com::sun::star::lang::XMultiServiceFactory; + using ::com::sun::star::uri::UriReferenceFactory; using ::com::sun::star::uri::XUriReferenceFactory; using ::com::sun::star::uri::XUriReference; using ::com::sun::star::uno::XComponentContext; @@ -934,14 +935,8 @@ namespace basctl if ( !xLibContainer->hasByName( _rLibName ) || !xLibContainer->isLibraryLink( _rLibName ) ) return false; OUString aFileURL; - Reference< XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() ); - Reference< XUriReferenceFactory > xUriFac; - if ( xMSF.is() ) - { - xUriFac.set( - xMSF->createInstance( "com.sun.star.uri.UriReferenceFactory" ), - UNO_QUERY_THROW ); - } + Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + Reference< XUriReferenceFactory > xUriFac = UriReferenceFactory::create(xContext); OUString aLinkURL( xLibContainer->getLibraryLinkURL( _rLibName ) ); Reference< XUriReference > xUriRef( xUriFac->parse( aLinkURL ), UNO_QUERY_THROW ); @@ -958,8 +953,6 @@ namespace basctl { OUString aDecodedURL( aAuthority.copy( sizeof ( "vnd.sun.star.expand:" ) - 1 ) ); aDecodedURL = ::rtl::Uri::decode( aDecodedURL, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 ); - Reference< XComponentContext > xContext( - comphelper::getComponentContext( xMSF ) ); Reference< XMacroExpander > xMacroExpander( xContext->getValueByName( "/singletons/com.sun.star.util.theMacroExpander" ), |