[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sfx2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Sep 17 13:58:52 UTC 2018


 sfx2/source/doc/docfile.cxx |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit f06aea9b31707ec49355e41b0e682d4a15431e44
Author:     Miklos Vajna <vmiklos at collabora.co.uk>
AuthorDate: Mon Sep 10 21:01:07 2018 +0200
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Sep 17 15:58:31 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.
    
    (cherry picked from commit 7823684cb6fbe752dc64300799c5d102f61e0b70)
    
    Change-Id: I529467cc3d432d04e593f936c13ed4656a18150c
    Reviewed-on: https://gerrit.libreoffice.org/60307
    Tested-by: Jenkins
    Tested-by: Xisco Faulí <xiscofauli at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index e6a858ae6bf8..a852a01e644e 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -199,10 +199,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
@@ -220,6 +227,7 @@ bool IsNotLinkedFile(const OUString& rURL)
 #endif
 
     return true;
+#endif
 }
 
 } // anonymous namespace
@@ -1852,7 +1860,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


More information about the Libreoffice-commits mailing list