summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-08-01 10:52:12 +0200
committerAndras Timar <andras.timar@collabora.com>2019-08-21 20:31:16 +0200
commit34c38548620ec20d34741badf94356c6987291da (patch)
tree16adc9f7cce64ea89b63e9bded17859cc4c0da93 /shell
parent8ac0acb0e4a9017fdde8515fd5f7957307767e5b (diff)
tdf#126641: don't fail on file URLs with fragment
This only fixes part that the URL refuses to open the target file. Honoring fragment isn't fixed here, since it's the system call to ShellExecuteExW that in this case internally converts the file URL into a system path, and strips the fragment from it. Regression from commit d59ec4cd1660410fa1b18c50d2d83b1417a82ddc. Change-Id: I6c9ed27e9a5bd7f2780dd3be96f816a6e825e043 Reviewed-on: https://gerrit.libreoffice.org/76778 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 2207269a84c7c9920af3385b837ce67978c720b4) Reviewed-on: https://gerrit.libreoffice.org/76848 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit dd2b7919058fc0e23a7117d39110d3ecaaad1fb2) Reviewed-on: https://gerrit.libreoffice.org/76881 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Reviewed-on: https://gerrit.libreoffice.org/77893 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/source/win32/SysShExec.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 4786e4ddedc7..910aae1c095f 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -315,7 +315,9 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa
}
if (uri->getScheme().equalsIgnoreAsciiCase("file")) {
OUString pathname;
- auto const e1 = osl::FileBase::getSystemPathFromFileURL(aCommand, pathname);
+ uri->clearFragment(); // getSystemPathFromFileURL fails for URLs with fragment
+ auto const e1
+ = osl::FileBase::getSystemPathFromFileURL(uri->getUriReference(), pathname);
if (e1 != osl::FileBase::E_None) {
throw css::lang::IllegalArgumentException(
("XSystemShellExecute.execute, getSystemPathFromFileURL <" + aCommand