summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-08-29 07:45:05 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-03 15:55:05 +0200
commitbc00717bb7a2b48885ca356fb0a966acbe72dca9 (patch)
tree3eacf7bb54893d7380789d1a2e9ffbb759da16ba /sfx2
parent7dd6c0a8372810f48e6bee35a11ac4ad0432640b (diff)
fdo#46808, Adapt system::SystemShellExecute UNO service to new style
Change-Id: Ib298b3219c3e89dd35bce0974846ed4888ed941e
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/appserv.cxx14
-rw-r--r--sfx2/source/appl/openuriexternally.cxx8
-rw-r--r--sfx2/source/appl/sfxhelp.cxx13
3 files changed, 13 insertions, 22 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index f28418384d2b..c251d9797da0 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -33,7 +33,7 @@
#include <com/sun/star/document/XEmbeddedScripts.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
-#include <com/sun/star/system/XSystemShellExecute.hpp>
+#include <com/sun/star/system/SystemShellExecute.hpp>
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/system/SystemShellExecuteException.hpp>
@@ -426,10 +426,9 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
::rtl::OUString sURL("http://hub.libreoffice.org/file-a-bug/");
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& )
{
@@ -1039,9 +1038,10 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
{
uno::Reference< lang::XMultiServiceFactory > xSMGR =
::comphelper::getProcessServiceFactory();
+ uno::Reference< uno::XComponentContext > xContext =
+ ::comphelper::getProcessComponentContext();
uno::Reference< css::system::XSystemShellExecute > xSystemShell(
- xSMGR->createInstance( DEFINE_CONST_UNICODE("com.sun.star.system.SystemShellExecute" ) ),
- uno::UNO_QUERY_THROW );
+ css::system::SystemShellExecute::create(xContext) );
// read repository URL from configuration
::rtl::OUString sTemplRepoURL =
diff --git a/sfx2/source/appl/openuriexternally.cxx b/sfx2/source/appl/openuriexternally.cxx
index 381946987844..b704b38cb649 100644
--- a/sfx2/source/appl/openuriexternally.cxx
+++ b/sfx2/source/appl/openuriexternally.cxx
@@ -30,7 +30,7 @@
#include "sal/config.h"
#include "com/sun/star/lang/IllegalArgumentException.hpp"
-#include "com/sun/star/system/XSystemShellExecute.hpp"
+#include "com/sun/star/system/SystemShellExecute.hpp"
#include "com/sun/star/system/SystemShellExecuteException.hpp"
#include "com/sun/star/system/SystemShellExecuteFlags.hpp"
#include "com/sun/star/uno/Reference.hxx"
@@ -59,11 +59,7 @@ bool sfx2::openUriExternally(
rtl::OUString const & uri, bool handleSystemShellExecuteException)
{
css::uno::Reference< css::system::XSystemShellExecute > exec(
- comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.system.SystemShellExecute"))),
- css::uno::UNO_QUERY_THROW);
+ css::system::SystemShellExecute::create(comphelper::getProcessComponentContext()));
try {
exec->execute(
uri, rtl::OUString(),
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index eb6f06cef991..8f728c55349e 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -39,7 +39,7 @@
#include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <toolkit/helper/vclunohelper.hxx>
#include <com/sun/star/frame/XModuleManager.hpp>
-#include <com/sun/star/system/XSystemShellExecute.hpp>
+#include <com/sun/star/system/SystemShellExecute.hpp>
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <unotools/configmgr.hxx>
#include <unotools/configitem.hxx>
@@ -670,15 +670,10 @@ static bool impl_showOnlineHelp( const String& rURL )
try
{
Reference< XSystemShellExecute > xSystemShell(
- ::comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( "com.sun.star.system.SystemShellExecute" ) ),
- UNO_QUERY );
+ SystemShellExecute::create(::comphelper::getProcessComponentContext()) );
- if ( xSystemShell.is() )
- {
- xSystemShell->execute( aHelpLink, rtl::OUString(), SystemShellExecuteFlags::URIS_ONLY );
- return true;
- }
+ xSystemShell->execute( aHelpLink, rtl::OUString(), SystemShellExecuteFlags::URIS_ONLY );
+ return true;
}
catch (const Exception&)
{