From d26f3acf2874f64fd89c8197163651443d4b1733 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 17 Oct 2012 13:54:31 +0200 Subject: fdo#46808, use service constructor for system::SystemShellExecute --- extensions/source/update/check/updatecheck.cxx | 35 +++++++++++--------------- 1 file changed, 15 insertions(+), 20 deletions(-) (limited to 'extensions') diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx index c6fb071fd1ed..fcd2d8221ad0 100644 --- a/extensions/source/update/check/updatecheck.cxx +++ b/extensions/source/update/check/updatecheck.cxx @@ -913,9 +913,7 @@ UpdateCheck::install() { osl::MutexGuard aGuard(m_aMutex); - const uno::Reference< c3s::XSystemShellExecute > xShellExecute( - createService( UNISTRING( "com.sun.star.system.SystemShellExecute" ), m_xContext ), - uno::UNO_QUERY ); + const uno::Reference< c3s::XSystemShellExecute > xShellExecute = c3s::SystemShellExecute::create( m_xContext ); try { // Construct install command ?? @@ -927,29 +925,26 @@ UpdateCheck::install() aURL = getReleaseNote(m_aUpdateInfo, 4); storeReleaseNote(2, aURL); - if( xShellExecute.is() ) - { - rtl::OUString aInstallImage(m_aImageName); - osl::FileBase::getSystemPathFromFileURL(aInstallImage, aInstallImage); + rtl::OUString aInstallImage(m_aImageName); + osl::FileBase::getSystemPathFromFileURL(aInstallImage, aInstallImage); - rtl::OUString aParameter; - sal_Int32 nFlags = c3s::SystemShellExecuteFlags::DEFAULTS; + rtl::OUString aParameter; + sal_Int32 nFlags = c3s::SystemShellExecuteFlags::DEFAULTS; #if ( defined LINUX || defined SOLARIS ) - nFlags = 42; - aParameter = getBaseInstallation(); - if( !aParameter.isEmpty() ) - osl::FileBase::getSystemPathFromFileURL(aParameter, aParameter); + nFlags = 42; + aParameter = getBaseInstallation(); + if( !aParameter.isEmpty() ) + osl::FileBase::getSystemPathFromFileURL(aParameter, aParameter); - aParameter += UNISTRING(" &"); + aParameter += UNISTRING(" &"); #endif - rtl::Reference< UpdateCheckConfig > rModel = UpdateCheckConfig::get( m_xContext ); - rModel->clearLocalFileName(); + rtl::Reference< UpdateCheckConfig > rModel = UpdateCheckConfig::get( m_xContext ); + rModel->clearLocalFileName(); - xShellExecute->execute(aInstallImage, aParameter, nFlags); - ShutdownThread *pShutdownThread = new ShutdownThread( m_xContext ); - (void) pShutdownThread; - } + xShellExecute->execute(aInstallImage, aParameter, nFlags); + ShutdownThread *pShutdownThread = new ShutdownThread( m_xContext ); + (void) pShutdownThread; } catch(const uno::Exception&) { m_aUpdateHandler->setErrorMessage( m_aUpdateHandler->getDefaultInstErrMsg() ); } -- cgit