diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-04-18 00:42:17 +0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-04-18 09:08:03 +0200 |
commit | 642a49e8d3006d000bc6c58def34d4e96764c6cc (patch) | |
tree | 898e31dc24bdca980e97dc2139dc235a2dec5c02 /sfx2 | |
parent | 6f45e696874401a224fa6c3c6b299933b3ae793f (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>
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 d3f78d2d6078..9d23b512bc25 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -72,6 +72,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> @@ -1305,7 +1306,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); |