diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-04-18 00:42:17 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-04-26 11:24:14 +0200 |
commit | cd683ace64e8024fb59d97c439f408b3550e3fce (patch) | |
tree | 3cdbae71f0c8fafd26f08c15e7d3ed9a504513db /sfx2 | |
parent | 8f0e11c7bed35f44ecbb12ac43179d33f077bcd0 (diff) |
tdf#116420: Windows: Test if a filepath redirects to a WebDAV resource
In Windows, filesystem redirectors can map WebDAV resources to UNC
paths, or to drive-based "local" paths; so a WebDAV URI of the form
"http://WebDADServer/root/directory/File.ext" may be accessed using
"\\WebDADServer\root\directory\File.ext" or "Z:\directory\File.ext".
When using these paths, failure to create a lockfile aside the opened
document should not be considered an error; so this patch checks for
this.
Regression from commit 6ca3b3648e25ae9d4d2d29a0df83349198ec3f5e.
Change-Id: I1de55b66447dc91d22b6d2b5b121de96bf32e4ee
Reviewed-on: https://gerrit.libreoffice.org/53070
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit 642a49e8d3006d000bc6c58def34d4e96764c6cc)
Reviewed-on: https://gerrit.libreoffice.org/53105
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 8ae94f175b6a..273d201e94d0 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -68,6 +68,7 @@ #include <com/sun/star/security/DocumentDigitalSignatures.hpp> #include <o3tl/make_unique.hxx> #include <tools/urlobj.hxx> +#include <tools/fileutil.hxx> #include <unotools/configmgr.hxx> #include <unotools/tempfile.hxx> #include <comphelper/fileurl.hxx> @@ -1252,7 +1253,13 @@ SfxMedium::LockFileResult SfxMedium::LockOrigFileOnDemand( bool bLoading, bool b } catch (const uno::Exception&) { - if (bLoading && !bNoUI) + if (tools::IsMappedWebDAVPath(GetURLObject())) + { + // This is a path that redirects to a WebDAV resource; + // so failure creating lockfile is not an error here. + bResult = true; + } + else if (bLoading && !bNoUI) { bIoErr = true; ShowLockFileProblemDialog(MessageDlg::LockFileIgnore); |