sfx2/source/doc/docfile.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
New commits: commit 06cc80bb9535570dbb2ebade182c93ffc431277f Author: Giuseppe Castagno <giuseppe.casta...@acca-esse.eu> Date: Mon Aug 1 10:32:20 2016 +0200 Put the initialization out of 'if' scope A better change than the one I did in 97353e5c43815b45a6f365ccaea474899683d38e. The "DAV:lockdiscovery" property may not be returned, so the initialization should be done before getting said property. Change-Id: Iae87df798439fc582a66dd3c0fe353ebb859b7b6 Reviewed-on: https://gerrit.libreoffice.org/27767 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Giuseppe Castagno <giuseppe.casta...@acca-esse.eu> diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 6007d25..366a2f3 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -1008,8 +1008,16 @@ void SfxMedium::LockOrigFileOnDemand( bool bLoading, bool bNoUI ) // See http://tools.ietf.org/html/rfc4918#section-14.17 for details LockFileEntry aLockData; aLockData[LockFileComponent::OOOUSERNAME] = "Unknown user"; + // 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]; uno::Sequence< css::ucb::Lock > aLocks; + // getting the property, send a PROPFIND to the server over the net if( aContentToLock.getPropertyValue( "DAV:lockdiscovery" ) >>= aLocks ) { // got at least a lock, show the owner of the first lock returned @@ -1017,13 +1025,6 @@ void SfxMedium::LockOrigFileOnDemand( bool bLoading, bool bNoUI ) 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; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits