summaryrefslogtreecommitdiff
path: root/sfx2/source/doc/docfile.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-01-09 10:54:10 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-06-28 08:33:46 +0200
commit20b1e6440aacab043753e93be4499e939a80b05b (patch)
tree1ac64459d876a7b2bf24afc70f115ad40b685e90 /sfx2/source/doc/docfile.cxx
parent80eb3fd393dd6d67f931c03b261b2558c7198da2 (diff)
tdf#126121: WebDAV redirection detection
This rewrites URI of a document opened from a WebDAV mapped UNC path on Windows (like "file://server/DavWWWRoot/Dir/Doc.odt") into HTTP URI (like "http://server/Dir/Doc.odt"). This allows using WebDAV protocol for these files, and e.g. get information about other user who locked the document to show when asking if open read-only or a copy. Change-Id: I643fa8df30d4b163783b279b1b973304fcafff37 Reviewed-on: https://gerrit.libreoffice.org/71746 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sfx2/source/doc/docfile.cxx')
-rw-r--r--sfx2/source/doc/docfile.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 46d75db945c3..da295c476991 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -242,7 +242,7 @@ bool IsFileMovable(const INetURLObject& rURL)
if (buf.st_nlink > 1 || S_ISLNK(buf.st_mode))
return false;
#elif defined _WIN32
- if (tools::IsMappedWebDAVPath(rURL))
+ if (tools::IsMappedWebDAVPath(rURL.GetMainURL(INetURLObject::DecodeMechanism::NONE)))
return false;
#endif
@@ -1382,7 +1382,8 @@ SfxMedium::LockFileResult SfxMedium::LockOrigFileOnDemand( bool bLoading, bool b
}
catch (const uno::Exception&)
{
- if (tools::IsMappedWebDAVPath(GetURLObject()))
+ if (tools::IsMappedWebDAVPath(GetURLObject().GetMainURL(
+ INetURLObject::DecodeMechanism::NONE)))
{
// This is a path that redirects to a WebDAV resource;
// so failure creating lockfile is not an error here.