sfx2/source/view/viewfrm.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
New commits: commit 122905d30e8918e0ebe0ad3a84a50c7681ae228e Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Wed Apr 13 20:59:39 2022 +0200 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Tue Apr 19 15:27:50 2022 +0200 sfx2: fix utterly confusing bools in SfxViewFrame::ExecReload_Impl() bPhysObjIsYounger variable is actually true if aPhysObj is *older* than aMedObj. Due to the "bNeedsReload = true" that was added in commit b505ca5b9c31b3d9c639406d03a25bea4e914242 i had first thought that commit b4576f3da4d90139fc5140962d13cb91dab98797 is at fault and inverted the condition - but not so, its only crime is mis-naming the variable and the "bNeedsReload = true" is actually dead code because this branch always returns before any use of bNeedsReload further below. Meanwhile, commit f1035312f80746fdf4a7a04039db73b27d1387c3 actually did invert the condition, but that was in 2004 and presumably intentional. Change-Id: Ie342163a1de434f99c521e97711157a76191da0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133029 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 95574c8892b0..1a7eeafb2bee 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -437,7 +437,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) // etag tells that the cache representation (e.g. in LO) is different from the one on the server, // but tells nothing about the age // Details at this link: http://tools.ietf.org/html/rfc4918#section-15, section 15.7 - bool bPhysObjIsYounger = ::utl::UCBContentHelper::IsYounger( aMedObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), + bool const bPhysObjIsOlder = ::utl::UCBContentHelper::IsYounger(aMedObj.GetMainURL( INetURLObject::DecodeMechanism::NONE), aPhysObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); bool bIsWebDAV = aMedObj.isAnyKnownWebDAVScheme(); @@ -446,14 +446,12 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) if ( ( !bNeedsReload && ( ( aMedObj.GetProtocol() == INetProtocol::File && ( aMedObj.getFSysPath( FSysStyle::Detect ) != aPhysObj.getFSysPath( FSysStyle::Detect ) || bPasswordEntered ) && - !bPhysObjIsYounger ) - || ( bIsWebDAV && !bPhysObjIsYounger ) + !bPhysObjIsOlder) + || (bIsWebDAV && !bPhysObjIsOlder) || ( pMed->IsRemote() && !bIsWebDAV ) ) ) || pVersionItem ) // <- tdf#82744 { - bNeedsReload = true; - bool bOK = false; bool bRetryIgnoringLock = false; bool bOpenTemplate = false;