diff options
author | Noel Grandin <noel@peralex.com> | 2012-08-29 07:45:05 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-03 15:55:05 +0200 |
commit | bc00717bb7a2b48885ca356fb0a966acbe72dca9 (patch) | |
tree | 3eacf7bb54893d7380789d1a2e9ffbb759da16ba /cui | |
parent | 7dd6c0a8372810f48e6bee35a11ac4ad0432640b (diff) |
fdo#46808, Adapt system::SystemShellExecute UNO service to new style
Change-Id: Ib298b3219c3e89dd35bce0974846ed4888ed941e
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/SpellDialog.cxx | 9 | ||||
-rw-r--r-- | cui/source/dialogs/about.cxx | 10 | ||||
-rw-r--r-- | cui/source/options/optlingu.cxx | 13 |
3 files changed, 13 insertions, 19 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index e71256943cc5..834d31e11735 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -49,7 +49,7 @@ #include <com/sun/star/linguistic2/SpellFailure.hpp> #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/system/SystemShellExecuteFlags.hpp> -#include <com/sun/star/system/XSystemShellExecute.hpp> +#include <com/sun/star/system/SystemShellExecute.hpp> #include <sfx2/app.hxx> #include <vcl/help.hxx> #include <vcl/graph.hxx> @@ -2174,10 +2174,9 @@ IMPL_LINK( SpellDialog, HandleHyperlink, svt::FixedHyperlink*, pHyperlink ) return 1; try { - uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute( - ::comphelper::getProcessServiceFactory()->createInstance( - DEFINE_CONST_UNICODE("com.sun.star.system.SystemShellExecute") ), uno::UNO_QUERY_THROW ); - xSystemShellExecute->execute( sURL, rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::URIS_ONLY ); + uno::Reference< system::XSystemShellExecute > xSystemShellExecute( + system::SystemShellExecute::create(::comphelper::getProcessComponentContext()) ); + xSystemShellExecute->execute( sURL, rtl::OUString(), system::SystemShellExecuteFlags::URIS_ONLY ); } catch ( uno::Exception& ) { diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx index e25c72984213..9d5b4f1f19af 100644 --- a/cui/source/dialogs/about.cxx +++ b/cui/source/dialogs/about.cxx @@ -39,7 +39,7 @@ #include <svtools/langhelp.hxx> #include "com/sun/star/system/SystemShellExecuteFlags.hpp" -#include "com/sun/star/system/XSystemShellExecute.hpp" +#include "com/sun/star/system/SystemShellExecute.hpp" #include <comphelper/processfactory.hxx> #include "comphelper/anytostring.hxx" #include "cppuhelper/exc_hlp.hxx" @@ -133,11 +133,9 @@ IMPL_LINK( AboutDialog, HandleClick, PushButton*, pButton ) return 1; try { - Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute( - ::comphelper::getProcessServiceFactory()->createInstance( - DEFINE_CONST_UNICODE("com.sun.star.system.SystemShellExecute") ), UNO_QUERY_THROW ); - xSystemShellExecute->execute( sURL, rtl::OUString(), - com::sun::star::system::SystemShellExecuteFlags::URIS_ONLY ); + Reference< system::XSystemShellExecute > xSystemShellExecute( + system::SystemShellExecute::create(::comphelper::getProcessComponentContext() ) ); + xSystemShellExecute->execute( sURL, rtl::OUString(), system::SystemShellExecuteFlags::URIS_ONLY ); } catch (const Exception&) { diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 8ee3d37368ea..d26f97a1fd20 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -53,7 +53,7 @@ #include <com/sun/star/linguistic2/XDictionaryList.hpp> #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/ucb/CommandAbortedException.hpp> -#include <com/sun/star/system/XSystemShellExecute.hpp> +#include <com/sun/star/system/SystemShellExecute.hpp> #include <com/sun/star/system/SystemShellExecuteFlags.hpp> #include <unotools/extendedsecurityoptions.hxx> #include <svtools/svlbox.hxx> @@ -148,14 +148,11 @@ static void lcl_OpenURL( ::rtl::OUString sURL ) localizeWebserviceURI(sURL); try { - uno::Reference< lang::XMultiServiceFactory > xSMGR = - ::comphelper::getProcessServiceFactory(); + uno::Reference< uno::XComponentContext > xContext = + ::comphelper::getProcessComponentContext(); uno::Reference< css::system::XSystemShellExecute > xSystemShell( - xSMGR->createInstance( ::rtl::OUString( - "com.sun.star.system.SystemShellExecute") ), - uno::UNO_QUERY_THROW ); - if ( xSystemShell.is() ) - xSystemShell->execute( sURL, ::rtl::OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY ); + css::system::SystemShellExecute::create(xContext) ); + xSystemShell->execute( sURL, ::rtl::OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY ); } catch( const uno::Exception& e ) { |