Apache OpenOffice (AOO) Bugzilla – Issue 106389
package: dubious && || in ZipPackageFolder.cxx
Last modified: 2017-05-20 10:24:08 UTC
i.e. we have... if ( !bUseNonSeekableAccess && ( bRawStream || bTransportOwnEncrStreamAsRaw || ( pStream->IsPackageMember() && !bToBeEncrypted && ( pStream->aEntry.nMethod == DEFLATED && bToBeCompressed ) || ( pStream->aEntry.nMethod == STORED && !bToBeCompressed ) ) ) ) which is parsed as if ( !bUseNonSeekableAccess && ( bRawStream || bTransportOwnEncrStreamAsRaw || (( pStream->IsPackageMember() && !bToBeEncrypted && ( pStream->aEntry.nMethod == DEFLATED && bToBeCompressed )) || ( pStream->aEntry.nMethod == STORED && !bToBeCompressed ) ) ) ) which is a little suspicious, I suspect it might have been intended to be if ( !bUseNonSeekableAccess && ( bRawStream || bTransportOwnEncrStreamAsRaw || ( pStream->IsPackageMember() && !bToBeEncrypted && (( pStream->aEntry.nMethod == DEFLATED && bToBeCompressed ) || ( pStream->aEntry.nMethod == STORED && !bToBeCompressed )) ) ) ) patch 1 keeps our current logic and silences warning, patch 2 changes the logic to what might have been intended
Created attachment 65706 [details] keep logic
Created attachment 65707 [details] change logic
mav->cmc: Thank you for the patch. You are completely right, generally speaking the changed version is the correct one. The interesting thing is that the source code functions correctly now, because the stream has nMethod set only if it is a package member, and if the stream should be encrypted it must be compressed as well. Anyway, the current implementation works by luck and is not clear, so I will integrate the second patch in the next 3.3 framework cws.
Changing the component to framework.
The fix is integrated in cws fwk138.
Development issue, setting myself to verified.