From 97353e5c43815b45a6f365ccaea474899683d38e Mon Sep 17 00:00:00 2001 From: Giuseppe Castagno Date: Sat, 30 Jul 2016 11:53:34 +0200 Subject: 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 Reviewed-by: Giuseppe Castagno --- sfx2/source/doc/docfile.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sfx2') diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 4ac02407fbe8..6007d25f2026 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -1016,7 +1016,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 ) -- cgit