diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-04-18 00:42:17 +0300 |
---|---|---|
committer | Aron Budea <aron.budea@collabora.com> | 2018-04-18 15:05:54 +0200 |
commit | a4ef8f7646beda733ad926911d0ab7c8ab42f69f (patch) | |
tree | b378a3bb1723d7e0c4499aeb38797a5a21ad6be2 /sfx2 | |
parent | 978891859ac474adf7eb18389cad175c3db04507 (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/53084
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Aron Budea <aron.budea@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 dfcf9d94d09f..bf637cbb1bfe 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -70,6 +70,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> @@ -1287,7 +1288,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); |