sfx2/source/doc/docfile.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
New commits: commit 7823684cb6fbe752dc64300799c5d102f61e0b70 Author: Miklos Vajna <vmik...@collabora.co.uk> AuthorDate: Mon Sep 10 21:01:07 2018 +0200 Commit: Miklos Vajna <vmik...@collabora.co.uk> CommitDate: Tue Sep 11 08:59:12 2018 +0200 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 <vmik...@collabora.co.uk> 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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits