diff options
author | Ariel Constenla-Haile <arielch@apache.org> | 2013-01-04 18:58:16 +0000 |
---|---|---|
committer | Ariel Constenla-Haile <arielch@apache.org> | 2013-01-04 18:58:16 +0000 |
commit | be44a7a90ab5428ccdc924684dad463b36a8be48 (patch) | |
tree | 3e698350e79d4ea9252649f224d43c8177c01ad3 | |
parent | ace4202dfa5f352ec24841c90c7affddd1cbb21c (diff) |
i121578 - Convert css.system.SystemShellExectue to new-style
Adapt the office code to use the new-style service constructor
Notes
Notes:
prefer: d26f3acf2874f64fd89c8197163651443d4b1733
25 files changed, 78 insertions, 114 deletions
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx index 71bec7a8cd75..b76deb2633cb 100644 --- a/cui/source/dialogs/about.cxx +++ b/cui/source/dialogs/about.cxx @@ -46,7 +46,7 @@ #include <vcl/tabpage.hxx> #include <com/sun/star/system/SystemShellExecuteFlags.hpp> -#include <com/sun/star/system/XSystemShellExecute.hpp> +#include <com/sun/star/system/SystemShellExecute.hpp> #include <com/sun/star/uno/Any.h> #include "about.hxx" @@ -532,13 +532,9 @@ IMPL_LINK ( AboutDialog, OpenLinkHdl_Impl, svt::FixedHyperlink*, EMPTYARG ) { try { - uno::Reference< uno::XComponentContext > xContext = - ::comphelper::getProcessComponentContext(); uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShell( - xContext->getServiceManager()->createInstanceWithContext( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ), - xContext ), - uno::UNO_QUERY_THROW ); + com::sun::star::system::SystemShellExecute::create( + ::comphelper::getProcessComponentContext() ) ); if ( xSystemShell.is() ) xSystemShell->execute( sURL, rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS ); } diff --git a/cui/source/options/optimprove.cxx b/cui/source/options/optimprove.cxx index 54e06bab95d7..9b00c88e8ef1 100644 --- a/cui/source/options/optimprove.cxx +++ b/cui/source/options/optimprove.cxx @@ -38,7 +38,7 @@ #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/lang/XMultiServiceFactory.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/oooimprovement/XCoreController.hpp> #include <comphelper/configurationhelper.hxx> @@ -142,12 +142,9 @@ IMPL_LINK( SvxImprovementDialog, HandleHyperlink, svt::FixedHyperlinkImage*, pHy { try { - uno::Reference< lang::XMultiServiceFactory > xSMGR = - ::comphelper::getProcessServiceFactory(); uno::Reference< XSystemShellExecute > xSystemShell( - xSMGR->createInstance( ::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ), - uno::UNO_QUERY_THROW ); + com::sun::star::system::SystemShellExecute::create( + ::comphelper::getProcessComponentContext() ) ); if ( xSystemShell.is() ) { xSystemShell->execute( diff --git a/cui/source/options/optimprove2.cxx b/cui/source/options/optimprove2.cxx index 5bf1c31bae6e..292d4591cdbb 100644 --- a/cui/source/options/optimprove2.cxx +++ b/cui/source/options/optimprove2.cxx @@ -40,7 +40,7 @@ #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/oooimprovement/XCore.hpp> #include <com/sun/star/oooimprovement/XCoreController.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/util/XStringSubstitution.hpp> #include <comphelper/configurationhelper.hxx> @@ -111,12 +111,9 @@ IMPL_LINK( SvxImprovementOptionsPage, HandleHyperlink, svt::FixedHyperlinkImage* { try { - uno::Reference< lang::XMultiServiceFactory > xSMGR = - ::comphelper::getProcessServiceFactory(); uno::Reference< XSystemShellExecute > xSystemShell( - xSMGR->createInstance( ::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ), - uno::UNO_QUERY_THROW ); + com::sun::star::system::SystemShellExecute::create( + ::comphelper::getProcessComponentContext() ) ); if ( xSystemShell.is() ) { xSystemShell->execute( diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 6af076f238cb..180aa80e736c 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -54,7 +54,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,12 +148,9 @@ static void lcl_OpenURL( const ::rtl::OUString& rURL ) { try { - uno::Reference< lang::XMultiServiceFactory > xSMGR = - ::comphelper::getProcessServiceFactory(); uno::Reference< css::system::XSystemShellExecute > xSystemShell( - xSMGR->createInstance( ::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ), - uno::UNO_QUERY_THROW ); + css::system::SystemShellExecute::create( + ::comphelper::getProcessComponentContext() ) ); if ( xSystemShell.is() ) xSystemShell->execute( rURL, ::rtl::OUString(), css::system::SystemShellExecuteFlags::DEFAULTS ); } diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 9420a03bc50f..639b8473159c 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -53,7 +53,6 @@ #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/util/XModifiable.hpp> #include <com/sun/star/util/XFlushable.hpp> -#include <com/sun/star/system/XSystemShellExecute.hpp> #include <com/sun/star/system/SystemShellExecuteFlags.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/lang/XComponent.hpp> diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index bbf573b79558..912a58829e6c 100755 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -65,7 +65,7 @@ #include "com/sun/star/i18n/CollatorOptions.hpp" #include "com/sun/star/system/SystemShellExecuteFlags.hpp" -#include "com/sun/star/system/XSystemShellExecute.hpp" +#include "com/sun/star/system/SystemShellExecute.hpp" #include "com/sun/star/ui/dialogs/ExecutableDialogResults.hpp" #include "com/sun/star/ui/dialogs/TemplateDescription.hpp" @@ -626,7 +626,7 @@ void DialogHelper::openWebBrowser( const OUString & sURL, const OUString &sTitle try { uno::Reference< XSystemShellExecute > xSystemShellExecute( - m_xContext->getServiceManager()->createInstanceWithContext( OUSTR( "com.sun.star.system.SystemShellExecute" ), m_xContext), uno::UNO_QUERY_THROW); + com::sun::star::system::SystemShellExecute::create( m_xContext ) ); //throws css::lang::IllegalArgumentException, css::system::SystemShellExecuteException xSystemShellExecute->execute( sURL, OUString(), SystemShellExecuteFlags::DEFAULTS ); } diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx index ded61b866c19..ae2ccedf3767 100755 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx @@ -61,7 +61,7 @@ #include "com/sun/star/lang/XMultiComponentFactory.hpp" #include "com/sun/star/lang/XSingleServiceFactory.hpp" #include "com/sun/star/system/SystemShellExecuteFlags.hpp" -#include "com/sun/star/system/XSystemShellExecute.hpp" +#include "com/sun/star/system/SystemShellExecute.hpp" #include "com/sun/star/task/XAbortChannel.hpp" #include "com/sun/star/task/XJob.hpp" #include "com/sun/star/ucb/CommandAbortedException.hpp" @@ -1475,10 +1475,7 @@ IMPL_LINK( UpdateDialog, hyperlink_clicked, svt::FixedHyperlink*, pHyperlink ) try { uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute( - m_context->getServiceManager()->createInstanceWithContext( - OUSTR( "com.sun.star.system.SystemShellExecute" ), - m_context), uno::UNO_QUERY_THROW); - //throws lang::IllegalArgumentException, system::SystemShellExecuteException + com::sun::star::system::SystemShellExecute::create( m_context ) ); xSystemShellExecute->execute( sURL, ::rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS); } diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx index e3aace201e9c..cf6b01ca98b0 100644 --- a/embeddedobj/source/msole/oleembed.cxx +++ b/embeddedobj/source/msole/oleembed.cxx @@ -45,14 +45,14 @@ #include <com/sun/star/ucb/XSimpleFileAccess.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XNameContainer.hpp> -#include <com/sun/star/system/XSystemShellExecute.hpp> +#include <com/sun/star/system/SystemShellExecute.hpp> #include <com/sun/star/system/SystemShellExecuteFlags.hpp> #include <rtl/logfile.hxx> #include <cppuhelper/interfacecontainer.h> #include <comphelper/mimeconfighelper.hxx> #include <comphelper/storagehelper.hxx> - +#include <comphelper/processfactory.hxx> #include <targetstatecontrol.hxx> @@ -878,9 +878,9 @@ void SAL_CALL OleEmbeddedObject::doVerb( sal_Int32 nVerbID ) if (m_aTempDumpURL.getLength()) { - uno::Reference< ::com::sun::star::system::XSystemShellExecute > xSystemShellExecute( m_xFactory->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.system.SystemShellExecute"))), - uno::UNO_QUERY_THROW); + uno::Reference< ::com::sun::star::system::XSystemShellExecute > xSystemShellExecute( + ::com::sun::star::system::SystemShellExecute::create( + ::comphelper::getProcessComponentContext() ) ); xSystemShellExecute->execute(m_aTempDumpURL, ::rtl::OUString(), ::com::sun::star::system::SystemShellExecuteFlags::DEFAULTS); } else diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx index b9d2f688c23a..58f180dc50c1 100644 --- a/extensions/source/update/check/updatecheck.cxx +++ b/extensions/source/update/check/updatecheck.cxx @@ -33,7 +33,7 @@ #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/frame/DispatchResultEvent.hpp> #include <com/sun/star/frame/DispatchResultState.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/task/XJob.hpp> #include <com/sun/star/task/XJobExecutor.hpp> @@ -932,8 +932,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 ); + c3s::SystemShellExecute::create( m_xContext ) ); try { // Construct install command ?? diff --git a/framework/inc/dispatch/mailtodispatcher.hxx b/framework/inc/dispatch/mailtodispatcher.hxx index ed959769e63d..0f0466ae83fb 100644 --- a/framework/inc/dispatch/mailtodispatcher.hxx +++ b/framework/inc/dispatch/mailtodispatcher.hxx @@ -93,15 +93,13 @@ class MailToDispatcher : // interfaces { /* member */ private: - - /// reference to global uno service manager which had created us - css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory; + css::uno::Reference< css::uno::XComponentContext > m_xContext; /* interface */ public: // ctor/dtor - MailToDispatcher( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); + MailToDispatcher( const css::uno::Reference< css::uno::XComponentContext >& xContext ); virtual ~MailToDispatcher( ); // XInterface, XTypeProvider, XServiceInfo diff --git a/framework/inc/dispatch/systemexec.hxx b/framework/inc/dispatch/systemexec.hxx index 7b18bb715205..8b8b201aa3a5 100644 --- a/framework/inc/dispatch/systemexec.hxx +++ b/framework/inc/dispatch/systemexec.hxx @@ -93,15 +93,13 @@ class SystemExec : // interfaces { /* member */ private: - - /// reference to global uno service manager which had created us - css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory; + css::uno::Reference< css::uno::XComponentContext > m_xContext; /* interface */ public: // ctor/dtor - SystemExec( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); + SystemExec( const css::uno::Reference< css::uno::XComponentContext >& xContext ); virtual ~SystemExec( ); // XInterface, XTypeProvider, XServiceInfo diff --git a/framework/inc/pch/precompiled_framework.hxx b/framework/inc/pch/precompiled_framework.hxx index f19a6de2419d..644cd2751978 100644 --- a/framework/inc/pch/precompiled_framework.hxx +++ b/framework/inc/pch/precompiled_framework.hxx @@ -222,7 +222,7 @@ #include "com/sun/star/style/XStyleFamiliesSupplier.hpp" #include "com/sun/star/sync2/BadPartnershipException.hpp" #include "com/sun/star/system/SystemShellExecuteFlags.hpp" -#include "com/sun/star/system/XSystemShellExecute.hpp" +#include "com/sun/star/system/SystemShellExecute.hpp" #include "com/sun/star/task/ErrorCodeRequest.hpp" #include "com/sun/star/task/XAsyncJob.hpp" #include "com/sun/star/task/XInteractionAbort.hpp" diff --git a/framework/inc/services.h b/framework/inc/services.h index 667a40ac7876..217edb738cb2 100644 --- a/framework/inc/services.h +++ b/framework/inc/services.h @@ -72,7 +72,6 @@ namespace framework{ #define SERVICENAME_JOB DECLARE_ASCII("com.sun.star.task.Job" ) #define SERVICENAME_DISPATCHRECORDERSUPPLIER DECLARE_ASCII("com.sun.star.frame.DispatchRecorderSupplier" ) #define SERVICENAME_DISPATCHRECORDER DECLARE_ASCII("com.sun.star.frame.DispatchRecorder" ) -#define SERVICENAME_SYSTEMSHELLEXECUTE DECLARE_ASCII("com.sun.star.system.SystemShellExecute" ) #define SERVICENAME_PROTOCOLHANDLER DECLARE_ASCII("com.sun.star.frame.ProtocolHandler" ) #define SERVICENAME_SUBSTITUTEPATHVARIABLES DECLARE_ASCII("com.sun.star.util.PathSubstitution" ) #define SERVICENAME_PATHSETTINGS DECLARE_ASCII("com.sun.star.util.PathSettings" ) diff --git a/framework/source/dispatch/mailtodispatcher.cxx b/framework/source/dispatch/mailtodispatcher.cxx index c4c93d1d1f2d..e7b03f0f8ba0 100644 --- a/framework/source/dispatch/mailtodispatcher.cxx +++ b/framework/source/dispatch/mailtodispatcher.cxx @@ -35,7 +35,7 @@ //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ -#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/frame/DispatchResultState.hpp> @@ -84,10 +84,10 @@ DEFINE_XTYPEPROVIDER_5(MailToDispatcher , css::frame::XNotifyingDispatch, css::frame::XDispatch ) -DEFINE_XSERVICEINFO_MULTISERVICE(MailToDispatcher , - ::cppu::OWeakObject , - SERVICENAME_PROTOCOLHANDLER , - IMPLEMENTATIONNAME_MAILTODISPATCHER) +DEFINE_XSERVICEINFO_MULTISERVICE_2(MailToDispatcher , + ::cppu::OWeakObject , + SERVICENAME_PROTOCOLHANDLER , + IMPLEMENTATIONNAME_MAILTODISPATCHER) DEFINE_INIT_SERVICE(MailToDispatcher, { @@ -105,17 +105,17 @@ DEFINE_INIT_SERVICE(MailToDispatcher, @short standard ctor @descr These initialize a new instance of ths class with needed informations for work. - @param xFactory - reference to uno servicemanager for creation of new services + @param xContext + reference to uno component context @modified 30.04.2002 14:10, as96863 */ -MailToDispatcher::MailToDispatcher( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ) +MailToDispatcher::MailToDispatcher( const css::uno::Reference< css::uno::XComponentContext >& xContext ) // Init baseclasses first : ThreadHelpBase( &Application::GetSolarMutex() ) , OWeakObject ( ) // Init member - , m_xFactory ( xFactory ) + , m_xContext ( xContext ) { } @@ -129,7 +129,7 @@ MailToDispatcher::MailToDispatcher( const css::uno::Reference< css::lang::XMulti */ MailToDispatcher::~MailToDispatcher() { - m_xFactory = NULL; + m_xContext = NULL; } //_________________________________________________________________________________________________________________ @@ -266,13 +266,14 @@ sal_Bool MailToDispatcher::implts_dispatch( const css::util::URL& { sal_Bool bSuccess = sal_False; - css::uno::Reference< css::lang::XMultiServiceFactory > xFactory; + css::uno::Reference< css::uno::XComponentContext > xContext; /* SAFE */{ ReadGuard aReadLock( m_aLock ); - xFactory = m_xFactory; + xContext = m_xContext; /* SAFE */} - css::uno::Reference< css::system::XSystemShellExecute > xSystemShellExecute( xFactory->createInstance(SERVICENAME_SYSTEMSHELLEXECUTE), css::uno::UNO_QUERY ); + css::uno::Reference< css::system::XSystemShellExecute > xSystemShellExecute( + css::system::SystemShellExecute::create( xContext ) ); if (xSystemShellExecute.is()) { try diff --git a/framework/source/dispatch/systemexec.cxx b/framework/source/dispatch/systemexec.cxx index 771096f35066..29bef8e6fab7 100644 --- a/framework/source/dispatch/systemexec.cxx +++ b/framework/source/dispatch/systemexec.cxx @@ -35,7 +35,7 @@ //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ -#include <com/sun/star/system/XSystemShellExecute.hpp> +#include <com/sun/star/system/SystemShellExecute.hpp> #include <com/sun/star/util/XStringSubstitution.hpp> #include <com/sun/star/system/SystemShellExecuteFlags.hpp> #include <com/sun/star/frame/DispatchResultState.hpp> @@ -85,10 +85,10 @@ DEFINE_XTYPEPROVIDER_5(SystemExec , css::frame::XNotifyingDispatch, css::frame::XDispatch ) -DEFINE_XSERVICEINFO_MULTISERVICE(SystemExec , - ::cppu::OWeakObject , - SERVICENAME_PROTOCOLHANDLER , - IMPLEMENTATIONNAME_SYSTEMEXEC) +DEFINE_XSERVICEINFO_MULTISERVICE_2(SystemExec , + ::cppu::OWeakObject , + SERVICENAME_PROTOCOLHANDLER , + IMPLEMENTATIONNAME_SYSTEMEXEC) DEFINE_INIT_SERVICE(SystemExec, { @@ -102,12 +102,12 @@ DEFINE_INIT_SERVICE(SystemExec, //_________________________________________________________________________________________________________________ -SystemExec::SystemExec( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ) +SystemExec::SystemExec( const css::uno::Reference< css::uno::XComponentContext >& xContext ) // Init baseclasses first : ThreadHelpBase( &Application::GetSolarMutex() ) , OWeakObject ( ) // Init member - , m_xFactory ( xFactory ) + , m_xContext ( xContext ) { } @@ -115,7 +115,7 @@ SystemExec::SystemExec( const css::uno::Reference< css::lang::XMultiServiceFacto SystemExec::~SystemExec() { - m_xFactory = NULL; + m_xContext = NULL; } //_________________________________________________________________________________________________________________ @@ -171,7 +171,7 @@ void SAL_CALL SystemExec::dispatchWithNotification( const css::util::URL& // SAFE -> ReadGuard aReadLock(m_aLock); - css::uno::Reference< css::lang::XMultiServiceFactory > xFactory = m_xFactory; + css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE @@ -180,14 +180,14 @@ void SAL_CALL SystemExec::dispatchWithNotification( const css::util::URL& try { css::uno::Reference< css::util::XStringSubstitution > xPathSubst( - xFactory->createInstance(SERVICENAME_SUBSTITUTEPATHVARIABLES), + xContext->getServiceManager()->createInstanceWithContext( + SERVICENAME_SUBSTITUTEPATHVARIABLES, xContext), css::uno::UNO_QUERY_THROW); ::rtl::OUString sSystemURL = xPathSubst->substituteVariables(sSystemURLWithVariables, sal_True); // sal_True force an exception if unknown variables exists ! css::uno::Reference< css::system::XSystemShellExecute > xShell( - xFactory->createInstance(SERVICENAME_SYSTEMSHELLEXECUTE), - css::uno::UNO_QUERY_THROW); + css::system::SystemShellExecute::create(xContext)); xShell->execute(sSystemURL, ::rtl::OUString(), css::system::SystemShellExecuteFlags::DEFAULTS); impl_notifyResultListener(xListener, css::frame::DispatchResultState::SUCCESS); diff --git a/framework/source/jobs/shelljob.cxx b/framework/source/jobs/shelljob.cxx index 38e911e45b91..fdbe5850004b 100644 --- a/framework/source/jobs/shelljob.cxx +++ b/framework/source/jobs/shelljob.cxx @@ -44,8 +44,6 @@ //_______________________________________________ // include interfaces -#include <com/sun/star/system/XSystemShellExecute.hpp> -#include <com/sun/star/system/SystemShellExecuteFlags.hpp> #include <com/sun/star/util/XStringSubstitution.hpp> //_______________________________________________ diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index 26cabace0105..b93e9d19afea 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -54,7 +54,7 @@ #include "com/sun/star/lang/XMultiServiceFactory.hpp" #include "com/sun/star/container/XNameAccess.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/task/XJobExecutor.hpp" #include "com/sun/star/util/XStringWidth.hpp" @@ -971,9 +971,8 @@ IMPL_LINK( BackingWindow, ToolboxHdl, void*, EMPTYARG ) sURL = aURLObj.GetMainURL( INetURLObject::NO_DECODE ); Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ), - UNO_QUERY_THROW); + com::sun::star::system::SystemShellExecute::create( + ::comphelper::getProcessComponentContext() ) ); //throws css::lang::IllegalArgumentException, css::system::SystemShellExecuteException xSystemShellExecute->execute( sURL, rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS); } diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 883e4f42b4ea..7fbb21ecd4aa 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -36,7 +36,7 @@ #include <com/sun/star/frame/XDispatchResultListener.hpp> #include <com/sun/star/util/URL.hpp> #include <com/sun/star/util/XURLTransformer.hpp> -#include <com/sun/star/system/XSystemShellExecute.hpp> +#include <com/sun/star/system/SystemShellExecute.hpp> #include <com/sun/star/document/XTypeDetection.hpp> #include <com/sun/star/system/SystemShellExecuteFlags.hpp> #include <com/sun/star/document/MacroExecMode.hpp> @@ -988,8 +988,9 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) if ( !pFilter || !( pFilter->IsOwnFormat() )) { // hyperlink does not link to own type => special handling (http, ftp) browser and (other external protocols) OS - Reference< XSystemShellExecute > xSystemShellExecute( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.system.SystemShellExecute" )), UNO_QUERY ); + Reference< XSystemShellExecute > xSystemShellExecute( + com::sun::star::system::SystemShellExecute::create( + ::comphelper::getProcessComponentContext() ) ); if ( xSystemShellExecute.is() ) { if ( aINetProtocol == INET_PROT_MAILTO ) diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 25bf48be24cb..88367a7c745d 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -39,7 +39,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> @@ -851,11 +851,9 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) { try { - uno::Reference< lang::XMultiServiceFactory > xSMGR = - ::comphelper::getProcessServiceFactory(); uno::Reference< css::system::XSystemShellExecute > xSystemShell( - xSMGR->createInstance( DEFINE_CONST_UNICODE("com.sun.star.system.SystemShellExecute" ) ), - uno::UNO_QUERY_THROW ); + css::system::SystemShellExecute::create( + ::comphelper::getProcessComponentContext() ) ); // read repository URL from configuration ::rtl::OUString sTemplRepoURL = diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index f432eb39cbb7..2009b0c7d0da 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -36,7 +36,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/embed/EmbedStates.hpp> #include <com/sun/star/embed/EmbedMisc.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/container/XContainerQuery.hpp> #include <com/sun/star/frame/XStorable.hpp> @@ -709,9 +709,9 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) return; } - ::com::sun::star::uno::Reference< XSystemShellExecute > xSystemShellExecute( xSMGR->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.system.SystemShellExecute" )), - css::uno::UNO_QUERY ); + ::com::sun::star::uno::Reference< XSystemShellExecute > xSystemShellExecute( + com::sun::star::system::SystemShellExecute::create( + ::comphelper::getProcessComponentContext() ) ); sal_Bool bRet( sal_True ); if ( xSystemShellExecute.is() ) diff --git a/shell/source/win32/workbench/TestSysShExec.cxx b/shell/source/win32/workbench/TestSysShExec.cxx index 1eb9887ba79a..64e69821f813 100644 --- a/shell/source/win32/workbench/TestSysShExec.cxx +++ b/shell/source/win32/workbench/TestSysShExec.cxx @@ -30,10 +30,7 @@ //----------------------------------------------------------- #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/registry/XSimpleRegistry.hpp> - -#ifndef _COM_SUN_STAR_SYS_SHELL_XSYSTEMSHELLEXECUTE_HPP_ #include <com/sun/star/system/XSystemShellExecute.hpp> -#endif #include <cppuhelper/servicefactory.hxx> diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx index eb759563993d..e9b066e251fa 100644 --- a/svtools/source/contnr/templwin.cxx +++ b/svtools/source/contnr/templwin.cxx @@ -65,7 +65,7 @@ #include <com/sun/star/io/IOException.hpp> #include <com/sun/star/util/DateTime.hpp> #include <com/sun/star/script/XTypeConverter.hpp> -#include <com/sun/star/system/XSystemShellExecute.hpp> +#include <com/sun/star/system/SystemShellExecute.hpp> #include <com/sun/star/system/SystemShellExecuteFlags.hpp> #include <unotools/localedatawrapper.hxx> #include <com/sun/star/container/XNameContainer.hpp> @@ -1985,12 +1985,9 @@ IMPL_LINK ( SvtDocumentTemplateDialog, OpenLinkHdl_Impl, svt::FixedHyperlink*, E { try { - uno::Reference< lang::XMultiServiceFactory > xSMGR = - ::comphelper::getProcessServiceFactory(); uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShell( - xSMGR->createInstance( ::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ), - uno::UNO_QUERY_THROW ); + com::sun::star::system::SystemShellExecute::create( + ::comphelper::getProcessComponentContext() ) ); if ( xSystemShell.is() ) xSystemShell->execute( sURL, ::rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS ); EndDialog( RET_CANCEL ); diff --git a/swext/mediawiki/src/com/sun/star/wiki/Helper.java b/swext/mediawiki/src/com/sun/star/wiki/Helper.java index b8fcc3f7bb03..2aeaa44238e6 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/Helper.java +++ b/swext/mediawiki/src/com/sun/star/wiki/Helper.java @@ -702,8 +702,7 @@ public class Helper { try { - Object oSystemShell = xContext.getServiceManager().createInstanceWithContext( "com.sun.star.system.SystemShellExecute", xContext ); - XSystemShellExecute xSystemShell = (XSystemShellExecute)UnoRuntime.queryInterface( XSystemShellExecute.class, oSystemShell ); + XSystemShellExecute xSystemShell = com.sun.star.system.SystemShellExecute.create( xContext ); if ( xSystemShell != null ) xSystemShell.execute( sURL, "", SystemShellExecuteFlags.DEFAULTS ); } diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 60d01735ac8a..7066eac2d57e 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -37,7 +37,7 @@ #include <cppuhelper/typeprovider.hxx> #include <com/sun/star/awt/VisualEffect.hpp> #include <com/sun/star/lang/XMultiServiceFactory.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/resource/XStringResourceResolver.hpp> #include <com/sun/star/awt/ImageScaleMode.hpp> @@ -2626,8 +2626,8 @@ void VCLXFixedHyperlink::ProcessWindowEvent( const VclWindowEvent& rVclWindowEve if ( pBase ) sURL = pBase->GetURL(); Reference< ::com::sun::star::system::XSystemShellExecute > xSystemShellExecute( - ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.system.SystemShellExecute" )), uno::UNO_QUERY ); + ::com::sun::star::system::SystemShellExecute::create( + ::comphelper::getProcessComponentContext() ) ); if ( sURL.getLength() > 0 && xSystemShellExecute.is() ) { try diff --git a/uui/source/newerverwarn.cxx b/uui/source/newerverwarn.cxx index e243223a8bca..19508eb5fd68 100644 --- a/uui/source/newerverwarn.cxx +++ b/uui/source/newerverwarn.cxx @@ -27,7 +27,7 @@ #include <com/sun/star/frame/XDesktop.hpp> #include <com/sun/star/frame/XDispatchProvider.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/util/XURLTransformer.hpp> #include <com/sun/star/container/XNameReplace.hpp> @@ -98,12 +98,9 @@ IMPL_LINK( NewerVersionWarningDialog, UpdateHdl, PushButton*, EMPTYARG ) { if ( ( sNotifyURL.getLength() > 0 ) && ( m_sVersion.getLength() > 0 ) ) { - uno::Reference< lang::XMultiServiceFactory > xSMGR = - ::comphelper::getProcessServiceFactory(); uno::Reference< XSystemShellExecute > xSystemShell( - xSMGR->createInstance( ::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ), - uno::UNO_QUERY_THROW ); + com::sun::star::system::SystemShellExecute::create( + ::comphelper::getProcessComponentContext() ) ); sNotifyURL += m_sVersion; if ( xSystemShell.is() && sNotifyURL.getLength() ) { |