summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2016-08-01 10:32:20 +0200
committerGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2016-08-01 12:10:32 +0000
commit06cc80bb9535570dbb2ebade182c93ffc431277f (patch)
treeb31bb045a92cf8d03863b48a57efe3b353fb188b /sfx2
parent8e495518c36359e565d6c172688e7120c477137f (diff)
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 <ci@libreoffice.org> Reviewed-by: Giuseppe Castagno <giuseppe.castagno@acca-esse.eu>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/docfile.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 6007d25f2026..366a2f377310 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;
}