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 /sfx2/source/appl/app.cxx | |
parent | f4776bf465ee682f65d1e978b031c928d9d310a5 (diff) |
fdo#46808, use service constructor for uri::UriReferenceFactory
Change-Id: I4e72bf5880fa28cb96d93ede7730a63220af7fa6
Diffstat (limited to 'sfx2/source/appl/app.cxx')
-rw-r--r-- | sfx2/source/appl/app.cxx | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index a4ffed8510e7..f5862426afe0 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -56,7 +56,7 @@ #include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <comphelper/processfactory.hxx> -#include <com/sun/star/uri/XUriReferenceFactory.hpp> +#include <com/sun/star/uri/UriReferenceFactory.hpp> #include <com/sun/star/uri/XVndSunStarScriptUrl.hpp> #include <basic/basmgr.hxx> #include <toolkit/helper/vclunohelper.hxx> @@ -527,35 +527,29 @@ sal_Bool SfxApplication::IsXScriptURL( const String& rScriptURL ) (void) rScriptURL; #else ::com::sun::star::uno::Reference - < ::com::sun::star::lang::XMultiServiceFactory > xSMgr = - ::comphelper::getProcessServiceFactory(); + < ::com::sun::star::uno::XComponentContext > xContext = + ::comphelper::getProcessComponentContext(); ::com::sun::star::uno::Reference < ::com::sun::star::uri::XUriReferenceFactory > - xFactory( xSMgr->createInstance( - ::rtl::OUString( - "com.sun.star.uri.UriReferenceFactory" ) ), - ::com::sun::star::uno::UNO_QUERY ); + xFactory = ::com::sun::star::uri::UriReferenceFactory::create( xContext ); - if ( xFactory.is() ) + try { - try - { - ::com::sun::star::uno::Reference - < ::com::sun::star::uri::XVndSunStarScriptUrl > - xUrl( xFactory->parse( rScriptURL ), - ::com::sun::star::uno::UNO_QUERY ); + ::com::sun::star::uno::Reference + < ::com::sun::star::uri::XVndSunStarScriptUrl > + xUrl( xFactory->parse( rScriptURL ), + ::com::sun::star::uno::UNO_QUERY ); - if ( xUrl.is() ) - { - result = sal_True; - } - } - catch (const ::com::sun::star::uno::RuntimeException&) + if ( xUrl.is() ) { - // ignore, will just return FALSE + result = sal_True; } } + catch (const ::com::sun::star::uno::RuntimeException&) + { + // ignore, will just return FALSE + } #endif return result; } |