diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-04-13 20:59:39 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-04-19 15:27:50 +0200 |
commit | 122905d30e8918e0ebe0ad3a84a50c7681ae228e (patch) | |
tree | 0d62d3a36db5ecf579be43130100e59a12ae35c6 | |
parent | d40c6601330b70c3cb9c1be0fa9e9775ad51113c (diff) |
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.stahl@allotropia.de>
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
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; |