sfx2/source/doc/docfile.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit c4c30cfac570aeb0f8ac91b36b986e438e2811bc
Author: Giuseppe Castagno <giuseppe.casta...@acca-esse.eu>
Date:   Sat Jul 30 11:53:34 2016 +0200

    Fix the WebDAV lock owner name shown on file locked dialog UI
    
    Probably due to 8d411a4a1ef6844c00bc714f8b144d3729e4f4e8.
    
    See comment in the added code for details.
    
    Change-Id: I3e8a856a715385ed2ab1d9ecda31dd25e05e6c59
    Reviewed-on: https://gerrit.libreoffice.org/27716
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Giuseppe Castagno <giuseppe.casta...@acca-esse.eu>
    (cherry picked from commit 97353e5c43815b45a6f365ccaea474899683d38e)
    Reviewed-on: https://gerrit.libreoffice.org/27728
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 6a0c4c9..288632c 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1006,7 +1006,17 @@ void SfxMedium::LockOrigFileOnDemand( bool bLoading, 
bool bNoUI )
                                 css::ucb::Lock aLock = aLocks[0];
                                 OUString aOwner;
                                 if(aLock.Owner >>= aOwner)
+                                {
+                                    // This solution works right when the LO 
user name and the WebDAV user
+                                    // name are the same.
+                                    // A better thing to do would be to obtain 
the 'real' WebDAV user name,
+                                    // but that's not possible from a WebDAV 
UCP provider client.
+                                    LockFileEntry aOwnData = 
svt::LockFileCommon::GenerateOwnEntry();
+                                    // use the current LO user name as the 
system name
+                                    aLockData[LockFileComponent::SYSUSERNAME] 
= aOwnData[LockFileComponent::SYSUSERNAME];
+                                    // we need to display the WebDAV user name 
owning the lock, not the local one
                                     aLockData[LockFileComponent::OOOUSERNAME] 
= aOwner;
+                                }
                             }
 
                             if ( !bResult && !bNoUI )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to