diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-03-27 13:56:12 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-04-03 13:49:36 +0100 |
commit | 4f1f9c6e6e6b07515bb601d7acbdb4705e266366 (patch) | |
tree | 71fd6df4ea2b04b1a7dc94592e3f2d501d4533d5 /sfx2 | |
parent | 05fde8006966df49221871fe3489aba8c2ca8e3f (diff) |
Introduced SystemShellExecuteFlags::URIS_ONLY
(cherry-picked from commit d4b67611c421ebe9b75284106fe389b434419961)
Conflicts:
extensions/source/update/check/updatecheck.cxx
filter/source/xsltdialog/xmlfiltertestdialog.cxx
sfx2/source/view/viewsh.cxx
shell/source/unix/exec/shellexec.cxx
Replaced master's new MSG_ERR_NO_ABS_URI_REF with re-using
RID_SECURITY_WARNING_NO_HYPERLINKS, to avoid introducing new resources
into the LO 3.5 series that require localization.
New css.system.SystemShellExecuteFlags.URIS_ONLY remains @since
LibreOffice 3.6. Officially, new features are only added when bumping
the minor revision number, not the micro one (but backporting does not
hurt here).
Signed-off-by: Michael Meeks <michael.meeks@suse.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/Library_sfx.mk | 1 | ||||
-rw-r--r-- | sfx2/source/appl/appopen.cxx | 195 | ||||
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/openuriexternally.cxx | 99 | ||||
-rw-r--r-- | sfx2/source/appl/sfxhelp.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/inc/openuriexternally.hxx | 57 | ||||
-rwxr-xr-x | sfx2/source/view/view.hrc | 2 | ||||
-rw-r--r-- | sfx2/source/view/view.src | 18 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 29 |
9 files changed, 241 insertions, 166 deletions
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk index b8f5d3724a19..2b636daae243 100644 --- a/sfx2/Library_sfx.mk +++ b/sfx2/Library_sfx.mk @@ -116,6 +116,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\ sfx2/source/appl/module \ sfx2/source/appl/newhelp \ sfx2/source/appl/opengrf \ + sfx2/source/appl/openuriexternally \ sfx2/source/appl/sfxhelp \ sfx2/source/appl/sfxpicklist \ sfx2/source/appl/shutdownicon \ diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 54b9b26e526a..257668a90e58 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -39,9 +39,8 @@ #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/SystemShellExecuteException.hpp> #include <com/sun/star/document/XTypeDetection.hpp> -#include <com/sun/star/system/SystemShellExecuteFlags.hpp> #include <com/sun/star/document/MacroExecMode.hpp> #include <com/sun/star/document/UpdateDocMode.hpp> #include <com/sun/star/task/ErrorCodeRequest.hpp> @@ -110,6 +109,7 @@ #define _SVSTDARR_STRINGSDTOR #include <svl/svstdarr.hxx> +#include "openuriexternally.hxx" using namespace ::com::sun::star; using namespace ::com::sun::star::beans; @@ -117,7 +117,6 @@ using namespace ::com::sun::star::frame; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; -using namespace ::com::sun::star::system; using namespace ::com::sun::star::task; using namespace ::com::sun::star::container; using namespace ::cppu; @@ -961,140 +960,100 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) if (!pFilter || !lcl_isFilterNativelySupported(*pFilter)) { // 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(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.system.SystemShellExecute"))), UNO_QUERY ); - if ( xSystemShellExecute.is() ) + if ( aINetProtocol == INET_PROT_MAILTO ) { - if ( aINetProtocol == INET_PROT_MAILTO ) - { - // don't dispatch mailto hyperlink to desktop dispatcher - rReq.RemoveItem( SID_TARGETNAME ); - rReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii("_self") ) ); - } - else if ( aINetProtocol == INET_PROT_FTP || - aINetProtocol == INET_PROT_HTTP || - aINetProtocol == INET_PROT_HTTPS ) - { - try - { - // start browser - ::rtl::OUString aURLString( aURL.Complete ); - xSystemShellExecute->execute( aURLString, ::rtl::OUString(), SystemShellExecuteFlags::DEFAULTS ); - } - catch ( ::com::sun::star::lang::IllegalArgumentException& ) - { - SolarMutexGuard aGuard; - Window *pWindow = SFX_APP()->GetTopWindow(); - ErrorBox( pWindow, SfxResId( MSG_ERR_NO_WEBBROWSER_FOUND )).Execute(); - } - catch ( ::com::sun::star::system::SystemShellExecuteException& ) - { - SolarMutexGuard aGuard; - Window *pWindow = SFX_APP()->GetTopWindow(); - ErrorBox( pWindow, SfxResId( MSG_ERR_NO_WEBBROWSER_FOUND )).Execute(); - } - - return; - } - else - { - // check for "internal" protocols that should not be forwarded to the system - Sequence < ::rtl::OUString > aProtocols(2); + // don't dispatch mailto hyperlink to desktop dispatcher + rReq.RemoveItem( SID_TARGETNAME ); + rReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii("_self") ) ); + } + else if ( aINetProtocol == INET_PROT_FTP || + aINetProtocol == INET_PROT_HTTP || + aINetProtocol == INET_PROT_HTTPS ) + { + sfx2::openUriExternally(aURL.Complete, true); + return; + } + else + { + // check for "internal" protocols that should not be forwarded to the system + Sequence < ::rtl::OUString > aProtocols(2); - // add special protocols that always should be treated as internal - aProtocols[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:*")); - aProtocols[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.*")); + // add special protocols that always should be treated as internal + aProtocols[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:*")); + aProtocols[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.*")); - try + try + { + // get registered protocol handlers from configuration + Reference < XNameAccess > xAccess( ::comphelper::ConfigurationHelper::openConfig( ::comphelper::getProcessServiceFactory(), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.ProtocolHandler/HandlerSet")), ::comphelper::ConfigurationHelper::E_READONLY ), UNO_QUERY ); + if ( xAccess.is() ) { - // get registered protocol handlers from configuration - Reference < XNameAccess > xAccess( ::comphelper::ConfigurationHelper::openConfig( ::comphelper::getProcessServiceFactory(), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.ProtocolHandler/HandlerSet")), ::comphelper::ConfigurationHelper::E_READONLY ), UNO_QUERY ); - if ( xAccess.is() ) + Sequence < ::rtl::OUString > aNames = xAccess->getElementNames(); + for ( sal_Int32 nName = 0; nName < aNames.getLength(); nName ++) { - Sequence < ::rtl::OUString > aNames = xAccess->getElementNames(); - for ( sal_Int32 nName = 0; nName < aNames.getLength(); nName ++) + Reference < XPropertySet > xSet; + Any aRet = xAccess->getByName( aNames[nName] ); + aRet >>= xSet; + if ( xSet.is() ) { - Reference < XPropertySet > xSet; - Any aRet = xAccess->getByName( aNames[nName] ); - aRet >>= xSet; - if ( xSet.is() ) - { - // copy protocols - aRet = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Protocols")) ); - Sequence < ::rtl::OUString > aTmp; - aRet >>= aTmp; - - // todo: add operator+= to SequenceAsVector class and use SequenceAsVector for aProtocols - sal_Int32 nLength = aProtocols.getLength(); - aProtocols.realloc( nLength+aTmp.getLength() ); - for ( sal_Int32 n=0; n<aTmp.getLength(); n++ ) - aProtocols[(++nLength)-1] = aTmp[n]; - } + // copy protocols + aRet = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Protocols")) ); + Sequence < ::rtl::OUString > aTmp; + aRet >>= aTmp; + + // todo: add operator+= to SequenceAsVector class and use SequenceAsVector for aProtocols + sal_Int32 nLength = aProtocols.getLength(); + aProtocols.realloc( nLength+aTmp.getLength() ); + for ( sal_Int32 n=0; n<aTmp.getLength(); n++ ) + aProtocols[(++nLength)-1] = aTmp[n]; } } } - catch ( Exception& ) - { - // registered protocols could not be read - } + } + catch ( Exception& ) + { + // registered protocols could not be read + } - sal_Bool bFound = sal_False; - for ( sal_Int32 nProt=0; nProt<aProtocols.getLength(); nProt++ ) + sal_Bool bFound = sal_False; + for ( sal_Int32 nProt=0; nProt<aProtocols.getLength(); nProt++ ) + { + WildCard aPattern(aProtocols[nProt]); + if ( aPattern.Matches( aURL.Complete ) ) { - WildCard aPattern(aProtocols[nProt]); - if ( aPattern.Matches( aURL.Complete ) ) - { - bFound = sal_True; - break; - } + bFound = sal_True; + break; } + } - if ( !bFound ) - { - sal_Bool bLoadInternal = sal_False; + if ( !bFound ) + { + sal_Bool bLoadInternal = sal_False; - // security reservation: => we have to check the referer before executing - if (SFX_APP()->IsSecureURL(rtl::OUString(), &aReferer)) + // security reservation: => we have to check the referer before executing + if (SFX_APP()->IsSecureURL(rtl::OUString(), &aReferer)) + { + try { - ::rtl::OUString aURLString( aURL.Complete ); - - try - { - // give os this file - xSystemShellExecute->execute( aURLString, ::rtl::OUString(), SystemShellExecuteFlags::DEFAULTS ); - } - catch ( ::com::sun::star::lang::IllegalArgumentException& ) - { - SolarMutexGuard aGuard; - Window *pWindow = SFX_APP()->GetTopWindow(); - ErrorBox( pWindow, SfxResId( MSG_ERR_NO_WEBBROWSER_FOUND )).Execute(); - } - catch ( ::com::sun::star::system::SystemShellExecuteException& ) - { - if ( !pFilter ) - { - SolarMutexGuard aGuard; - Window *pWindow = SFX_APP()->GetTopWindow(); - ErrorBox( pWindow, SfxResId( MSG_ERR_NO_WEBBROWSER_FOUND )).Execute(); - } - else - { - rReq.RemoveItem( SID_TARGETNAME ); - rReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii("_default") ) ); - bLoadInternal = sal_True; - } - } + sfx2::openUriExternally( + aURL.Complete, pFilter == 0); } - else + catch ( ::com::sun::star::system::SystemShellExecuteException& ) { - SfxErrorContext aCtx( ERRCTX_SFX_OPENDOC, aURL.Complete ); - ErrorHandler::HandleError( ERRCODE_IO_ACCESSDENIED ); + rReq.RemoveItem( SID_TARGETNAME ); + rReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii("_default") ) ); + bLoadInternal = sal_True; } - - if ( !bLoadInternal ) - return; } + else + { + SfxErrorContext aCtx( ERRCTX_SFX_OPENDOC, aURL.Complete ); + ErrorHandler::HandleError( ERRCODE_IO_ACCESSDENIED ); + } + + if ( !bLoadInternal ) + return; } } } diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index ad68da701e04..5b8bd18d9d06 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -369,7 +369,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) 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::DEFAULTS ); + xSystemShellExecute->execute( sURL, ::rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::URIS_ONLY ); } catch ( uno::Exception& ) { @@ -977,7 +977,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) xSystemShell->execute( aURLBuf.makeStringAndClear(), ::rtl::OUString(), - css::system::SystemShellExecuteFlags::DEFAULTS ); + css::system::SystemShellExecuteFlags::URIS_ONLY ); } } catch( const ::com::sun::star::uno::Exception& ) diff --git a/sfx2/source/appl/openuriexternally.cxx b/sfx2/source/appl/openuriexternally.cxx new file mode 100644 index 000000000000..db889ce0de47 --- /dev/null +++ b/sfx2/source/appl/openuriexternally.cxx @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * [ Copyright (C) 2012 Red Hat, Inc., Stephan Bergmann <sbergman@redhat.com> + * (initial developer) ] + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "sal/config.h" + +#include "com/sun/star/lang/IllegalArgumentException.hpp" +#include "com/sun/star/system/XSystemShellExecute.hpp" +#include "com/sun/star/system/SystemShellExecuteException.hpp" +#include "com/sun/star/system/SystemShellExecuteFlags.hpp" +#include "com/sun/star/uno/Reference.hxx" +#include "com/sun/star/uno/RuntimeException.hpp" +#include "com/sun/star/uno/XInterface.hpp" +#include "comphelper/processfactory.hxx" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" +#include "sfx2/app.hxx" +#include "sfx2/sfxresid.hxx" +#include "vcl/msgbox.hxx" +#include "vcl/svapp.hxx" + +#include "openuriexternally.hxx" + +#include "app.hrc" + +namespace { + +namespace css = com::sun::star; + +} + +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); + try { + exec->execute( + uri, rtl::OUString(), + css::system::SystemShellExecuteFlags::URIS_ONLY); + return true; + } catch (css::lang::IllegalArgumentException & e) { + if (e.ArgumentPosition != 0) { + throw css::uno::RuntimeException( + (rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "unexpected IllegalArgumentException: ")) + + e.Message), + css::uno::Reference< css::uno::XInterface >()); + } + SolarMutexGuard g; + WarningBox wb( + SfxGetpApp()->GetTopWindow(), + SfxResId(RID_SECURITY_WARNING_NO_HYPERLINKS)); + wb.SetText(SfxResId(RID_SECURITY_WARNING_TITLE)); + wb.Execute(); + } catch (css::system::SystemShellExecuteException &) { + if (!handleSystemShellExecuteException) { + throw; + } + SolarMutexGuard g; + ErrorBox( + SfxGetpApp()->GetTopWindow(), + SfxResId(MSG_ERR_NO_WEBBROWSER_FOUND)). + Execute(); + } + return false; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 47f470e98175..b5650ac46d1d 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -693,7 +693,7 @@ static bool impl_showOnlineHelp( const String& rURL ) if ( xSystemShell.is() ) { - xSystemShell->execute( aHelpLink, rtl::OUString(), SystemShellExecuteFlags::DEFAULTS ); + xSystemShell->execute( aHelpLink, rtl::OUString(), SystemShellExecuteFlags::URIS_ONLY ); return true; } } diff --git a/sfx2/source/inc/openuriexternally.hxx b/sfx2/source/inc/openuriexternally.hxx new file mode 100644 index 000000000000..79a05a86b03d --- /dev/null +++ b/sfx2/source/inc/openuriexternally.hxx @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * [ Copyright (C) 2012 Red Hat, Inc., Stephan Bergmann <sbergman@redhat.com> + * (initial developer) ] + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef INCLUDED_SFX2_SOURCE_INC_OPENURIEXTERNALLY_HXX +#define INCLUDED_SFX2_SOURCE_INC_OPENURIEXTERNALLY_HXX + +#include "sal/config.h" + +namespace rtl { class OUString; } + +namespace sfx2 { + +/// Open a URI via com.sun.star.system.SystemShellExecute +/// +/// Handles XSystemShellExecute.execute's IllegalArgumentException (throwing a +/// RuntimeException if it is unexpected, i.e., not caused by the given uri not +/// being an absolute URI reference). +/// +/// Handles XSystemShellExecute.execute's SystemShellExecuteException unless the +/// given handleSystemShellExecuteException is false (in which case the +/// exception is re-thrown). +/// +/// @return true iff execution was successful +bool openUriExternally( + rtl::OUString const & uri, bool handleSystemShellExecuteException); + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/view.hrc b/sfx2/source/view/view.hrc index 3dce1ec795bb..adcc3a811b92 100755 --- a/sfx2/source/view/view.hrc +++ b/sfx2/source/view/view.hrc @@ -63,7 +63,7 @@ #define MSG_QUERY_OPENASTEMPLATE (RID_SFX_VIEW_START+41) #define MSG_CANT_CLOSE (RID_SFX_VIEW_START+42) -#define MSG_ERROR_NO_WEBBROWSER_FOUND (RID_SFX_VIEW_START+43) + #define TP_FRAMEPROPERTIES (RID_SFX_VIEW_START+44) #define FT_FRAMENAME 3 diff --git a/sfx2/source/view/view.src b/sfx2/source/view/view.src index b4c09a0677ed..40a686248f1c 100644 --- a/sfx2/source/view/view.src +++ b/sfx2/source/view/view.src @@ -170,21 +170,3 @@ String STR_REPAIREDDOCUMENT { Text [ en-US ] = " (repaired document)" ; }; - -ErrorBox MSG_ERROR_NO_WEBBROWSER_FOUND -{ - BUTTONS = WB_OK ; - DEFBUTTON = WB_DEF_OK ; - Message[ en-US ] = "%PRODUCTNAME could not find a web browser on your system. Please check your Desktop Preferences or install a web browser (for example, Mozilla) in the default location requested during the browser installation." ; -}; - - - - - - - - - - - diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index d85b2c6e6167..394d3462fb83 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -39,8 +39,6 @@ #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/SystemShellExecuteFlags.hpp> #include <com/sun/star/container/XContainerQuery.hpp> #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp> @@ -86,6 +84,7 @@ #include "workwin.hxx" #include <sfx2/objface.hxx> #include <sfx2/docfilt.hxx> +#include "openuriexternally.hxx" #include <comphelper/processfactory.hxx> @@ -94,7 +93,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::util; -using namespace ::com::sun::star::system; using namespace ::cppu; namespace css = ::com::sun::star; @@ -729,29 +727,8 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) return; } - ::com::sun::star::uno::Reference< XSystemShellExecute > xSystemShellExecute( xSMGR->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.system.SystemShellExecute"))), - css::uno::UNO_QUERY ); - - sal_Bool bRet( sal_True ); - if ( xSystemShellExecute.is() ) - { - try - { - xSystemShellExecute->execute( - aFileURL, ::rtl::OUString(), SystemShellExecuteFlags::DEFAULTS ); - } - catch (const uno::Exception&) - { - SolarMutexGuard aGuard; - Window *pParent = SFX_APP()->GetTopWindow(); - ErrorBox( pParent, SfxResId( MSG_ERROR_NO_WEBBROWSER_FOUND )).Execute(); - bRet = sal_False; - } - } - - rReq.Done(bRet); - break; + rReq.Done(sfx2::openUriExternally(aFileURL, true)); + break; } else { |