summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-09-10 21:01:07 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-09-11 08:59:12 +0200
commit7823684cb6fbe752dc64300799c5d102f61e0b70 (patch)
treee020b98ef65c0271406428e5918e43d02f837293
parent27463197176fd7f68cbdeed790621dad6b4c63d3 (diff)
tdf#119316 sfx2 store: no move on macOS
osl::FileStatus::getAttributes() and osl::File::setAttributes() doesn't preserve all the necessary file properties (at least "Hide extension" is not handled), so always copy on macOS instead. Change-Id: I529467cc3d432d04e593f936c13ed4656a18150c Reviewed-on: https://gerrit.libreoffice.org/60294 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sfx2/source/doc/docfile.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 2e6fc691cea2..6d2aa63dc242 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -200,10 +200,17 @@ sal_uInt64 GetDefaultFileAttributes(const OUString& rURL)
return nRet;
}
-/// Determines if rURL is a non-linked (symlink or hardlink) file:// URL.
-bool IsNotLinkedFile(const OUString& rURL)
+/// Determines if rURL is safe to move or not.
+bool IsFileMovable(const OUString& rURL)
{
+#ifdef MACOSX
+ (void)rURL;
+ // Hide extension macOS-specific file property would be lost.
+ return false;
+#else
+
if (!comphelper::isFileUrl(rURL))
+ // Not a file:// URL.
return false;
#ifdef UNX
@@ -221,6 +228,7 @@ bool IsNotLinkedFile(const OUString& rURL)
#endif
return true;
+#endif
}
} // anonymous namespace
@@ -1837,7 +1845,7 @@ void SfxMedium::TransactedTransferForFS_Impl( const INetURLObject& aSource,
OUString aDestMainURL = aDest.GetMainURL(INetURLObject::DecodeMechanism::NONE);
sal_uInt64 nAttributes = GetDefaultFileAttributes(aDestMainURL);
- if (IsNotLinkedFile(aDestMainURL) && osl::File::move(aSourceMainURL, aDestMainURL) == osl::FileBase::E_None)
+ if (IsFileMovable(aDestMainURL) && osl::File::move(aSourceMainURL, aDestMainURL) == osl::FileBase::E_None)
{
if (nAttributes)
// Adjust attributes, source might be created with